]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1999-10-05 Akim Demaille <akim@epita.fr>
authorAkim Demaille <akim@epita.fr>
Tue, 5 Oct 1999 08:26:16 +0000 (08:26 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 5 Oct 1999 08:26:16 +0000 (08:26 +0000)
Implement AC_PATH_TOOL.
Submited by Gary V. Vaughan.

* acgeneral.m4 (AC_PATH_TOOL): New macro.
* autoconf.texi (Generic Programs): Document.

ChangeLog
TODO
acgeneral.m4
autoconf.texi
doc/autoconf.texi
lib/autoconf/general.m4

index 2a723118405e16562c12b17a361a61548bd99317..ef5f37fd37592ae32378b9fc114519a01102d194 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+1999-10-05  Akim Demaille  <akim@epita.fr>
+
+       Implement AC_PATH_TOOL.
+       Submited by Gary V. Vaughan.
+
+       * acgeneral.m4 (AC_PATH_TOOL): New macro.
+       * autoconf.texi (Generic Programs): Document.
+
 1999-10-05  Akim Demaille  <akim@epita.fr>
 
        Handle arbitrary version numbers.
diff --git a/TODO b/TODO
index ed0d44f9ec6009f92965ec8ba2351ed45bad97a6..fdcf7b42d68328b72e7727c288a1491c4e5b2d33 100644 (file)
--- a/TODO
+++ b/TODO
@@ -13,6 +13,7 @@ These are things mandatory to fulfill before releasing 2.15.  There
 are also suggestions we should either satisfy right now (they're
 easy), or remove (obsoleted since then).
 
+** AC_C_STRUCT_MEMBER needs a full rewrite.
 
 ** AC_CHECK_HEADER should not template config.h entries.
 Its entry in autoheader.m4 should be removed.
index c5d2a04f857e5ad6ac33ecd43dd015837b194740..9817860d042587e68d3796c8351153dee6cd88a6 100644 (file)
@@ -2041,8 +2041,10 @@ $1="$ac_cv_c_struct_member_$1"])
 dnl ### Checking for programs
 
 
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl               [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]])
+dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR
+dnl               [, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND]
+dnl               [, PATH [, REJECT]]])
+dnl ------------------------------------------------------
 AC_DEFUN(AC_CHECK_PROG,
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
@@ -2105,7 +2107,21 @@ else
   AC_MSG_RESULT(no)
 fi
 AC_SUBST($1)dnl
-])
+])dnl AC_CHECK_PROG
+
+
+dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
+dnl                [, PATH]])
+dnl -----------------------------------------------------------------
+AC_DEFUN(AC_CHECK_PROGS,
+[for ac_prog in $2
+do
+AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
+test -n "[$]$1" && break
+done
+ifelse([$3], , , [test -n "[$]$1" || $1="$3"
+])])
+
 
 dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
 dnl -------------------------------------------------------------------------
@@ -2148,19 +2164,10 @@ fi
 AC_SUBST($1)dnl
 ])
 
-dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
-dnl                [, PATH]])
-AC_DEFUN(AC_CHECK_PROGS,
-[for ac_prog in $2
-do
-AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
-test -n "[$]$1" && break
-done
-ifelse([$3], , , [test -n "[$]$1" || $1="$3"
-])])
 
 dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
 dnl               [, PATH]])
+dnl ----------------------------------------------------------------
 AC_DEFUN(AC_PATH_PROGS,
 [for ac_prog in $2
 do
@@ -2170,6 +2177,11 @@ done
 ifelse([$3], , , [test -n "[$]$1" || $1="$3"
 ])])
 
+
+
+
+dnl ### Checking for tools
+
 dnl Internal subroutine.
 AC_DEFUN(AC_CHECK_TOOL_PREFIX,
 [AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
@@ -2180,18 +2192,35 @@ else
 fi
 ])
 
+dnl AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl ------------------------------------------------------------------------
+AC_DEFUN(AC_PATH_TOOL,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
+             ifelse([$3], , [$2], ), $4)
+ifelse([$3], , , [
+if test -z "$ac_cv_prog_$1"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_PROG($1, $2, $2, $3)
+  else
+    $1="$3"
+  fi
+fi])
+])
+
 dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl -------------------------------------------------------------------------
 AC_DEFUN(AC_CHECK_TOOL,
 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
 AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
              ifelse([$3], , [$2], ), $4)
 ifelse([$3], , , [
 if test -z "$ac_cv_prog_$1"; then
-if test -n "$ac_tool_prefix"; then
-  AC_CHECK_PROG($1, $2, $2, $3)
-else
-  $1="$3"
-fi
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG($1, $2, $2, $3)
+  else
+    $1="$3"
+  fi
 fi])
 ])
 
index f0d75a46f3c1d7859a32517b38fbc6f47ca54a1a..7cbed2e2e455e6734c987d26baf069b188b9e6de 100644 (file)
@@ -1916,6 +1916,26 @@ are found, set @var{variable} to the entire path of the program
 found.
 @end defmac
 
