diff options
| author | Glenn Morris | 2011-06-28 22:50:32 -0400 |
|---|---|---|
| committer | Glenn Morris | 2011-06-28 22:50:32 -0400 |
| commit | adbc4ef4b5b969044cdb37cd9a18ed32d766e860 (patch) | |
| tree | f817630770e910dbfd83c9ea59b24b1cc3f8add4 | |
| parent | 8b7fba43dd3fcfb7fb4798794b20f6197dd8f829 (diff) | |
| download | emacs-adbc4ef4b5b969044cdb37cd9a18ed32d766e860.tar.gz emacs-adbc4ef4b5b969044cdb37cd9a18ed32d766e860.zip | |
* configure.in: Try to test for the required crt*.o files.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | configure.in | 118 |
2 files changed, 74 insertions, 48 deletions
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-06-29 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * configure.in: Try to test for the required crt*.o files. | ||
| 4 | |||
| 1 | 2011-06-27 Bill Wohler <wohler@newt.com> | 5 | 2011-06-27 Bill Wohler <wohler@newt.com> |
| 2 | 6 | ||
| 3 | * .bzrignore: Add lisp/mh-e/mh-autoloads.el and lisp/mh-e/mh-cus-load.el. | 7 | * .bzrignore: Add lisp/mh-e/mh-autoloads.el and lisp/mh-e/mh-cus-load.el. |
diff --git a/configure.in b/configure.in index 0e9f031c164..5374dfe47dd 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -988,54 +988,6 @@ dnl Do this early because it can frob feature test macros for Unix-98 &c. | |||
| 988 | AC_SYS_LARGEFILE | 988 | AC_SYS_LARGEFILE |
| 989 | 989 | ||
| 990 | 990 | ||
| 991 | ## If user specified a crt-dir, use that unconditionally. | ||
| 992 | if test "X$CRT_DIR" = "X"; then | ||
| 993 | |||
| 994 | case "$canonical" in | ||
| 995 | x86_64-*-linux-gnu* | s390x-*-linux-gnu*) | ||
| 996 | ## On x86-64 and s390x GNU/Linux distributions, the standard library | ||
| 997 | ## can be in a variety of places. We only try /usr/lib64 and /usr/lib. | ||
| 998 | ## For anything else (eg /usr/lib32), it is up the user to specify | ||
| 999 | ## the location (bug#5655). | ||
| 1000 | ## Test for crtn.o, not just the directory, because sometimes the | ||
| 1001 | ## directory exists but does not have the relevant files (bug#1287). | ||
| 1002 | ## FIXME better to test for binary compatibility somehow. | ||
| 1003 | test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64 | ||
| 1004 | ;; | ||
| 1005 | |||
| 1006 | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;; | ||
| 1007 | esac | ||
| 1008 | |||
| 1009 | case "$opsys" in | ||
| 1010 | hpux10-20) CRT_DIR=/lib ;; | ||
| 1011 | esac | ||
| 1012 | |||
| 1013 | ## Default is /usr/lib. | ||
| 1014 | test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib | ||
| 1015 | |||
| 1016 | ## If we're using gcc, try to determine it automatically by asking | ||
| 1017 | ## gcc. [If this doesn't work, CRT_DIR will remain at the | ||
| 1018 | ## system-dependent default from above.] | ||
| 1019 | if test "x${GCC}" = xyes; then | ||
| 1020 | crt_file=`$CC --print-file-name=crt1.o 2>/dev/null` | ||
| 1021 | case "$crt_file" in | ||
| 1022 | */*) | ||
| 1023 | CRT_DIR=`AS_DIRNAME(["$crt_file"])` | ||
| 1024 | ;; | ||
| 1025 | esac | ||
| 1026 | fi | ||
| 1027 | |||
| 1028 | else | ||
| 1029 | |||
| 1030 | ## Some platforms don't use any of these files, so it is not | ||
| 1031 | ## appropriate to put this test outside the if block. | ||
| 1032 | test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \ | ||
| 1033 | AC_MSG_ERROR([crt*.o not found in specified location.]) | ||
| 1034 | |||
| 1035 | fi | ||
| 1036 | |||
| 1037 | AC_SUBST(CRT_DIR) | ||
| 1038 | |||
| 1039 | LIB_MATH=-lm | 991 | LIB_MATH=-lm |
| 1040 | LIB_STANDARD= | 992 | LIB_STANDARD= |
| 1041 | START_FILES= | 993 | START_FILES= |
| @@ -1076,6 +1028,76 @@ esac | |||
| 1076 | AC_SUBST(LIB_MATH) | 1028 | AC_SUBST(LIB_MATH) |
| 1077 | AC_SUBST(START_FILES) | 1029 | AC_SUBST(START_FILES) |
| 1078 | 1030 | ||
| 1031 | dnl Not all platforms use crtn.o files. Check if the current one does. | ||
| 1032 | crt_files= | ||
| 1033 | |||
| 1034 | for file in x $LIB_STANDARD $START_FILES; do | ||
| 1035 | case "$file" in | ||
| 1036 | *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;; | ||
| 1037 | esac | ||
| 1038 | done | ||
| 1039 | |||
| 1040 | if test "x$crt_files" != x; then | ||
| 1041 | |||
| 1042 | ## If user specified a crt-dir, use that unconditionally. | ||
| 1043 | if test "X$CRT_DIR" = "X"; then | ||
| 1044 | |||
| 1045 | CRT_DIR=/usr/lib # default | ||
| 1046 | |||
| 1047 | case "$canonical" in | ||
| 1048 | x86_64-*-linux-gnu* | s390x-*-linux-gnu*) | ||
| 1049 | ## On x86-64 and s390x GNU/Linux distributions, the standard library | ||
| 1050 | ## can be in a variety of places. We only try /usr/lib64 and /usr/lib. | ||
| 1051 | ## For anything else (eg /usr/lib32), it is up the user to specify | ||
| 1052 | ## the location (bug#5655). | ||
| 1053 | ## Test for crtn.o, not just the directory, because sometimes the | ||
| 1054 | ## directory exists but does not have the relevant files (bug#1287). | ||
| 1055 | ## FIXME better to test for binary compatibility somehow. | ||
| 1056 | test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64 | ||
| 1057 | ;; | ||
| 1058 | |||
| 1059 | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;; | ||
| 1060 | esac | ||
| 1061 | |||
| 1062 | case "$opsys" in | ||
| 1063 | hpux10-20) CRT_DIR=/lib ;; | ||
| 1064 | esac | ||
| 1065 | |||
| 1066 | fi # CRT_DIR = "" | ||
| 1067 | |||
| 1068 | crt_missing= | ||
| 1069 | crt_gcc=no | ||
| 1070 | test "x${GCC}" = xyes && crt_gcc=yes | ||
| 1071 | |||
| 1072 | for file in $crt_files; do | ||
| 1073 | |||
| 1074 | ## If we're using gcc, try to determine it automatically by asking | ||
| 1075 | ## gcc. [If this doesn't work, CRT_DIR will remain at the | ||
| 1076 | ## system-dependent default from above.] | ||
| 1077 | ## Note that this overrides a faulty with-crt-dir. | ||
| 1078 | if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then | ||
| 1079 | crt_gcc=no dnl only try once | ||
| 1080 | |||
| 1081 | crt_file=`$CC --print-file-name=$file 2>/dev/null` | ||
| 1082 | case "$crt_file" in | ||
| 1083 | */*) | ||
| 1084 | CRT_DIR=`AS_DIRNAME(["$crt_file"])` | ||
| 1085 | ;; | ||
| 1086 | esac | ||
| 1087 | fi | ||
| 1088 | |||
| 1089 | test -e $CRT_DIR/$file || crt_missing="$crt_missing $file" | ||
| 1090 | done # $crt_files | ||
| 1091 | |||
| 1092 | test "x$crt_missing" = x || \ | ||
| 1093 | AC_MSG_ERROR([Required file(s) not found:$crt_missing | ||
| 1094 | Try using the --with-crt-dir option.]) | ||
| 1095 | |||
| 1096 | fi # crt_files != "" | ||
| 1097 | |||
| 1098 | AC_SUBST(CRT_DIR) | ||
| 1099 | |||
| 1100 | |||
| 1079 | dnl This function definition taken from Gnome 2.0 | 1101 | dnl This function definition taken from Gnome 2.0 |
| 1080 | dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) | 1102 | dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) |
| 1081 | dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page | 1103 | dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page |