]> git.eshelyaron.com Git - emacs.git/commitdiff
Use $CRT_DIR in more places.
authorGlenn Morris <rgm@gnu.org>
Tue, 27 Apr 2010 03:14:14 +0000 (20:14 -0700)
committerGlenn Morris <rgm@gnu.org>
Tue, 27 Apr 2010 03:14:14 +0000 (20:14 -0700)
* configure.in (--with-crt-dir): Doc fix (now valid for all platforms).
(CRT_DIR): On (powerpc64|sparc64)-*-linux-gnu*, default to /usr/lib64.
On hpux10-20, default to /lib.

* src/m/amdx86-64.h (START_FILES, LIB_STANDARD): Change the logic around,
since the defaults (set by the system file) are fine in most cases.
[GNU_LINUX, __OpenBSD__, __NetBSD__, __APPLE__]: Remove sections.
* src/m/ibms390x.h (START_FILES, LIB_STANDARD):
* src/m/macppc.h (START_FILES, LIB_STANDARD) [GNU_LINUX]:
* src/m/sparc.h (START_FILES, LIB_STANDARD) [__linux__]:
Remove definitions, since they are set correctly in s/gnu-linux.h.
* src/s/freebsd.h (START_FILES, LIB_STANDARD):
* src/s/gnu-linux.h (START_FILES, LIB_STANDARD):
* src/s/hpux10-20.h (START_FILES):
* src/s/netbsd.h (START_FILES, LIB_STANDARD, START_FILES_1, END_FILES_1):
Use $CRT_DIR in place of fixed /usr/lib, /lib directories.

* src/Makefile.in: Comment.

12 files changed:
ChangeLog
configure.in
src/ChangeLog
src/Makefile.in
src/m/amdx86-64.h
src/m/ibms390x.h
src/m/macppc.h
src/m/sparc.h
src/s/freebsd.h
src/s/gnu-linux.h
src/s/hpux10-20.h
src/s/netbsd.h

index efbc1891abf7794548a14170d0c5276249e308b1..61a5bf194162b61a2172d4e5114afbc64f0aa35a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-27  Glenn Morris  <rgm@gnu.org>
 
+       * configure.in (--with-crt-dir): Doc fix (now valid for all platforms).
+       (CRT_DIR): On (powerpc64|sparc64)-*-linux-gnu*, default to /usr/lib64.
+       On hpux10-20, default to /lib.
+
        * configure.in (LUCID_LIBW, LIBXP, WIDGET_OBJ): New output variables.
 
 2010-04-26  Dan Nicolaescu  <dann@ics.uci.edu>
index cc50ae4fb860035a878de6acf3c057d00732cddc..20f335a52cffa3284e2afc3c0039f7e295346ab6 100644 (file)
@@ -189,7 +189,7 @@ 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.])])
+The default is /usr/lib, or /usr/lib64 on some platforms.])])
 CRT_DIR="${with_crt_dir}"
 
 AC_ARG_WITH([gnustep-conf],dnl
@@ -983,29 +983,40 @@ dnl Do this early because it can frob feature test macros for Unix-98 &c.
 AC_SYS_LARGEFILE
 
 
-## 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* )
-
-   ## 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
+## If user specified a crt-dir, use that unconditionally.
+if test "X$CRT_DIR" = "X"; then
 
-   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.])
-   ;;
+  case "$canonical" in
+    x86_64-*-linux-gnu* | s390x-*-linux-gnu*)
+    ## 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).
+    ## FIXME better to test for binary compatibility somehow.
+    test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64
+    ;;
+
+    powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;;
+  esac
+
+  case "$opsys" in
+    hpux10-20) CRT_DIR=/lib ;;
+  esac
+
+  ## Default is /usr/lib.
+  test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
+
+else
+
+  ## Some platforms don't use any of these files, so it is not
+  ## appropriate to put this test outside the if block.
+  test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
+    AC_MSG_ERROR([crt*.o not found in specified location.])
+
+fi
 
-esac
-test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
 AC_SUBST(CRT_DIR)
 
 
index 1dbdf0fbae8f6011f703291c30e23c475b2bdda6..0675257abd33614fe42b6a3f5926ab73a3b28103 100644 (file)
@@ -1,5 +1,18 @@
 2010-04-27  Glenn Morris  <rgm@gnu.org>
 
+       * m/amdx86-64.h (START_FILES, LIB_STANDARD): Change the logic around,
+       since the defaults (set by the system file) are fine in most cases.
+       [GNU_LINUX, __OpenBSD__, __NetBSD__, __APPLE__]: Remove sections.
+       * m/ibms390x.h (START_FILES, LIB_STANDARD):
+       * m/macppc.h (START_FILES, LIB_STANDARD) [GNU_LINUX]:
+       * m/sparc.h (START_FILES, LIB_STANDARD) [__linux__]:
+       Remove definitions, since they are set correctly in s/gnu-linux.h.
+       * s/freebsd.h (START_FILES, LIB_STANDARD):
+       * s/gnu-linux.h (START_FILES, LIB_STANDARD):
+       * s/hpux10-20.h (START_FILES):
+       * s/netbsd.h (START_FILES, LIB_STANDARD, START_FILES_1, END_FILES_1):
+       Use $CRT_DIR in place of fixed /usr/lib, /lib directories.
+
        * Makefile.in (LIBXP, LUCID_LIBW, WIDGET_OBJ): Set via configure.
        (MOTIF_LIBW): Use $LIBXP.
        (otherobj): Use $WIDGET_OBJ.
