]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in: Set $FILE to @FILE@ for substitution with
authorGary V. Vaughan <gary@gnu.org>
Sun, 3 Oct 1999 20:41:21 +0000 (20:41 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sun, 3 Oct 1999 20:41:21 +0000 (20:41 +0000)
the value found in libtool.m4 at configure time.
* libtool.m4 (AC_PATH_TOOL_GREP_VERSION):  New macro, combines
AC_PATH_PROG and AC_CHECK_TOOL with a test which greps the
output of $ac_dir/${ac_prefix}<tool> --version for a
given regex.
(AC_PATH_PROG_GREP_VERSION):  New macro used by the above.
(AC_LIBTOOL_SETUP): Use the new macros to search the PATH
[starting at /usr/bin] for a file program which accepts
--version and has "file" in its --version output.

ChangeLog
libtool.m4
ltconfig.in

index d26217866a0b36faaef443857d9684028c57ca22..fe2bfa93de4dbf3ed9b81504f0d2accd069f05fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+1999-10-03  Gary V. Vaughan  <gary@oranda.demon.co.uk>
+
+       * ltconfig.in:  Set $FILE to @FILE@ for substitution with
+       the value found in libtool.m4 at configure time.
+       * libtool.m4 (AC_PATH_TOOL_GREP_VERSION):  New macro, combines
+       AC_PATH_PROG and AC_CHECK_TOOL with a test which greps the
+       output of $ac_dir/${ac_prefix}<tool> --version for a
+       given regex.
+       (AC_PATH_PROG_GREP_VERSION):  New macro used by the above.
+       (AC_LIBTOOL_SETUP): Use the new macros to search the PATH
+       [starting at /usr/bin] for a file program which accepts
+       --version and has "file" in its --version output.
+
 1999-10-03  Thomas Tanner  <tanner@ffii.org>
 
        * NEWS: new -no-install flag
index 407f9450237a96937cbc177f2ed9682ff699a714..bf7cbdbb88d8601a9f1cc87941cf72479eee165a 100644 (file)
@@ -68,9 +68,9 @@ AC_REQUIRE([AC_OBJEXT])dnl
 AC_REQUIRE([AC_EXEEXT])dnl
 dnl
 
-AC_CHECK_TOOL(FILE, file, :)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
+AC_PATH_TOOL_VERSION_GREP(FILE, file, file, :, "/usr/bin:$PATH")
 
 # Check for any special flags to pass to ltconfig.
 libtool_flags="--cache-file=$cache_file"
@@ -266,6 +266,70 @@ enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 AC_ENABLE_FAST_INSTALL(no)])
 
+
+# AC_PATH_PROG_VERSION_GREP - look for a particular expression in the output
+#                             generated by $PROG --version
+dnl  AC_PATH_PROG_VERSION_GREP(VARIABLE, PROG-TO-CHECK-FOR, GREP-EXPRESSION[, VALUE-IF-NOT-FOUND[, PATH]])
+AC_DEFUN(AC_PATH_PROG_VERSION_GREP,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$5], , $PATH, [$5])"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if $ac_dir/$2 --version 2>/dev/null | grep $3 >/dev/null 2>&1; then
+      ac_cv_path_$1="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# AC_PATH_TOOL_VERSION_GREP - Try AC_PATH_PROG_VERSION_GREP with target 
+#                             prefix when cross-compiling
+dnl AC_PATH_TOOL_VERSION_GREP(VARIABLE, PROG-TO-CHECK-FOR, GREP-EXPRESSION[, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AC_PATH_TOOL_VERSION_GREP,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_PROG_VERSION_GREP($1, ${ac_tool_prefix}$2, $3, 
+                         ifelse([$4], , [$2], ), $5)
+ifelse([$4], , , [
+  if test -z "$ac_cv_prog_$1"; then
+    if test -n "$ac_tool_prefix"; then
+      AC_PATH_PROG_VERSION_GREP($1, $2, $3, $2, $5)
+    else
+      $1="$4"
+    fi
+  fi
+])
+])
+
+
 # AC_PROG_LD - find the path to the GNU or non-GNU linker
 AC_DEFUN(AC_PROG_LD,
 [AC_ARG_WITH(gnu-ld,
index c649f99ee84585cedcfd399d4f6ad10c90ef58e2..0a70798ab547f7875aa1ba5865d1ce99bc85448d 100755 (executable)
@@ -524,6 +524,7 @@ test -z "$RANLIB" && RANLIB=@RANLIB@
 # Commands probed in libtool.m4
 #   -- let the user override the result from configure
 test -z "$CC" && CC=@CC@
+test -z "$FILE" && FILE=@FILE@
 test -z "$LD" && LD=@LD@
 test -z "$STRIP" && STRIP=@STRIP@