comparison configure.in @ 109359:b7e047772c64

Properly handle C_WARNINGS_SWITCH, PROFILING_CFLAGS, PROFILING_LDFLAGS * configure.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) (PROFILING_LDFLAGS): Substitute, don't add them to CFLAGS/LDFLAGS. (C_OPTIMIZE_SWITCH): Remove. (TEMACS_LDFLAGS2): Add ${PROFILING_LDFLAGS}. * lib-src/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) (PROFILING_LDFLAGS): Set from substitution. (BASE_CFLAGS): Add ${C_WARNINGS_SWITCH}. (ALL_CFLAGS, CPP_CFLAGS): Add ${PROFILING_CFLAGS}. (LINK_CFLAGS): Add ${PROFILING_LDFLAGS}. * lwlib/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS): Set from substitution. (ALL_CFLAGS): Add ${C_WARNINGS_SWITCH} and ${PROFILING_CFLAGS}. * oldXMenu/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS): Set from substitution. (ALL_CFLAGS): Add ${C_WARNINGS_SWITCH} and ${PROFILING_CFLAGS}. * src/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) (PROFILING_LDFLAGS): Set from substitution. (ALL_CFLAGS): Add C_WARNINGS_SWITCH and PROFILING_CFLAGS, put CFLAGS last.
author Andreas Schwab <schwab@linux-m68k.org>
date Mon, 12 Jul 2010 16:16:38 +0200
parents 8f3464b85afb
children 9bc9a6ac1dd8
comparison
equal deleted inserted replaced
109357:3cfd17e4be81 109359:b7e047772c64
325 PROFILING_LDFLAGS="-pg" 325 PROFILING_LDFLAGS="-pg"
326 else 326 else
327 PROFILING_CFLAGS= 327 PROFILING_CFLAGS=
328 PROFILING_LDFLAGS= 328 PROFILING_LDFLAGS=
329 fi 329 fi
330 AC_SUBST(PROFILING_CFLAGS)
331 AC_SUBST(PROFILING_LDFLAGS)
330 332
331 AC_ARG_ENABLE(autodepend, 333 AC_ARG_ENABLE(autodepend,
332 [AS_HELP_STRING([--enable-autodepend], 334 [AS_HELP_STRING([--enable-autodepend],
333 [automatically generate dependencies to .h-files. 335 [automatically generate dependencies to .h-files.
334 Requires GNU Make and Gcc. Enabled if GNU Make and Gcc is 336 Requires GNU Make and Gcc. Enabled if GNU Make and Gcc is
718 test x$cc_specified != xyes 720 test x$cc_specified != xyes
719 then 721 then
720 CC="$NON_GNU_CC" 722 CC="$NON_GNU_CC"
721 fi 723 fi
722 724
723 if test x$GCC = xyes; then
724 C_OPTIMIZE_SWITCH=-O2
725 test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
726 else
727 C_OPTIMIZE_SWITCH=-O
728 test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
729 fi
730
731 dnl checks for Unix variants 725 dnl checks for Unix variants
732 AC_USE_SYSTEM_EXTENSIONS 726 AC_USE_SYSTEM_EXTENSIONS
733 727
734 ### Use -Wno-pointer-sign if the compiler supports it 728 ### Use -Wno-pointer-sign if the compiler supports it
735 AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign]) 729 AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign])
768 fi 762 fi
769 AC_MSG_RESULT($has_option) 763 AC_MSG_RESULT($has_option)
770 CFLAGS="$SAVE_CFLAGS" 764 CFLAGS="$SAVE_CFLAGS"
771 unset has_option 765 unset has_option
772 unset SAVE_CFLAGS 766 unset SAVE_CFLAGS
767 AC_SUBST(C_WARNINGS_SWITCH)
773 768
774 769
775 #### Some other nice autoconf tests. 770 #### Some other nice autoconf tests.
776 771
777 dnl checks for programs 772 dnl checks for programs
859 AC_LINK_IFELSE([main(){return 0;}], 854 AC_LINK_IFELSE([main(){return 0;}],
860 [AC_MSG_RESULT(yes)], 855 [AC_MSG_RESULT(yes)],
861 LDFLAGS=$late_LDFLAGS 856 LDFLAGS=$late_LDFLAGS
862 [AC_MSG_RESULT(no)]) 857 [AC_MSG_RESULT(no)])
863 858
864 LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
865
866 859
867 # The value of CPP is a quoted variable reference, so we need to do this 860 # The value of CPP is a quoted variable reference, so we need to do this
868 # to get its actual value... 861 # to get its actual value...
869 CPP=`eval "echo $CPP"` 862 CPP=`eval "echo $CPP"`
870
871
872 ### First figure out CFLAGS (which we use for running the compiler here)
873 ### and REAL_CFLAGS (which we use for real compilation).
874 ### The two are the same except when using GCC where we might use
875 ### extra warning and profiling flags.
876
877 ### If the CFLAGS env var is specified, we use that value
878 ### instead of the default.
879
880 dnl Note AC_PROG_CC sets CFLAGS to -g -O2 for gcc anyway.
881 if test "x$SPECIFIED_CFLAGS" = x; then
882 CFLAGS="-g $C_OPTIMIZE_SWITCH"
883 if test x$GCC = xyes; then
884 REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS"
885 else
886 REAL_CFLAGS="$CFLAGS"
887 fi
888 else
889 REAL_CFLAGS="$CFLAGS"
890 fi
891 863
892 864
893 dnl Not used by any currently supported platform. 865 dnl Not used by any currently supported platform.
894 dnl The function dump-emacs will not be defined and temacs will do 866 dnl The function dump-emacs will not be defined and temacs will do
895 dnl (load "loadup") automatically unless told otherwise. 867 dnl (load "loadup") automatically unless told otherwise.
1495 NS_IMPL_GNUSTEP=no 1467 NS_IMPL_GNUSTEP=no
1496 tmp_CPPFLAGS="$CPPFLAGS" 1468 tmp_CPPFLAGS="$CPPFLAGS"
1497 tmp_CFLAGS="$CFLAGS" 1469 tmp_CFLAGS="$CFLAGS"
1498 CPPFLAGS="$CPPFLAGS -x objective-c" 1470 CPPFLAGS="$CPPFLAGS -x objective-c"
1499 CFLAGS="$CFLAGS -x objective-c" 1471 CFLAGS="$CFLAGS -x objective-c"
1500 TEMACS_LDFLAGS2="\${LDFLAGS}" 1472 TEMACS_LDFLAGS2="\${LDFLAGS} \${PROFILING_LDFLAGS}"
1501 dnl I don't think it's especially important, but src/Makefile.in 1473 dnl I don't think it's especially important, but src/Makefile.in
1502 dnl (now the only user of ns_appdir) used to go to the trouble of adding a 1474 dnl (now the only user of ns_appdir) used to go to the trouble of adding a
1503 dnl trailing "/" to it, so now we do it here. 1475 dnl trailing "/" to it, so now we do it here.
1504 if test "${with_ns}" != no; then 1476 if test "${with_ns}" != no; then
1505 if test "${opsys}" = darwin; then 1477 if test "${opsys}" = darwin; then
1524 GNUSTEP_LOCAL_HEADERS="-I${GNUSTEP_LOCAL_HEADERS}" 1496 GNUSTEP_LOCAL_HEADERS="-I${GNUSTEP_LOCAL_HEADERS}"
1525 test "x${GNUSTEP_LOCAL_LIBRARIES}" != "x" && \ 1497 test "x${GNUSTEP_LOCAL_LIBRARIES}" != "x" && \
1526 GNUSTEP_LOCAL_LIBRARIES="-L${GNUSTEP_LOCAL_LIBRARIES}" 1498 GNUSTEP_LOCAL_LIBRARIES="-L${GNUSTEP_LOCAL_LIBRARIES}"
1527 CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" 1499 CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
1528 CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" 1500 CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
1529 REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
1530 LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}" 1501 LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
1531 LIB_STANDARD= 1502 LIB_STANDARD=
1532 START_FILES= 1503 START_FILES=
1533 TEMACS_LDFLAGS2= 1504 TEMACS_LDFLAGS2=
1534 fi 1505 fi
1730 1701
1731 # Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets 1702 # Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets
1732 # used for the tests that follow. We set them back to REAL_CFLAGS and 1703 # used for the tests that follow. We set them back to REAL_CFLAGS and
1733 # REAL_CPPFLAGS later on. 1704 # REAL_CPPFLAGS later on.
1734 1705
1706 REAL_CFLAGS="$CFLAGS"
1735 REAL_CPPFLAGS="$CPPFLAGS" 1707 REAL_CPPFLAGS="$CPPFLAGS"
1736 1708
1737 if test "${HAVE_X11}" = "yes"; then 1709 if test "${HAVE_X11}" = "yes"; then
1738 DEFS="$C_SWITCH_X_SITE $DEFS" 1710 DEFS="$C_SWITCH_X_SITE $DEFS"
1739 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE" 1711 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"