index adf4400a1daa5dc3586dca585a1c200c70387b17..2f1029cf70cd0e69710648461dac01897838f02f 100644 (file)
@@ -68,7 +68,6 @@ 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@
index 6d27c950ce4e30338bb6216976becd2077957a4b..f7dfb126e6e05682c071c5c7a8185568bd27a704 100644 (file)
@@ -67,34 +67,18 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
 #undef DATA_SEG_BITS
 
-#ifdef __OpenBSD__
 
+/* For GNU_LINUX,  __OpenBSD__, __NetBSD__, __APPLE__, things are set
+   correctly in s/gnu-linux.h, netbsd.h, darwin.h.  */
+#ifdef SOLARIS2
 #undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib/crt0.o /usr/lib/crtbegin.o
 #undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o
-
-#elif defined(__NetBSD__)
-
-/* LIB_STANDARD and START_FILES set correctly in s/netbsd.h */
-
-#elif defined(SOLARIS2)
-
-#undef START_FILES
-#undef LIB_STANDARD
-
-#elif defined(__APPLE__)
-
-/* LIB_STANDARD and START_FILES set correctly in s/darwin.h */
-
-#else /* !__OpenBSD__ && !__NetBSD__ && !SOLARIS2 && !__APPLE__ */
-/* CRT_DIR defaults to /usr/lib.  On GNU/Linux, it may be /usr/lib64.
-   On FreeBSD, the libraries for binaries native to the build host's
+#elif defined (__FreeBSD__) || (defined (DARWIN_OS) && !defined (__APPLE__))
+/* On FreeBSD, the libraries for binaries native to the build host's
    architecture are installed under /usr/lib, and the ones that need
    special paths are 32-bit compatibility libraries (installed under
    /usr/lib32).  So to build a native binary of Emacs on FreeBSD/amd64
-   we can just point to /usr/lib.
- */
+   we can just point to /usr/lib (the default $CRT_DIR).  */
 #undef START_FILES
 #define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
 /* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
@@ -105,7 +89,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #undef LIB_STANDARD
 #define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
 
-#endif /* __OpenBSD__ */
+#endif /* SOLARIS2 */
 #endif /* !i386 */
 
 /* arch-tag: 8a5e001d-e12e-4692-a3a6-0b15ba271c6e
index 3026266b3492ec7105ba743bf5d84a3b868bcc26..18cd87f0b9a95344dd23c9eab0e29d01926dc943 100644 (file)
@@ -85,11 +85,5 @@ NOTE-END */
 
 #define XPNTR(a) XUINT (a)
 
-#undef START_FILES
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
-
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
-
 /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
    (do not change this comment) */
index 112c15ed8e4c0bbdc6e10dde602082d3604f5440..d58592d915a9ec828a6b87079e4e2e834d6f934c 100644 (file)
@@ -39,12 +39,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifdef GNU_LINUX
 #define LINKER $(CC) -nostdlib
-#ifdef _ARCH_PPC64
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
-#endif
 #endif
 
 #ifdef _ARCH_PPC64
index b43e56bc3b90726f5908baec86849edb824aca93..226116361158fc4f19d5951354ac10ea12bf9f93 100644 (file)
@@ -52,17 +52,6 @@ NOTE-END  */
 
 #ifdef __arch64__              /* GCC, 64-bit ABI.  */
 #define BITS_PER_LONG 64
-#ifdef __linux__
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-
-/* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
-   The reason is that some functions in libgcc.a call functions from libc.a,
-   and some libc.a functions need functions from libgcc.a.  Since most
-   versions of ld are one-pass linkers, we need to mention -lgcc twice,
-   or else we risk getting unresolved externals.  */
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
 #endif
 
 #ifndef _LP64
index d8aaa833265c79de9fbf2afecee0d05cdc7da1ef..6c4da8f086376cf284ccd5892c85703169c34982 100644 (file)
@@ -46,8 +46,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    there, contrary to what a stock GCC would do.  */
 
 #define LD_SWITCH_SYSTEM  -L/usr/local/lib
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o
+#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o
 #undef LIB_GCC
 #define LIB_GCC
 
index a55fbcb9821769de24f218a9e2f69c506005130b..3d470032efc23b106b747edc450a0dd1f909b058 100644 (file)
@@ -168,7 +168,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* Ask GCC where to find libgcc.a.  */
 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
 
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
+#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
 
 /* Here is how to find X Windows.  LD_SWITCH_X_SITE_AUX gives an -R option
    says where to find X windows at run time.  */
@@ -190,7 +190,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #undef LIB_GCC
 #define LIB_GCC
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
+#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
 
 /* _BSD_SOURCE is redundant, at least in glibc2, since we define
    _GNU_SOURCE.  Left in in case it's relevant to libc5 systems and
index b7dab37760edaa58bdaae0ac8b1ad36e33973a24..28030de8897cdbbb5ce3c7726079262a67069455 100644 (file)
@@ -170,7 +170,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define NO_REMAP
 
-#define START_FILES pre-crt0.o /lib/crt0.o
+#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o
 
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
    pure and impure space as loaded can vary, and even their
index ee5d5b3f898d6ff07d5bce1e56e917da55586638..fd5ccc5fa8730b77e24f511157ff393a779f5fc3 100644 (file)
@@ -28,14 +28,14 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define LIBS_TERMCAP -ltermcap
 
-#define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1
+#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o START_FILES_1 $(CRT_DIR)/crtbegin.o
+#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o END_FILES_1
 #undef LIB_GCC
 #define LIB_GCC
 
 #ifdef HAVE_CRTIN
-#define START_FILES_1 /usr/lib/crti.o 
-#define END_FILES_1 /usr/lib/crtn.o
+#define START_FILES_1 $(CRT_DIR)/crti.o 
+#define END_FILES_1 $(CRT_DIR)/crtn.o
 #else
 #define START_FILES_1
 #define END_FILES_1