emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104778: * configure.in: Try to test


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104778: * configure.in: Try to test for the required crt*.o files.
Date: Tue, 28 Jun 2011 22:50:32 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104778
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2011-06-28 22:50:32 -0400
message:
  * configure.in: Try to test for the required crt*.o files.
modified:
  ChangeLog
  configure.in
=== modified file 'ChangeLog'
--- a/ChangeLog 2011-06-27 04:31:43 +0000
+++ b/ChangeLog 2011-06-29 02:50:32 +0000
@@ -1,3 +1,7 @@
+2011-06-29  Glenn Morris  <address@hidden>
+
+       * configure.in: Try to test for the required crt*.o files.
+
 2011-06-27  Bill Wohler  <address@hidden>
 
        * .bzrignore: Add lisp/mh-e/mh-autoloads.el and 
lisp/mh-e/mh-cus-load.el.

=== modified file 'configure.in'
--- a/configure.in      2011-06-25 08:40:38 +0000
+++ b/configure.in      2011-06-29 02:50:32 +0000
@@ -988,54 +988,6 @@
 AC_SYS_LARGEFILE
 
 
-## If user specified a crt-dir, use that unconditionally.
-if test "X$CRT_DIR" = "X"; then
-
-  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
-
-  ## If we're using gcc, try to determine it automatically by asking
-  ## gcc.  [If this doesn't work, CRT_DIR will remain at the
-  ## system-dependent default from above.]
-  if test "x${GCC}" = xyes; then
-     crt_file=`$CC --print-file-name=crt1.o 2>/dev/null`
-     case "$crt_file" in
-       */*)
-         CRT_DIR=`AS_DIRNAME(["$crt_file"])`
-         ;;
-     esac
-  fi
-
-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
-
-AC_SUBST(CRT_DIR)
-
 LIB_MATH=-lm
 LIB_STANDARD=
 START_FILES=
@@ -1076,6 +1028,76 @@
 AC_SUBST(LIB_MATH)
 AC_SUBST(START_FILES)
 
+dnl Not all platforms use crtn.o files.  Check if the current one does.
+crt_files=
+
+for file in x $LIB_STANDARD $START_FILES; do
+  case "$file" in
+    *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;;
+  esac
+done
+
+if test "x$crt_files" != x; then
+
+  ## If user specified a crt-dir, use that unconditionally.
+  if test "X$CRT_DIR" = "X"; then
+
+    CRT_DIR=/usr/lib            # default
+
+    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
+
+  fi                            # CRT_DIR = ""
+
+  crt_missing=
+  crt_gcc=no
+  test "x${GCC}" = xyes && crt_gcc=yes
+
+  for file in $crt_files; do
+
+    ## If we're using gcc, try to determine it automatically by asking
+    ## gcc.  [If this doesn't work, CRT_DIR will remain at the
+    ## system-dependent default from above.]
+    ## Note that this overrides a faulty with-crt-dir.
+    if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then
+       crt_gcc=no                dnl only try once
+
+       crt_file=`$CC --print-file-name=$file 2>/dev/null`
+       case "$crt_file" in
+         */*)
+           CRT_DIR=`AS_DIRNAME(["$crt_file"])`
+           ;;
+       esac
+    fi
+
+    test -e $CRT_DIR/$file || crt_missing="$crt_missing $file"    
+  done                          # $crt_files
+
+  test "x$crt_missing" = x || \
+    AC_MSG_ERROR([Required file(s) not found:$crt_missing
+Try using the --with-crt-dir option.])
+
+fi                              # crt_files != ""
+
+AC_SUBST(CRT_DIR)
+
+
 dnl This function definition taken from Gnome 2.0
 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, 
action-not)
 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page


reply via email to

[Prev in Thread] Current Thread [Next in Thread]