From: Gary V. Vaughan Date: Sun, 3 Oct 1999 20:41:21 +0000 (+0000) Subject: * ltconfig.in: Set $FILE to @FILE@ for substitution with X-Git-Tag: multi-language-fork~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ad30f497ca9582af43b2f408740bb3dd830875e;p=thirdparty%2Flibtool.git * 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} --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. --- diff --git a/ChangeLog b/ChangeLog index d26217866..fe2bfa93d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +1999-10-03 Gary V. Vaughan + + * 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} --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 * NEWS: new -no-install flag diff --git a/libtool.m4 b/libtool.m4 index 407f94502..bf7cbdbb8 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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, diff --git a/ltconfig.in b/ltconfig.in index c649f99ee..0a70798ab 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -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@