]> git.eshelyaron.com Git - emacs.git/commitdiff
Close bug#5655.
authorGlenn Morris <rgm@gnu.org>
Sat, 24 Apr 2010 02:23:22 +0000 (19:23 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 24 Apr 2010 02:23:22 +0000 (19:23 -0700)
* configure.in (CRT_DIR): New output variable.
(--with-crt-dir): New option.  (Bug#5655)
(HAVE_LIB64_DIR): Remove.

* src/Makefile.in (CRT_DIR): New variable, set by configure.
* src/m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD):
Use $CRT_DIR rather than HAVE_LIB64_DIR.  (Bug#5655)

ChangeLog
configure.in
src/ChangeLog
src/Makefile.in
src/m/ibms390x.h

index 8c81a7389df03b29e1ac72fdb93cfe712731de1a..3ebb55e6a031eeb4bc941589d3308c15a163e477 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-24  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (CRT_DIR): New output variable.
+       (--with-crt-dir): New option.  (Bug#5655)
+       (HAVE_LIB64_DIR): Remove.
+
 2010-04-22  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * configure.in (REAL_CFLAGS, CFLAGS): Restore -g for gcc.
index 8e624abbe97e82a4caffa3390a5d7fe3a5195114..0357fa8e886ff54322b462f27ea6e330254b0155 100644 (file)
@@ -186,6 +186,12 @@ if test "X${with_pkg_config_prog}" != X; then
    fi
 fi
 
+CRT_DIR=
+AC_ARG_WITH([crt-dir],dnl
+[AS_HELP_STRING([--with-crt-dir=DIR],[directory containing crtn.o etc.
+This option is only used on x86-64 and s390x GNU/Linux architectures.])])
+CRT_DIR="${with_crt_dir}"
+
 AC_ARG_WITH([gnustep-conf],dnl
 [AS_HELP_STRING([--with-gnustep-conf=PATH],[path to GNUstep.conf; default $GNUSTEP_CONFIG_FILE, or /etc/GNUstep/GNUstep.conf])])
 test "X${with_gnustep_conf}" != X && test "${with_gnustep_conf}" != yes && \
@@ -966,17 +972,31 @@ dnl Do this early because it can frob feature test macros for Unix-98 &c.
 AC_SYS_LARGEFILE
 
 
-### The standard library on x86-64 and s390x GNU/Linux distributions can
-### be located in either /usr/lib64 or /usr/lib.
-### In some rare cases, /usr/lib64 exists but does not contain the
-### relevant files (bug#1287).  Hence test for crtn.o.
+## Note: at present CRT_DIR is only used for amdx86-64 and ibms390x.
+## Other machine types hard-code the location in src/[ms]/*.h.
 case "${canonical}" in
   x86_64-*-linux-gnu* | s390x-*-linux-gnu* )
-    if test -e /usr/lib64/crtn.o; then
-      AC_DEFINE(HAVE_LIB64_DIR, 1,
-        [Define to 1 if the directory /usr/lib64 exists.])
-fi
+
+   ## On x86-64 and s390x GNU/Linux distributions, the standard library
+   ## can be in a variety of places.  We only try /usr/lib64 and /usr/lib.
+   ## For anything else (eg /usr/lib32), it is up the user to specify
+   ## the location (bug#5655).
+   ## Test for crtn.o, not just the directory, because sometimes the
+   ## directory exists but does not have the relevant files (bug#1287).
+   ## If user specified a crt-dir, use that unconditionally.
+   if test "X$CRT_DIR" = "X"; then
+     CRT_DIR=/usr/lib
+     test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64
+   fi
+
+   test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
+     AC_MSG_ERROR([crt*.o not found.  Use --with-crt-dir to specify the location.])
+   ;;
+
 esac
+test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
+AC_SUBST(CRT_DIR)
+
 
 dnl This function defintion taken from Gnome 2.0
 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
index 9913605316d7d2ed2b16219ceeada170d9ad306e..e1b07d50a3b403dbcbf3d3b870d167a0cb09ce7b 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-24  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (CRT_DIR): New variable, set by configure.
+       * m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD):
+       Use $CRT_DIR rather than HAVE_LIB64_DIR.  (Bug#5655)
+
 2010-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * Makefile.in: Remove C_SWITCH_X_MACHINE, unused.
index 35f7c0491656a1cb617d1e3e9a857b9ada083a37..c458c46b619288701fac61bdfd562555a56f46bf 100644 (file)
@@ -68,6 +68,9 @@ bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT}
 
 OTHER_FILES = @OTHER_FILES@
 
+## Only used by amdx86-64 and ibms390x GNU/Linux.
+CRT_DIR=@CRT_DIR@
+
 LIBTIFF=@LIBTIFF@
 LIBJPEG=@LIBJPEG@
 LIBPNG=@LIBPNG@
index 9429e4282bfb6a5d9a5017810fc8f8f3632fd3c9..ea0fa11ec3f7d9987faf6e21bf98b8b5dd84563e 100644 (file)
@@ -91,18 +91,10 @@ NOTE-END */
 #define XPNTR(a) XUINT (a)
 
 #undef START_FILES
-#ifdef HAVE_LIB64_DIR
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-#else
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
-#endif
+#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
 
 #undef LIB_STANDARD
-#ifdef HAVE_LIB64_DIR
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
-#else
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
-#endif
+#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
 
 /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
    (do not change this comment) */