acl-devel
[Top][All Lists]
Advanced

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

[Acl-devel] [PATCH] improve AC_PATH_PROG usage


From: Mike Frysinger
Subject: [Acl-devel] [PATCH] improve AC_PATH_PROG usage
Date: Fri, 8 Jan 2010 22:03:36 -0500

Use AC_PATH_PROG unconditionally and append the search PATH instead of
forcing lookup in a few dirs.  This way we can find the binaries on more
systems where things don't live in the expected locations.

Signed-off-by: Mike Frysinger <address@hidden>
---
 m4/package_utilies.m4 |   53 +++++++++++++------------------------------------
 1 files changed, 14 insertions(+), 39 deletions(-)

diff --git a/m4/package_utilies.m4 b/m4/package_utilies.m4
index d8f0726..4de3d3b 100644
--- a/m4/package_utilies.m4
+++ b/m4/package_utilies.m4
@@ -36,55 +36,38 @@ AC_DEFUN([AC_PACKAGE_UTILITIES],
     AC_SUBST(cc)
     AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
 
-    if test -z "$MAKE"; then
-        AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/local/bin:/usr/freeware/bin)
-    fi
-    if test -z "$MAKE"; then
-        AC_PATH_PROG(MAKE, make,, /usr/bin)
-    fi
+    
search_path="$PATH$PATH_SEPARATOR/usr/freeware/bin$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR/usr/local/bin"
+
+    AC_PATH_PROGS(MAKE, gmake make,, $search_path)
     make=$MAKE
     AC_SUBST(make)
     AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
 
-    if test -z "$TAR"; then
-        AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin)
-    fi
+    AC_PATH_PROG(TAR, tar,, $search_path)
     tar=$TAR
     AC_SUBST(tar)
-    if test -z "$ZIP"; then
-        AC_PATH_PROG(ZIP, gzip,, 
/bin:/usr/bin:/usr/local/bin:/usr/freeware/bin)
-    fi
 
+    AC_PATH_PROG(ZIP, gzip,, $search_path)
     zip=$ZIP
     AC_SUBST(zip)
 
-    if test -z "$MAKEDEPEND"; then
-        AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
-    fi
+    AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
     makedepend=$MAKEDEPEND
     AC_SUBST(makedepend)
 
-    if test -z "$AWK"; then
-        AC_PATH_PROG(AWK, awk,, /bin:/usr/bin)
-    fi
+    AC_PATH_PROG(AWK, awk,, $search_path)
     awk=$AWK
     AC_SUBST(awk)
 
-    if test -z "$SED"; then
-        AC_PATH_PROG(SED, sed,, /bin:/usr/bin)
-    fi
+    AC_PATH_PROG(SED, sed,, $search_path)
     sed=$SED
     AC_SUBST(sed)
 
-    if test -z "$ECHO"; then
-        AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin)
-    fi
+    AC_PATH_PROG(ECHO, echo,, $search_path)
     echo=$ECHO
     AC_SUBST(echo)
 
-    if test -z "$SORT"; then
-        AC_PATH_PROG(SORT, sort,, /bin:/usr/bin)
-    fi
+    AC_PATH_PROG(SORT, sort,, $search_path)
     sort=$SORT
     AC_SUBST(sort)
 
@@ -92,23 +75,17 @@ AC_DEFUN([AC_PACKAGE_UTILITIES],
     AC_PROG_LN_S
 
     if test "$enable_gettext" = yes; then
-        if test -z "$MSGFMT"; then
-                AC_PATH_PROG(MSGFMT, msgfmt,, 
/usr/bin:/usr/local/bin:/usr/freeware/bin)
-        fi
+        AC_PATH_PROG(MSGFMT, msgfmt,, $search_path)
         msgfmt=$MSGFMT
         AC_SUBST(msgfmt)
         AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
 
-        if test -z "$MSGMERGE"; then
-                AC_PATH_PROG(MSGMERGE, msgmerge,, 
/usr/bin:/usr/local/bin:/usr/freeware/bin)
-        fi
+        AC_PATH_PROG(MSGMERGE, msgmerge,, $search_path)
         msgmerge=$MSGMERGE
         AC_SUBST(msgmerge)
         AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
 
-        if test -z "$XGETTEXT"; then
-                AC_PATH_PROG(XGETTEXT, xgettext,, 
/usr/bin:/usr/local/bin:/usr/freeware/bin)
-        fi
+        AC_PATH_PROG(XGETTEXT, xgettext,, $search_path)
         xgettext=$XGETTEXT
         AC_SUBST(xgettext)
         AC_PACKAGE_NEED_UTILITY($1, "$xgettext", xgettext, gettext)
@@ -116,9 +93,7 @@ AC_DEFUN([AC_PACKAGE_UTILITIES],
         AC_DEFINE([ENABLE_GETTEXT], 1, [enable gettext])
     fi
 
-    if test -z "$RPM"; then
-        AC_PATH_PROG(RPM, rpm,, /bin:/usr/bin:/usr/freeware/bin)
-    fi
+    AC_PATH_PROG(RPM, rpm,, $search_path)
     rpm=$RPM
     AC_SUBST(rpm)
 
-- 
1.6.6





reply via email to

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