+@defmac AC_PATH_TOOL (@var{variable}, @var{prog-to-check-for} @r{[},
+@var{value-if-not-found} @r{[}, @var{path}@r{]]})
+@maindex PATH_TOOL
+Like @code{AC_PATH_PROG}, but first looks for @var{prog-to-check-for}
+with a prefix of the host type as determined by
+@code{AC_CANONICAL_HOST},
+followed by a dash (@pxref{Canonicalizing}).  For example, if the user
+runs @samp{configure --host=i386-gnu}, then this call:
+@example
+AC_PATH_TOOL(FILE, file, :, /usr/bin:$PATH)
+@end example
+@noindent
+sets @code{FILE} to @file{/usr/bin/i386-gnu-file}, for example, if
+that program is found at @file{/usr/bin} in @code{PATH}, or to
+@samp{/usr/bin/file}, for example, if @emph{that} program is found at
+@file{/usr/bin} in @code{PATH}, or to @samp{:} if neither program can
+be found.
+@end defmac
+
+
 @node Libraries, Library Functions, Alternative Programs, Existing Tests
 @section Library Files
 
index f0d75a46f3c1d7859a32517b38fbc6f47ca54a1a..7cbed2e2e455e6734c987d26baf069b188b9e6de 100644 (file)
@@ -1916,6 +1916,26 @@ are found, set @var{variable} to the entire path of the program
 found.
 @end defmac
 
+@defmac AC_PATH_TOOL (@var{variable}, @var{prog-to-check-for} @r{[},
+@var{value-if-not-found} @r{[}, @var{path}@r{]]})
+@maindex PATH_TOOL
+Like @code{AC_PATH_PROG}, but first looks for @var{prog-to-check-for}
+with a prefix of the host type as determined by
+@code{AC_CANONICAL_HOST},
+followed by a dash (@pxref{Canonicalizing}).  For example, if the user
+runs @samp{configure --host=i386-gnu}, then this call:
+@example
+AC_PATH_TOOL(FILE, file, :, /usr/bin:$PATH)
+@end example
+@noindent
+sets @code{FILE} to @file{/usr/bin/i386-gnu-file}, for example, if
+that program is found at @file{/usr/bin} in @code{PATH}, or to
+@samp{/usr/bin/file}, for example, if @emph{that} program is found at
+@file{/usr/bin} in @code{PATH}, or to @samp{:} if neither program can
+be found.
+@end defmac
+
+
 @node Libraries, Library Functions, Alternative Programs, Existing Tests
 @section Library Files
 
index c5d2a04f857e5ad6ac33ecd43dd015837b194740..9817860d042587e68d3796c8351153dee6cd88a6 100644 (file)
@@ -2041,8 +2041,10 @@ $1="$ac_cv_c_struct_member_$1"])
 dnl ### Checking for programs
 
 
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl               [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]])
+dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR
+dnl               [, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND]
+dnl               [, PATH [, REJECT]]])
+dnl ------------------------------------------------------
 AC_DEFUN(AC_CHECK_PROG,
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
@@ -2105,7 +2107,21 @@ else
   AC_MSG_RESULT(no)
 fi
 AC_SUBST($1)dnl
-])
+])dnl AC_CHECK_PROG
+
+
+dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
+dnl                [, PATH]])
+dnl -----------------------------------------------------------------
+AC_DEFUN(AC_CHECK_PROGS,
+[for ac_prog in $2
+do
+AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
+test -n "[$]$1" && break
+done
+ifelse([$3], , , [test -n "[$]$1" || $1="$3"
+])])
+
 
 dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
 dnl -------------------------------------------------------------------------
@@ -2148,19 +2164,10 @@ fi
 AC_SUBST($1)dnl
 ])
 
-dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
-dnl                [, PATH]])
-AC_DEFUN(AC_CHECK_PROGS,
-[for ac_prog in $2
-do
-AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
-test -n "[$]$1" && break
-done
-ifelse([$3], , , [test -n "[$]$1" || $1="$3"
-])])
 
 dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
 dnl               [, PATH]])
+dnl ----------------------------------------------------------------
 AC_DEFUN(AC_PATH_PROGS,
 [for ac_prog in $2
 do
@@ -2170,6 +2177,11 @@ done
 ifelse([$3], , , [test -n "[$]$1" || $1="$3"
 ])])
 
+
+
+
+dnl ### Checking for tools
+
 dnl Internal subroutine.
 AC_DEFUN(AC_CHECK_TOOL_PREFIX,
 [AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
@@ -2180,18 +2192,35 @@ else
 fi
 ])
 
+dnl AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl ------------------------------------------------------------------------
+AC_DEFUN(AC_PATH_TOOL,
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
+             ifelse([$3], , [$2], ), $4)
+ifelse([$3], , , [
+if test -z "$ac_cv_prog_$1"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_PROG($1, $2, $2, $3)
+  else
+    $1="$3"
+  fi
+fi])
+])
+
 dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+dnl -------------------------------------------------------------------------
 AC_DEFUN(AC_CHECK_TOOL,
 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
 AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
              ifelse([$3], , [$2], ), $4)
 ifelse([$3], , , [
 if test -z "$ac_cv_prog_$1"; then
-if test -n "$ac_tool_prefix"; then
-  AC_CHECK_PROG($1, $2, $2, $3)
-else
-  $1="$3"
-fi
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG($1, $2, $2, $3)
+  else
+    $1="$3"
+  fi
 fi])
 ])