Move C_SWITCH_MACHINE, C_SWITCH_SYSTEM from cpp to autoconf.
authorGlenn Morris <rgm@gnu.org>
Tue, 4 May 2010 02:56:19 +0000 (19:56 -0700)
committerGlenn Morris <rgm@gnu.org>
Tue, 4 May 2010 02:56:19 +0000 (19:56 -0700)
* configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output
variables, replacing c_switch_machine, c_switch_system.

* src/s/aix4-2.h (C_SWITCH_SYSTEM):
* src/m/alpha.h (C_SWITCH_MACHINE):
Move to configure.in.
* src/Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM):
New variables, set by configure.
(ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of
$c_switch_machine and $c_switch_system.

* lib-src/Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@
rather than @c_switch_system@, @c_switch_machine@.

ChangeLog
configure.in
lib-src/ChangeLog
lib-src/Makefile.in
src/ChangeLog
src/Makefile.in
src/m/alpha.h
src/s/aix4-2.h

index 3e26dc4..efcc599 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output
+       variables, replacing c_switch_machine, c_switch_system.
+
 2010-05-03  Glenn Morris  <rgm@gnu.org>
 
        * configure.in (LIBXT_OTHER, LIBX_OTHER): New output variables.
index 34358a2..184dbef 100644 (file)
@@ -883,15 +883,7 @@ echo '
 #ifndef LIBS_SYSTEM
 #define LIBS_SYSTEM
 #endif
-#ifndef C_SWITCH_SYSTEM
-#define C_SWITCH_SYSTEM
-#endif
-#ifndef C_SWITCH_MACHINE
-#define C_SWITCH_MACHINE
-#endif
 configure___ libsrc_libs=LIBS_SYSTEM
-configure___ c_switch_system=C_SWITCH_SYSTEM
-configure___ c_switch_machine=C_SWITCH_MACHINE
 
 configure___ LIBX=-lX11
 
@@ -969,12 +961,43 @@ rm ${tempcname}
 
 ac_link="$ac_link $ld_switch_system"
 
+
+C_SWITCH_MACHINE=
+if test "$machine" = "alpha"; then
+  AC_CHECK_DECL([__ELF__])
+  if test "$ac_cv_have_decl___ELF__" = "yes"; then
+    ## With ELF, make sure that all common symbols get allocated to in the
+    ## data section.  Otherwise, the dump of temacs may miss variables in
+    ## the shared library that have been initialized.  For example, with
+    ## GNU libc, __malloc_initialized would normally be resolved to the
+    ## shared library's .bss section, which is fatal.
+    if test "x$GCC" = "xyes"; then
+      C_SWITCH_MACHINE="-fno-common"
+    else
+      AC_MSG_ERROR([What gives?  Fix me if DEC Unix supports ELF now.])
+    fi
+  fi
+fi
+AC_SUBST(C_SWITCH_MACHINE)
+
+
+C_SWITCH_SYSTEM=
+## Some programs in src produce warnings saying certain subprograms
+## are too complex and need a MAXMEM value greater than 2000 for
+## additional optimization.  --nils@exp-math.uni-essen.de
+test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
+  C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
+## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
+## It is redundant in glibc2, since we define _GNU_SOURCE.
+AC_SUBST(C_SWITCH_SYSTEM)
+
+
 ### Make sure subsequent tests use flags consistent with the build flags.
 
 if test x"${OVERRIDE_CPPFLAGS}" != x; then
   CPPFLAGS="${OVERRIDE_CPPFLAGS}"
 else
-  CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
+  CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS"
 fi
 
 dnl For AC_FUNC_GETLOADAVG, at least:
@@ -2804,8 +2827,6 @@ AC_SUBST(docdir)
 AC_SUBST(bitmapdir)
 AC_SUBST(gamedir)
 AC_SUBST(gameuser)
-AC_SUBST(c_switch_system)
-AC_SUBST(c_switch_machine)
 AC_SUBST(unexec)
 AC_SUBST(LD_SWITCH_X_SITE)
 AC_SUBST(LD_SWITCH_X_SITE_AUX)
index 53db176..9178af0 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than
+       @c_switch_system@, @c_switch_machine@.
+
 2010-04-26  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * Makefile.in (LIBS_MACHINE): Remove all uses, unused.
index 4bbe894..634ac8b 100644 (file)
@@ -34,8 +34,8 @@ CFLAGS=@CFLAGS@
 version=@version@
 configuration=@configuration@
 EXEEXT=@EXEEXT@
-C_SWITCH_SYSTEM=@c_switch_system@
-C_SWITCH_MACHINE=@c_switch_machine@
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
 
 # Program name transformation.
 TRANSFORM = @program_transform_name@
index ab57801..33d550e 100644 (file)
@@ -1,3 +1,13 @@
+2010-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * s/aix4-2.h (C_SWITCH_SYSTEM):
+       * m/alpha.h (C_SWITCH_MACHINE):
+       Move to configure.in.
+       * Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM):
+       New variables, set by configure.
+       (ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of
+       $c_switch_machine and $c_switch_system.
+
 2010-05-04  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * s/hpux10-20.h (LIB_STANDARD): New definition.
index a7ad104..220eac6 100644 (file)
@@ -70,6 +70,11 @@ OTHER_FILES = @OTHER_FILES@
 
 CRT_DIR=@CRT_DIR@
 
+## Machine-specific CFLAGS.
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
+## System-specific CFLAGS.
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+
 LIBTIFF=@LIBTIFF@
 LIBJPEG=@LIBJPEG@
 LIBPNG=@LIBPNG@
@@ -232,7 +237,7 @@ shared=no
 
 /* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM
    since it may have -I options that should override those two.  */
-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}
+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}
 ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
 
 .SUFFIXES: .m
@@ -968,7 +973,7 @@ window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
    keymap.h blockinput.h atimer.h systime.h $(INTERVALS_H) \
    xterm.h w32term.h nsterm.h nsgui.h lisp.h $(config_h)
 xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
-   coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h     \
+   coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
    charset.h lisp.h $(config_h) keyboard.h $(INTERVALS_H) region-cache.h \
    xterm.h w32term.h nsterm.h nsgui.h msdos.h composite.h fontset.h ccl.h \
    blockinput.h atimer.h systime.h keymap.h font.h
index 80f9d6c..ec0ed92 100644 (file)
@@ -77,16 +77,6 @@ NOTE-END
 /* #define SYSTEM_MALLOC */
 
 #ifdef __ELF__
-/* With ELF, make sure that all common symbols get allocated to in the
-   data section.  Otherwise, the dump of temacs may miss variables in
-   the shared library that have been initialized.  For example, with
-   GNU libc, __malloc_initialized would normally be resolved to the
-   shared library's .bss section, which is fatal.  */
-# ifdef __GNUC__
-#  define C_SWITCH_MACHINE     -fno-common
-# else
-#  error What gives?  Fix me if DEC Unix supports ELF now.
-# endif
 
 #undef UNEXEC
 #define UNEXEC unexelf.o
index 2c7f8c0..f6ed948 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-  Free Software Foundation, Inc.
+Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+  2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -118,13 +118,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* AIX doesn't define this.  */
 #define unix 1
 
-#ifndef __GNUC__
-/* Some programs in src produce warnings saying certain subprograms
-   are to comples and need a MAXMEM value greater than 2000 for
-   additional optimization.  --nils@exp-math.uni-essen.de */
-#define C_SWITCH_SYSTEM -ma -qmaxmem=4000
-#endif
-
 /* string.h defines rindex as a macro, at least with native cc, so we
    lose declaring char * rindex without this.
    It is just a guess which versions of AIX need this definition.  */