]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
*** empty log message ***
authorGordon Matzigkeit <gord@gnu.ai.mit.edu>
Tue, 1 Jul 1997 20:04:47 +0000 (20:04 +0000)
committerGordon Matzigkeit <gord@gnu.org>
Tue, 1 Jul 1997 20:04:47 +0000 (20:04 +0000)
ChangeLog
configure.in
libtool.m4
ltconfig.in
ltmain.sh.in

index afaf388e56de06ed588eb1c2f91fe977de100b66..a643291f2eedac8292c46bee54ad87b3798ffb48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Tue Jul  1 13:03:49 1997  Gordon Matzigkeit  <gord@gnu.ai.mit.edu>
+
+       * ltmain.sh.in, ltconfig.in: Eliminate uses of the NONE magic
+       variable value.  Use an empty variable instead.
+
+       * ltconfig.in (with_gcc, with_gnu_ld): Do the tests for the C
+       compiler and linker if the variables are unset, or if they are not
+       GNU C and ld.
+       (RANLIB): Eliminate redundant `if' statement.
+
+       * configure.in: Use AM_PROG_LD.
+
+       * libtool.m4 (AM_PROG_LD_GNU): New macro to determine if LD is GNU
+       ld.
+       (AM_PROG_LD): Rename AM_PATH_PROG_LD to AM_PROG_LD.  Parameterize
+       so that the user can specify `--with-gnu-ld' or `--without-gnu-ld'
+       to indicate his preference.
+       (AM_PROG_LIBTOOL): Use it.
+
 Mon Jun 30 22:32:05 1997  Gordon Matzigkeit  <gord@gnu.ai.mit.edu>
 
        * ltconfig.in: Add /sbin into the path before running ldconfig on
index da8bb29317544a865b4b9aa3dca20096e6e637af..e337e608f3da4a6b81dcfb4611cc999ee4df88d6 100644 (file)
@@ -10,7 +10,7 @@ AC_SUBST(aclocaldir)
 dnl Use the specified CC, RANLIB, and LD while running ltconfig.
 AC_PROG_CC
 AC_PROG_RANLIB
-AM_PATH_PROG_LD
+AM_PROG_LD
 AC_PROG_LN_S
 
 AC_OUTPUT([Makefile doc/Makefile tests/Makefile])
index 3a8fa807e2ee666c465fd50f7f84be5ceb1e466e..f7d1d9b44cdf16d9987cc1714ccf712c595c9a07 100644 (file)
 ## configuration script generated by Autoconf, you may include it under
 ## the same distribution terms that you use for the rest of that program.
 
-# serial 8 AM_PROG_LIBTOOL
+# serial 9 AM_PROG_LIBTOOL
 AC_DEFUN(AM_PROG_LIBTOOL,
 [AC_REQUIRE([AC_CANONICAL_HOST])
 AC_REQUIRE([AC_PROG_CC])
 AC_REQUIRE([AC_PROG_RANLIB])
-AC_REQUIRE([AM_PATH_PROG_LD])
+AC_REQUIRE([AM_PROG_LD])
 AC_REQUIRE([AC_PROG_LN_S])
 
 # Always use our own libtool.
@@ -48,6 +48,7 @@ libtool_static=)
 libtool_flags="$libtool_shared$libtool_static"
 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
@@ -74,10 +75,16 @@ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 || AC_MSG_ERROR([libtool configure failed])
 ])
 
-# AM_PATH_PROG_LD - find out which linker is being used by the C compiler
-AC_DEFUN(AM_PATH_PROG_LD,
-[AC_REQUIRE([AC_PROG_CC])
-AC_MSG_CHECKING([for ld used by the C compiler ($CC $CFLAGS $LDFLAGS)])
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+if test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
 AC_CACHE_VAL(ac_cv_path_LD,
 [case "$LD" in
   /*)
@@ -88,16 +95,14 @@ AC_CACHE_VAL(ac_cv_path_LD,
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/ld"; then
+      ac_cv_path_LD="$ac_dir/ld"
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
-      if "$ac_dir/ld" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
-        # If it was GNU ld, only accept it if we're using GCC.
-        ac_cv_path_LD="$ac_dir/ld"
-       test "$ac_cv_prog_gcc" = yes && break
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
+       test "$with_gnu_ld" = yes && break
       else
-        # If it was not GNU ld, and we are not using GCC, then accept it.
-        ac_cv_path_LD="$ac_dir/ld"
-        break
+        test "$with_gnu_ld" != yes && break
       fi
     fi
   done
@@ -112,4 +117,15 @@ else
 fi
 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
+  ac_cv_prog_gnu_ld=yes
+else
+  ac_cv_prog_gnu_ld=no
+fi])
 ])
index 7dea73638bd6deec3865bcc554c2b0a5d14d3331..6a2892b6f10725de5bc39db284aac48aaf23b3e9 100755 (executable)
@@ -44,15 +44,16 @@ can_build_shared=yes
 enable_shared=yes
 # All known linkers require a `.a' archive for static linking.
 enable_static=yes
-ltmain=NONE
+ltmain=
 silent=
 srcdir=
 ac_config_guess=
 ac_config_sub=
-host=NONE
-nonopt=NONE
+host=
+nonopt=
 verify_host=yes
 with_gcc=no
+with_gnu_ld=no
 
 old_AR="$AR"
 old_CC="$CC"
@@ -96,6 +97,7 @@ Generate a system-specific libtool script.
     --srcdir=DIR           find \`config.guess' in DIR
     --version              output version information and exit
     --with-gcc             assume that the GNU C compiler will be used
+    --with-gnu-ld          assume that the C compiler uses the GNU linker
 
 LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
 functionality.
@@ -119,6 +121,7 @@ EOM
   --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
 
   --with-gcc) with_gcc=yes ;;
+  --with-gnu-ld) with_gnu_ld=yes ;;
 
   -*)
     echo "$progname: unrecognized option \`$option'" 1>&2
@@ -127,9 +130,9 @@ EOM
     ;;
 
   *)
-    if test "$ltmain" = NONE; then
+    if test -z "$ltmain"; then
       ltmain="$option"
-    elif test "$host" = NONE; then
+    elif test -z "$host"; then
 # FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
 #      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
 #        echo "$progname: warning \`$option' is not a valid host type" 1>&2
@@ -143,7 +146,7 @@ EOM
   esac
 done
 
-if test "$ltmain" = NONE; then
+if test -z "$ltmain"; then
   echo "$progname: you must specify a LTMAIN file" 1>&2
   echo "$help" 1>&2
   exit 1
@@ -236,7 +239,7 @@ if test "$verify_host" = yes; then
 
   host_alias=$host
   case "$host_alias" in
-  NONE)
+  "")
     if host_alias=`$ac_config_guess`; then :
     else
       echo "$progname: cannot guess host type; you must specify one" 1>&2
@@ -247,7 +250,7 @@ if test "$verify_host" = yes; then
   host=`$ac_config_sub $host_alias`
   echo "$ac_t""$host" 1>&6
 
-elif test "$host" = NONE; then
+elif test -z "$host"; then
   echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
   echo "$help" 1>&2
   exit 1
@@ -274,18 +277,16 @@ if test "${RANLIB+set}" != "set"; then
   result=no
 
   echo $ac_n "checking for ranlib... $ac_c" 1>&6
-  if test "$result" = no; then
-    IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/ranlib; then
-       RANLIB="ranlib"
-       result="ranlib"
-       break
-      fi
-    done
-    IFS="$save_ifs"
-  fi
+  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}:"
+  for dir in $PATH; do
+    test -z "$dir" && dir=.
+    if test -f $dir/ranlib; then
+      RANLIB="ranlib"
+      result="ranlib"
+      break
+    fi
+  done
+  IFS="$save_ifs"
 
   echo $ac_t "$result" 1>&6
 fi
@@ -296,7 +297,7 @@ if test -n "$RANLIB"; then
 fi
 
 # Check to see if we are using GCC.
-if test "$with_gcc" = no; then
+if test "$with_gcc" != yes || test -z "$CC"; then
   # If CC is not set, then try to find GCC or a usable CC.
   if test -z "$CC"; then
     echo $ac_n "checking for gcc... $ac_c" 1>&6
@@ -498,41 +499,6 @@ else
   echo $ac_t none 1>&6
 fi
 
-if test -z "$LD"; then
-  # Find the linker that we think the C compiler uses.
-  echo $ac_n "checking for ld used by $compiler... $ac_c" 1>&6
-
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/ld"; then
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      if "$ac_dir/ld" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
-        # If it was GNU ld, only accept it if we're using GCC.
-        LD="$ac_dir/ld"
-       test "$with_gcc" = yes && break
-      else
-        # If it was not GNU ld, and we are not using GCC, then accept it.
-        LD="$ac_dir/ld"
-        break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-
-  if test -n "$CC"; then
-    echo "$ac_t""$LD" 1>&6
-  else
-    echo "$ac_t""no" 1>&6
-  fi
-
-  if test -z "$LD"; then
-    echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
-    exit 1
-  fi
-fi
-
 if test -z "$LN_S"; then
   # Check to see if we can use ln -s, or we need hard links.
   echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
@@ -550,21 +516,53 @@ if test -z "$LN_S"; then
   fi
 fi
 
-# See if we're really using GNU ld.
-with_gnu_ld=no
-# Allow LD to be a program name with arguments.
-set dummy $LD
-linker="$2"
-echo $ac_n "checking if $LD is GNU ld... $ac_c" 1>&6
-# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
-  with_gnu_ld=yes
-  linker="GNU ld"
+if test "$with_gnu_ld" != yes || test -z "$LD"; then
+  if test -z "$LD"; then
+    if test "$with_gnu_ld" = yes; then
+      echo $ac_n "checking for GNU ld... $ac_c" 1>&6
+    else
+      echo $ac_n "checking for non-GNU ld... $ac_c" 1>&6
+    fi
+
+    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+    for ac_dir in $PATH; do
+      test -z "$ac_dir" && ac_dir=.
+      if test -f "$ac_dir/ld"; then
+       LD="$ac_dir/ld"
+       # Check to see if the program is GNU ld.  I'd rather use --version,
+       # but apparently some GNU ld's only accept -v.
+       # Break only if it was the GNU/non-GNU ld that we prefer.
+       if "$LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
+         test "$with_gnu_ld" = yes && break
+       else
+         test "$with_gnu_ld" != yes && break
+       fi
+      fi
+    done
+    IFS="$ac_save_ifs"
+
+    if test -n "$LD"; then
+      echo "$ac_t""$LD" 1>&6
+    else
+      echo "$ac_t""no" 1>&6
+    fi
+
+    if test -z "$LD"; then
+      echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
+      exit 1
+    fi
+  fi
+
+  echo $ac_n "checking whether we are using GNU ld... $ac_c" 1>&6
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
+    with_gnu_ld=yes
+  fi
+  echo $ac_t "$with_gnu_ld" 1>&6
 fi
-echo $ac_t "$with_gnu_ld" 1>&6
 
 # See if the linker supports building shared libraries.
-echo $ac_n "checking if $linker supports shared libraries... $ac_c" 1>&6
+echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
 
 allow_undefined_flag=
 archive_cmds=
@@ -742,7 +740,7 @@ test "$hardcode_action" = unsupported && can_build_shared=no
 
 reload_flag=
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
-echo $ac_n "checking for $linker option to reload object files... $ac_c" 1>&6
+echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
 # PORTME Some linker may need a different reload flag.
 reload_flag='-r'
 echo $ac_t "$reload_flag"
index c83c1fdca29968e4629e1b16232a2200c0eb7c11..62b1d66e986227b9b002e48bf2493be19f7323b2 100644 (file)
@@ -30,7 +30,7 @@ PROGRAM=ltmain.sh
 PACKAGE=@PACKAGE@
 VERSION=@VERSION@
 
-default_mode=NONE
+default_mode=
 help="Try \`$progname --help' for more information."
 magic="%%%MAGIC variable%%%"
 mkdir="mkdir"
@@ -138,7 +138,7 @@ fi
 if test -z "$show_help"; then
 
   # Infer the operation mode.
-  if test "$mode" = NONE; then
+  if test -z "$mode"; then
     case "$nonopt" in
     *cc)
       mode=link
@@ -163,7 +163,7 @@ if test -z "$show_help"; then
       ;;
     *)
       # Just use the default operation mode.
-      if test "$mode" = NONE; then
+      if test -z "$mode"; then
        if test -n "$nonopt"; then
          echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
        else
@@ -1422,9 +1422,7 @@ EOF
          done
 
          if test "$hardcode_action" = relink; then
-           if test "$finalize" = no; then
-             echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
-           else
+           if test "$finalize" = yes; then
              echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
              $show "$finalize_command"
              if $run $finalize_command; then :
@@ -1433,6 +1431,8 @@ EOF
                continue
              fi
              file="$objdir/$file"T
+           else
+             echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
            fi
          else
            # Install the binary that we compiled earlier.