Commit e6cfa7c3 authored by Andreas Schwab's avatar Andreas Schwab

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.
parent f09e4c6b
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* 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}.
2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
* configure.in: Don't check for index and rindex, check for strchr
......
......@@ -724,6 +724,7 @@ RANLIB
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
C_WARNINGS_SWITCH
EGREP
GREP
CPP
......@@ -742,6 +743,8 @@ build_os
build_vendor
build_cpu
build
PROFILING_LDFLAGS
PROFILING_CFLAGS
MAINT
GZIP_INFO
target_alias
......@@ -3013,6 +3016,8 @@ else
PROFILING_LDFLAGS=
fi
# Check whether --enable-autodepend was given.
if test "${enable_autodepend+set}" = set; then :
enableval=$enable_autodepend; ac_enable_autodepend="${enableval}"
......@@ -4313,14 +4318,6 @@ then
CC="$NON_GNU_CC"
fi
if test x$GCC = xyes; then
C_OPTIMIZE_SWITCH=-O2
test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
else
C_OPTIMIZE_SWITCH=-O
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
......@@ -4875,6 +4872,7 @@ unset has_option
unset SAVE_CFLAGS
#### Some other nice autoconf tests.
ac_ext=c
......@@ -5485,34 +5483,12 @@ fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
# The value of CPP is a quoted variable reference, so we need to do this
# to get its actual value...
CPP=`eval "echo $CPP"`
### First figure out CFLAGS (which we use for running the compiler here)
### and REAL_CFLAGS (which we use for real compilation).
### The two are the same except when using GCC where we might use
### extra warning and profiling flags.
### If the CFLAGS env var is specified, we use that value
### instead of the default.
if test "x$SPECIFIED_CFLAGS" = x; then
CFLAGS="-g $C_OPTIMIZE_SWITCH"
if test x$GCC = xyes; then
REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS"
else
REAL_CFLAGS="$CFLAGS"
fi
else
REAL_CFLAGS="$CFLAGS"
fi
CANNOT_DUMP=no
case "$opsys" in
your-opsys-here)
......@@ -7417,7 +7393,7 @@ tmp_CPPFLAGS="$CPPFLAGS"
tmp_CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS -x objective-c"
CFLAGS="$CFLAGS -x objective-c"
TEMACS_LDFLAGS2="\${LDFLAGS}"
TEMACS_LDFLAGS2="\${LDFLAGS} \${PROFILING_LDFLAGS}"
if test "${with_ns}" != no; then
if test "${opsys}" = darwin; then
NS_IMPL_COCOA=yes
......@@ -7441,7 +7417,6 @@ if test "${with_ns}" != no; then
GNUSTEP_LOCAL_LIBRARIES="-L${GNUSTEP_LOCAL_LIBRARIES}"
CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
LIB_STANDARD=
START_FILES=
......@@ -8075,6 +8050,7 @@ esac
# used for the tests that follow. We set them back to REAL_CFLAGS and
# REAL_CPPFLAGS later on.
REAL_CFLAGS="$CFLAGS"
REAL_CPPFLAGS="$CPPFLAGS"
if test "${HAVE_X11}" = "yes"; then
......
......@@ -327,6 +327,8 @@ else
PROFILING_CFLAGS=
PROFILING_LDFLAGS=
fi
AC_SUBST(PROFILING_CFLAGS)
AC_SUBST(PROFILING_LDFLAGS)
AC_ARG_ENABLE(autodepend,
[AS_HELP_STRING([--enable-autodepend],
......@@ -720,14 +722,6 @@ then
CC="$NON_GNU_CC"
fi
if test x$GCC = xyes; then
C_OPTIMIZE_SWITCH=-O2
test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
else
C_OPTIMIZE_SWITCH=-O
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
dnl checks for Unix variants
AC_USE_SYSTEM_EXTENSIONS
......@@ -770,6 +764,7 @@ AC_MSG_RESULT($has_option)
CFLAGS="$SAVE_CFLAGS"
unset has_option
unset SAVE_CFLAGS
AC_SUBST(C_WARNINGS_SWITCH)
#### Some other nice autoconf tests.
......@@ -861,35 +856,12 @@ AC_LINK_IFELSE([main(){return 0;}],
LDFLAGS=$late_LDFLAGS
[AC_MSG_RESULT(no)])
LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
# The value of CPP is a quoted variable reference, so we need to do this
# to get its actual value...
CPP=`eval "echo $CPP"`
### First figure out CFLAGS (which we use for running the compiler here)
### and REAL_CFLAGS (which we use for real compilation).
### The two are the same except when using GCC where we might use
### extra warning and profiling flags.
### If the CFLAGS env var is specified, we use that value
### instead of the default.
dnl Note AC_PROG_CC sets CFLAGS to -g -O2 for gcc anyway.
if test "x$SPECIFIED_CFLAGS" = x; then
CFLAGS="-g $C_OPTIMIZE_SWITCH"
if test x$GCC = xyes; then
REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS"
else
REAL_CFLAGS="$CFLAGS"
fi
else
REAL_CFLAGS="$CFLAGS"
fi
dnl Not used by any currently supported platform.
dnl The function dump-emacs will not be defined and temacs will do
dnl (load "loadup") automatically unless told otherwise.
......@@ -1497,7 +1469,7 @@ tmp_CPPFLAGS="$CPPFLAGS"
tmp_CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS -x objective-c"
CFLAGS="$CFLAGS -x objective-c"
TEMACS_LDFLAGS2="\${LDFLAGS}"
TEMACS_LDFLAGS2="\${LDFLAGS} \${PROFILING_LDFLAGS}"
dnl I don't think it's especially important, but src/Makefile.in
dnl (now the only user of ns_appdir) used to go to the trouble of adding a
dnl trailing "/" to it, so now we do it here.
......@@ -1526,7 +1498,6 @@ if test "${with_ns}" != no; then
GNUSTEP_LOCAL_LIBRARIES="-L${GNUSTEP_LOCAL_LIBRARIES}"
CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
LIB_STANDARD=
START_FILES=
......@@ -1732,6 +1703,7 @@ esac
# used for the tests that follow. We set them back to REAL_CFLAGS and
# REAL_CPPFLAGS later on.
REAL_CFLAGS="$CFLAGS"
REAL_CPPFLAGS="$CPPFLAGS"
if test "${HAVE_X11}" = "yes"; then
......
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* 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}.
2010-07-12 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (lisp2): Change hebrew.el to hebrew.elc (see
......
......@@ -36,6 +36,9 @@ configuration=@configuration@
EXEEXT=@EXEEXT@
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
PROFILING_CFLAGS = @PROFILING_CFLAGS@
PROFILING_LDFLAGS = @PROFILING_LDFLAGS@
# Program name transformation.
TRANSFORM = @program_transform_name@
......@@ -165,12 +168,12 @@ LIBS_SYSTEM = @LIBS_SYSTEM@
# Those files shared with other GNU utilities need HAVE_CONFIG_H
# defined before they know they can take advantage of the information
# in ../src/config.h.
BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \
-I. -I../src -I${srcdir} -I${srcdir}/../src
BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) ${C_WARNINGS_SWITCH} \
-DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src
ALL_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
CPP_CFLAGS = ${BASE_CFLAGS} ${CPPFLAGS} ${CFLAGS}
ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
LINK_CFLAGS = ${BASE_CFLAGS} ${PROFILING_LDFLAGS} ${LDFLAGS} ${CFLAGS}
CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
LOADLIBES=$(LIBS_SYSTEM)
......
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS): Set from
substitution.
(ALL_CFLAGS): Add ${C_WARNINGS_SWITCH} and ${PROFILING_CFLAGS}.
2010-07-08 Jan Djärv <jan.h.d@swipnet.se>
* xlwmenu.c (size_menu_item): Change from K&R to prototype.
......
......@@ -29,6 +29,8 @@ C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
PROFILING_CFLAGS = @PROFILING_CFLAGS@
CC=@CC@
CFLAGS=@CFLAGS@
......@@ -50,7 +52,8 @@ OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
# ../src is needed to find config.h.
ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
$(C_SWITCH_X_SYSTEM) $(C_SWITCH_MACHINE) $(CFLAGS) \
$(C_SWITCH_X_SYSTEM) $(C_SWITCH_MACHINE) \
${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} $(CFLAGS) \
-DHAVE_CONFIG_H -Demacs -I. -I../src -I${srcdir} -I${srcdir}/../src
.c.o:
......
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS): Set from
substitution.
(ALL_CFLAGS): Add ${C_WARNINGS_SWITCH} and ${PROFILING_CFLAGS}.
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* Activate.c: Convert function definitions to standard C.
......
......@@ -49,6 +49,8 @@ C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
PROFILING_CFLAGS = @PROFILING_CFLAGS@
EXTRA=insque.o
CC=@CC@
......@@ -88,6 +90,7 @@ all:: libXMenu11.a
ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
$(C_SWITCH_X_SITE) $(C_SWITCH_X_SYSTEM) \
${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} \
$(CPPFLAGS) $(CFLAGS) -DEMACS_BITMAP_FILES \
-I../src -I${srcdir} -I${srcdir}/../src
......
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
(PROFILING_LDFLAGS): Set from substitution.
(ALL_CFLAGS): Add C_WARNINGS_SWITCH and PROFILING_CFLAGS, put
CFLAGS last.
2010-07-12 Kenichi Handa <handa@m17n.org>
* Makefile.in (lisp): Change hebrew.el to hebrew.elc.
......
......@@ -63,6 +63,13 @@ OTHER_FILES = @OTHER_FILES@
CRT_DIR=@CRT_DIR@
## Flags to pass for profiling builds
PROFILING_CFLAGS = @PROFILING_CFLAGS@
PROFILING_LDFLAGS = @PROFILING_LDFLAGS@
## Flags to pass to the compiler to enable build warnings
C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
## Machine-specific CFLAGS.
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
## System-specific CFLAGS.
......@@ -107,7 +114,7 @@ LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
## Flags to pass to ld only for temacs.
TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
## $LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason).
## $LDFLAGS $PROFILING_LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason).
TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
## Some systems define this to request special libraries.
......@@ -309,8 +316,9 @@ MKDEPDIR=@MKDEPDIR@
ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} \
${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} \
${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} \
${GCONF_CFLAGS} ${CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS}
${GCONF_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS} ${PROFILING_CFLAGS} \
${C_WARNINGS_SWITCH} ${CFLAGS}
ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
.SUFFIXES: .m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment