]> git.eshelyaron.com Git - emacs.git/commitdiff
Move LIB_GCC from cpp to configure.
authorGlenn Morris <rgm@gnu.org>
Wed, 12 May 2010 03:01:16 +0000 (20:01 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 12 May 2010 03:01:16 +0000 (20:01 -0700)
* configure.in (LIB_GCC): New output variable.

* src/Makefile.in (LIB_GCC): Set using configure, not cpp.
(GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
* src/m/arm.h (LIB_GCC) [GNU_LINUX]:
* src/s/cygwin.h (LIB_GCC):
* src/s/freebsd.h (LIB_GCC):
* src/s/gnu-linux.h (LIB_GCC):
* src/s/msdos.h (LIB_GCC):
* src/s/netbsd.h (LIB_GCC):
Move to configure.

* msdos/sed1v2.inp (LIB_GCC): Edit to -Lgcc.

12 files changed:
ChangeLog
configure.in
msdos/ChangeLog
msdos/sed1v2.inp
src/ChangeLog
src/Makefile.in
src/m/arm.h
src/s/cygwin.h
src/s/freebsd.h
src/s/gnu-linux.h
src/s/msdos.h
src/s/netbsd.h

index 6bc657783c85da13aae2b434cab630be09b3df79..831fc2263f82ce661f8df38fc2d3747074c8b4b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-12  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (LIB_GCC): New output variable.
+
 2010-05-11  Glenn Morris  <rgm@gnu.org>
 
        * make-dist (msdos): No more mainmake.
index d634262a0fcea2d1937a79552d9b53f2cc30b0d7..3a0067ececea5b7d80bc42ae7864bf3bbd9371dd 100644 (file)
@@ -3234,6 +3234,35 @@ fi
 AC_SUBST(LD_SWITCH_SYSTEM_EXTRA)
 
 
+LIB_GCC=
+if test "x$GCC" = "xyes"; then
+
+  case "$opsys" in
+    ## cygwin: don't link against static libgcc.
+    cygwin|freebsd|netbsd|openbsd) LIB_GCC= ;;
+
+    gnu-*)
+      ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
+      ## build on ARM EABI under GNU/Linux.  (Bug#5518)
+      ## Note that m/arm.h never bothered to undefine LIB_GCC first.
+      if test "$machine" = "arm"; then
+        LIB_GCC="-lgcc_s"
+      else
+        ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
+        ## immediately undefine it again and redefine it to empty.
+        ## Was the C_SWITCH_X_SITE part really necessary?
+##      LIB_GCC=`$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
+        LIB_GCC=
+      fi
+      ;;
+
+    ## Ask GCC where to find libgcc.a.
+    *) LIB_GCC=`$(CC) -print-libgcc-file-name 2> /dev/null` ;;
+  esac
+fi                              dnl if $GCC
+AC_SUBST(LIB_GCC)
+
+
 AH_TOP([/* GNU Emacs site configuration template file.
    Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005,
      2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
index bed874729071eb44eeb2dc6fc1cdc22f1c13014b..8ce1b625fc626238c154b56e896a3c06a94a1be0 100644 (file)
@@ -1,3 +1,7 @@
+2010-05-12  Glenn Morris  <rgm@gnu.org>
+
+       * sed1v2.inp (LIB_GCC): Edit to -Lgcc.
+
 2010-05-11  Glenn Morris  <rgm@gnu.org>
 
        * sed1x.inp (LIBS_SYSTEM): Edit to -lxext -lsys.
index db6944ec135a56bd2e023c31fdfc71af39e757e3..f0e057c6b28a68e84f84245026bea3a2c1e725f3 100644 (file)
@@ -51,6 +51,7 @@ s/@LIB_MATH@/-lm/
 /^LD_SWITCH_SYSTEM *=/s/@LD_SWITCH_SYSTEM@//
 /^LD_SWITCH_SYSTEM_EXTRA *=/s/@LD_SWITCH_SYSTEM_EXTRA@//
 /^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@//
+/^LIB_GCC *=/s/@LIB_GCC@/-Lgcc/
 /^LIBTIFF *=/s/@LIBTIFF@//
 /^LIBJPEG *=/s/@LIBJPEG@//
 /^LIBPNG *=/s/@LIBPNG@//
index 35b5153649a5bf90906a946582c10dfbf9058510..7bf067e24275fb8e232b4c104e655dfcfe4c6fcb 100644 (file)
@@ -1,3 +1,15 @@
+2010-05-12  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (LIB_GCC): Set using configure, not cpp.
+       (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
+       * m/arm.h (LIB_GCC) [GNU_LINUX]:
+       * s/cygwin.h (LIB_GCC):
+       * s/freebsd.h (LIB_GCC):
+       * s/gnu-linux.h (LIB_GCC):
+       * s/msdos.h (LIB_GCC):
+       * s/netbsd.h (LIB_GCC):
+       Move to configure.
+
 2010-05-11  Karel Klic  <kklic@redhat.com>
 
        * ftfont.c: Fix incorrect parentheses of #if condition for
index 292429fc7b426ce857083a49c2a8b31e123c5e6e..9476254e48d0e9b8f1d38076958f8d99093aaf41 100644 (file)
@@ -91,6 +91,9 @@ TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTE
 ## Some systems define this to request special libraries.
 LIBS_SYSTEM=@LIBS_SYSTEM@
 
+## Where to find libgcc.a, if using gcc and necessary.
+LIB_GCC=@LIB_GCC@
+
 LIBTIFF=@LIBTIFF@
 LIBJPEG=@LIBJPEG@
 LIBPNG=@LIBPNG@
@@ -258,6 +261,8 @@ LIBX_OTHER=@LIBX_OTHER@
 #endif /* not HAVE_X_WINDOWS */
 
 #ifndef ORDINARY_LINK
+GNULIB_VAR = $(LIB_GCC)
+
 /* Fix linking if compiled with GCC.  */
 #ifdef __GNUC__
 
@@ -278,13 +283,6 @@ LIBX_OTHER=@LIBX_OTHER@
 #define LINKER $(CC) -nostdlib
 #endif
 
-#ifndef LIB_GCC
-/* Ask GCC where to find libgcc.a.  */
-#define LIB_GCC `$(CC) -print-libgcc-file-name`
-#endif /* not LIB_GCC */
-
-GNULIB_VAR = LIB_GCC
-
 #ifndef LINKER_WAS_SPECIFIED
 /* GCC passes any argument prefixed with -Xlinker directly to the
    linker.  See prefix-args.c for an explanation of why we do not do
@@ -296,10 +294,6 @@ GNULIB_VAR = LIB_GCC
 #define YMF_PASS_LDFLAGS(flags) flags
 #endif
 
-#else /* not __GNUC__ */
-GNULIB_VAR =
-
-#endif /* not __GNUC__ */
 #endif /* not ORDINARY_LINK */
 
 #ifdef ORDINARY_LINK
index c3a5d6e4ad526024d721816498c078344b919f68..cf30e2e1b195eebd2f02b91df9a1ca694ef5839d 100644 (file)
@@ -24,11 +24,5 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define NO_REMAP
 
-/* armin76@gentoo.org reported that the lgcc_s flag is necessary to
-   build on ARM EABI under GNU/Linux (Bug#5518).  */
-#ifdef GNU_LINUX
-#define LIB_GCC -lgcc_s
-#endif
-
 /* arch-tag: 07856f0c-f0c8-4bd8-99af-0b7fa1e5ee42
    (do not change this comment) */
index 296b1970a971cd975053fbb6509ac0158378770d..4a5add787f4ad96b5907103b5e22466514957f7b 100644 (file)
@@ -127,9 +127,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    returns ENOSYS.  A workaround is to set G_SLICE=always-malloc. */
 #define G_SLICE_ALWAYS_MALLOC
 
-/* Don't link against static libgcc */
-#define LIB_GCC
-
 /* the end */
 
 /* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b
index 78c7dfdf6bbd46dd1ce68b97f62cd18b305871ca..2bce3ad63be1f71166124a42e78641ca219cc954 100644 (file)
@@ -30,9 +30,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
-#undef LIB_GCC
-#define LIB_GCC
-
 #define HAVE_GETLOADAVG 1
 #define DECLARE_GETPWUID_WITH_UID_T
 
index 5c94a4369ce9262d8128b346d7ec75f874a64407..a42bbaadf62bae4cf9607e05778fabcc55676f23 100644 (file)
@@ -140,9 +140,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif /* !_IO_STDIO_H && ! __UCLIBC__ */
 #endif /* emacs */
 
-/* Ask GCC where to find libgcc.a.  */
-#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
-
 #ifdef emacs
 #define INTERRUPT_INPUT
 #endif
@@ -151,9 +148,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define POSIX                 /* affects getpagesize.h and systty.h */
 
-#undef LIB_GCC
-#define LIB_GCC
-
 #define UNEXEC unexelf.o
 
 /* This is to work around mysterious gcc failures in some system versions.
index 4d7ca08d3c0da9cd33dc9d75262545a00051745e..efed104e958b60642b8ec6eaafdc208eabcca890 100644 (file)
@@ -95,7 +95,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
 #define ORDINARY_LINK
 
 /* command.com does not understand `...` so we define this.  */
-#define LIB_GCC -Lgcc
 #define SEPCHAR ';'
 
 #define NULL_DEVICE "nul"
index fa6d1141c8cc3adef9ad974fee7630bb024497a1..2511dc1c1e72c8e9a707e6b7f6c50bcac3a70244 100644 (file)
@@ -26,9 +26,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
-#undef LIB_GCC
-#define LIB_GCC
-
 #define AMPERSAND_FULL_NAME
 
 /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears