diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2009-05-06 15:34:20 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2009-05-06 15:34:20 +0000 |
commit | a329cfaf34c1e5f7b60e19a6e2609ebb0e33659a (patch) | |
tree | 8e8d0d912bc5d0fb87bf150a169a87e1becda714 | |
parent | 5eb7f197b0a2a6b90bc5dd0acaacf84462fb48cc (diff) |
hopefully better tests for universal binary support
svn path=/trunk/externals/zexy/; revision=11243
-rw-r--r-- | src/Make.config.in | 2 | ||||
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/acinclude.m4 | 58 | ||||
-rw-r--r-- | src/configure.ac | 1 |
4 files changed, 39 insertions, 24 deletions
diff --git a/src/Make.config.in b/src/Make.config.in index 3721428..0664f89 100644 --- a/src/Make.config.in +++ b/src/Make.config.in @@ -25,7 +25,7 @@ LFLAGS = @LFLAGS@ Z_CFLAGS = $(IFLAGS) $(DEFS) $(BUILDLIBRARY) -DPD $(WFLAGS) @CFLAGS@ $(CFLAGS) LIBS = @LIBS@ MAKEDEP_FLAGS = @MAKEDEP_FLAGS@ -ARCH_FLAG = @ARCH_FLAG@ CONFIGUREFLAGS = @CONFIGUREFLAGS@ +Z_CPPFLAGS = $(IFLAGS) $(DEFS) $(BUILDLIBRARY) -DPD $(WFLAGS) @CPPFLAGS@ $(CPPFLAGS) diff --git a/src/Makefile b/src/Makefile index 524aed0..ddf6ef6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -40,7 +40,7 @@ ifdef MAKEDEP_FLAGS ## see http://www.gnu.org/software/make/manual/html_node/make_47.html#SEC51 %.d: %.c @set -e; rm -f $@; \ - $(CPP) $(MAKEDEP_FLAGS) $(Z_CFLAGS) $< > $@.$$$$; \ + $(CPP) $(MAKEDEP_FLAGS) $(Z_CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ endif diff --git a/src/acinclude.m4 b/src/acinclude.m4 index 30a5080..f546de5 100644 --- a/src/acinclude.m4 +++ b/src/acinclude.m4 @@ -3,51 +3,69 @@ dnl This file is free software; IOhannes m zmölnig dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -# AC_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +# AC_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # -# checks whether the $(CXX) compiler accepts the ADDITIONAL-CXXFLAGS -# if so, they are added to the CXXFLAGS -AC_DEFUN([AC_CHECK_CXXFLAGS], +# checks whether the $(C) compiler accepts the ADDITIONAL-CPPFLAGS +# if so, they are added to the CPPFLAGS +AC_DEFUN([AC_CHECK_CPPFLAGS], [ - AC_MSG_CHECKING([whether $CXX accepts "$1"]) -cat > conftest.c++ << EOF + AC_MSG_CHECKING([whether $CPP accepts "$1"]) + temp_check_cppflags="${CPPFLAGS}" + CPPFLAGS="$1 ${CPPFLAGS}" + AC_PREPROC_IFELSE( + [AC_LANG_SOURCE([[int main(void){return 0;}]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]); CPPFLAGS="${temp_check_cppflags}"]) +])# AC_CHECK_CPPFLAGS + + + +# AC_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +# +# checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS +# if so, they are added to the CFLAGS +AC_DEFUN([AC_CHECK_CFLAGS], +[ + AC_MSG_CHECKING([whether $CC accepts "$1"]) +cat > conftest.c << EOF int main(){ return 0; } EOF -if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1 +if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1 then AC_MSG_RESULT([yes]) - CXXFLAGS="${CXXFLAGS} [$1]" + AC_CHECK_CPPFLAGS([$1]) + CFLAGS="${CFLAGS} [$1]" [$2] else AC_MSG_RESULT([no]) [$3] fi -])# AC_CHECK_CXXFLAGS +])# AC_CHECK_CFLAGS -# AC_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +# AC_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # -# checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS -# if so, they are added to the CFLAGS -AC_DEFUN([AC_CHECK_CFLAGS], +# checks whether the $(CXX) (c++) compiler accepts the ADDITIONAL-CXXFLAGS +# if so, they are added to the CXXFLAGS +AC_DEFUN([AC_CHECK_CXXFLAGS], [ - AC_MSG_CHECKING([whether $CC accepts "$1"]) -cat > conftest.c << EOF + AC_MSG_CHECKING([whether $CXX accepts "$1"]) +cat > conftest.c++ << EOF int main(){ return 0; } EOF -if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1 +if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1 then AC_MSG_RESULT([yes]) - CFLAGS="${CFLAGS} [$1]" + CXXFLAGS="${CXXFLAGS} [$1]" [$2] else AC_MSG_RESULT([no]) [$3] fi -])# AC_CHECK_CFLAGS +])# AC_CHECK_CXXFLAGS # AC_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # @@ -131,15 +149,11 @@ if test "$fat_binary" != no; then done if test "x$[]Name" != "x"; then - tmp_arch_cflags="$CFLAGS" AC_CHECK_CFLAGS($[]Name,,[]Name="") - CFLAGS="$tmp_arch_cflags" fi if test "x$[]Name" != "x"; then - tmp_arch_ldflags="$LDFLAGS" AC_CHECK_LDFLAGS($[]Name,,[]Name="") - LDFLAGS="$tmp_arch_ldflags" fi undefine([Name]) diff --git a/src/configure.ac b/src/configure.ac index b8aa813..f779ea2 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -13,6 +13,7 @@ AC_PROG_CC AC_SUBST(STK) AC_SUBST(CFLAGS) +AC_SUBST(CPPFLAGS) AC_SUBST(DEFS) AC_SUBST(LFLAGS) AC_SUBST(EXT) |