Next update of VFS modules development guide
[import/samba-docs-svnimport.git] / aclocal.m4
index 731139cfde2a0b7b362f67e5b2cb4f426cae3174..9ecbda5e6bc096818e3e0ca85fd950aece75257b 100644 (file)
@@ -1,3 +1,6 @@
+dnl (C) 2003-2004 Jelmer Vernooij <jelmer@samba.org>
+dnl Published under the GNU GPL
+dnl
 dnl DOCS_DEFINE_TARGET
 dnl arg1: Target that is defined
 dnl arg2: Requirement
@@ -24,7 +27,7 @@ dnl arg2: program executable name
 dnl arg3: target that requires it
 
 AC_DEFUN(DOCS_TARGET_REQUIRE_PROGRAM, [
-       AC_PATH_PROG([$1], [$2])
+       AC_CHECK_PROGS([$1], [$2])
        if test x"$$1" = x; then
                if test x"$$3_REQUIRES" = x; then
                        $3_REQUIRES="$2"
@@ -33,3 +36,29 @@ AC_DEFUN(DOCS_TARGET_REQUIRE_PROGRAM, [
                fi
        fi
 ])
+
+dnl DOCS_TARGET_REQUIRE_DIR
+dnl arg1: list of possible paths
+dnl arg2: file in dir know to exist
+dnl arg3: variable to store found path in
+dnl arg4: target that requires it
+
+AC_DEFUN(DOCS_TARGET_REQUIRE_DIR, [
+    AC_MSG_CHECKING([for $2])
+       AC_SUBST($3)
+       for I in $1; 
+       do 
+               test -f "$I/$2" && $3="$I"
+       done
+
+       if test x$$3 = x; then
+               if test x"$$4_REQUIRES" = x; then
+                       $4_REQUIRES="$3"
+               else
+                       $4_REQUIRES="$$4_REQUIRES $3"
+               fi
+               AC_MSG_RESULT([not found])
+       else
+               AC_MSG_RESULT([found in $$3])
+       fi
+])