Commit a04e30ba3dc303133d459c1ac273ceefe4d49b32

Anthony Green 2014-02-28T17:20:59

Add missing -DFFI_DEBUG flag

diff --git a/ChangeLog b/ChangeLog
index 952ad32..19beda8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-02-28  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for
+	--enable-debug builds.
+	* Makefile.in: Rebuilt.
+
+2014-02-28  Makoto Kato  <m_kato@ga2.so-net.ne.jp>
+
+	* src/closures.c: Fix build failure when using clang for Android.
+
 2014-02-28  Marcin Wojdyr  <wojdyr@gmail.com>
 
 	* libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead
diff --git a/Makefile.am b/Makefile.am
index d25aebd..0791e00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -236,6 +236,13 @@ nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
 
+AM_CFLAGS =
+if FFI_DEBUG
+# Build debug. Define FFI_DEBUG on the commandline so that, when building with
+# MSVC, it can link against the debug CRT.
+AM_CFLAGS += -DFFI_DEBUG
+endif
+
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
diff --git a/Makefile.in b/Makefile.in
index 220e6fd..748bac4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -118,6 +118,9 @@ target_triplet = @target@
 @XTENSA_TRUE@am__append_36 = src/xtensa/sysv.S src/xtensa/ffi.c
 @METAG_TRUE@am__append_37 = src/metag/sysv.S src/metag/ffi.c
 @VAX_TRUE@am__append_38 = src/vax/elfbsd.S src/vax/ffi.c
+# Build debug. Define FFI_DEBUG on the commandline so that, when building with
+# MSVC, it can link against the debug CRT.
+@FFI_DEBUG_TRUE@am__append_39 = -DFFI_DEBUG
 subdir = .
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/configure $(am__configure_deps) \
@@ -705,6 +708,7 @@ nodist_libffi_la_SOURCES = $(am__append_1) $(am__append_2) \
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
+AM_CFLAGS = $(am__append_39)
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)