blob: a84dd9581e66fbf4f0d32e8982166dc31092b4aa [file] [log] [blame]
--- a/configure.ac
+++ b/configure.ac
@@ -214,6 +214,20 @@
fi
+dnl Get the host compiler if cross-compiling
+dnl
+AM_CONDITIONAL(CROSS_COMPILING, [ test $cross_compiling = yes ])
+AC_MSG_CHECKING([for CC_FOR_BUILD])
+if test "x${CC_FOR_BUILD+set}" != "xset" ; then
+ if test "x$cross_compiling" = "xyes" ; then
+ CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
+ else
+ CC_FOR_BUILD=${CC}
+ fi
+fi
+AC_MSG_RESULT([$CC_FOR_BUILD])
+AC_SUBST(CC_FOR_BUILD)
+
AC_CONFIG_FILES(
Makefile
pygobject-2.0.pc
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -71,6 +71,13 @@
if PLATFORM_WIN32
_gobject_la_CFLAGS += -DPLATFORM_WIN32
endif
+
+# Strip all the noise (system includes/etc...) before the main func
+generate-constants$(EXEEXT): generate-constants.c
+ printf '#include <stdio.h>\nint main()' > generate-constants.pre.c
+ $(CC) $(generate_constants_CFLAGS) -E generate-constants.c | sed -e '1,/^int main/d' >> generate-constants.pre.c
+ $(CC_FOR_BUILD) -o $@ generate-constants.pre.c
+ rm -f generate-constants.pre.c