From: Glenn Morris Date: Tue, 27 Apr 2010 03:14:14 +0000 (-0700) Subject: Use $CRT_DIR in more places. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~382 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=76cda504fbe7474fc404611a00764b3db703e650;p=emacs.git Use $CRT_DIR in more places. * 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. --- diff --git a/ChangeLog b/ChangeLog index efbc1891abf..61a5bf19416 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-04-27 Glenn Morris + * 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 diff --git a/configure.in b/configure.in index cc50ae4fb86..20f335a52cf 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/src/ChangeLog b/src/ChangeLog index 1dbdf0fbae8..0675257abd3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,18 @@ 2010-04-27 Glenn Morris + * 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. diff --git a/src/Makefile.in b/src/Makefile.in index adf4400a1da..2f1029cf70c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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@ diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h index 6d27c950ce4..f7dfb126e6e 100644 --- a/src/m/amdx86-64.h +++ b/src/m/amdx86-64.h @@ -67,34 +67,18 @@ along with GNU Emacs. If not, see . */ /* 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 . */ #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 diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h index 3026266b349..18cd87f0b9a 100644 --- a/src/m/ibms390x.h +++ b/src/m/ibms390x.h @@ -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) */ diff --git a/src/m/macppc.h b/src/m/macppc.h index 112c15ed8e4..d58592d915a 100644 --- a/src/m/macppc.h +++ b/src/m/macppc.h @@ -39,12 +39,6 @@ along with GNU Emacs. If not, see . */ #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 diff --git a/src/m/sparc.h b/src/m/sparc.h index b43e56bc3b9..22611636115 100644 --- a/src/m/sparc.h +++ b/src/m/sparc.h @@ -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 diff --git a/src/s/freebsd.h b/src/s/freebsd.h index d8aaa833265..6c4da8f0863 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -46,8 +46,8 @@ along with GNU Emacs. If not, see . */ 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 diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index a55fbcb9821..3d470032efc 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -168,7 +168,7 @@ along with GNU Emacs. If not, see . */ /* 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 . */ #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 diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h index b7dab37760e..28030de8897 100644 --- a/src/s/hpux10-20.h +++ b/src/s/hpux10-20.h @@ -170,7 +170,7 @@ along with GNU Emacs. If not, see . */ #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 diff --git a/src/s/netbsd.h b/src/s/netbsd.h index ee5d5b3f898..fd5ccc5fa87 100644 --- a/src/s/netbsd.h +++ b/src/s/netbsd.h @@ -28,14 +28,14 @@ along with GNU Emacs. If not, see . */ #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