From 496287859b525d24bf38ef19a38ea2fd7d309bd1 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 3 May 2010 19:56:19 -0700 Subject: [PATCH] Move C_SWITCH_MACHINE, C_SWITCH_SYSTEM from cpp to autoconf. * 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 | 5 +++++ configure.in | 43 ++++++++++++++++++++++++++++++++----------- lib-src/ChangeLog | 5 +++++ lib-src/Makefile.in | 4 ++-- src/ChangeLog | 10 ++++++++++ src/Makefile.in | 9 +++++++-- src/m/alpha.h | 10 ---------- src/s/aix4-2.h | 11 ++--------- 8 files changed, 63 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e26dc4762..efcc5991fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 Glenn Morris + + * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output + variables, replacing c_switch_machine, c_switch_system. + 2010-05-03 Glenn Morris * configure.in (LIBXT_OTHER, LIBX_OTHER): New output variables. diff --git a/configure.in b/configure.in index 34358a2cea..184dbef6ff 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 53db176748..9178af0f36 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 Glenn Morris + + * Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than + @c_switch_system@, @c_switch_machine@. + 2010-04-26 Dan Nicolaescu * Makefile.in (LIBS_MACHINE): Remove all uses, unused. diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 4bbe894a79..634ac8bcb4 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -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@ diff --git a/src/ChangeLog b/src/ChangeLog index ab5780106b..33d550e782 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-05-04 Glenn Morris + + * 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 * s/hpux10-20.h (LIB_STANDARD): New definition. diff --git a/src/Makefile.in b/src/Makefile.in index a7ad10446e..220eac61c1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 diff --git a/src/m/alpha.h b/src/m/alpha.h index 80f9d6c02f..ec0ed92e24 100644 --- a/src/m/alpha.h +++ b/src/m/alpha.h @@ -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 diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index 2c7f8c0615..f6ed94828d 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -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 . */ /* 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. */ -- 2.20.1