Move checks for perl inside function.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 14 Oct 2008 20:27:07 +0000 (22:27 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 14 Oct 2008 20:27:07 +0000 (22:27 +0200)
source4/build/m4/check_perl.m4

index 82ca2424999d00c0c5e3299cd38a700dfbe0c7ef..601798be471c4208834bd691a6dc94b41872b449 100644 (file)
@@ -5,6 +5,8 @@ dnl  Released under the GNU GPL
 dnl -------------------------------------------------------
 dnl
 
+AC_DEFUN([AC_SAMBA_PERL],
+[
 case "$host_os" in
        *irix*)
                # On IRIX, we prefer Freeware or Nekoware Perl, because the
@@ -18,11 +20,16 @@ esac
 
 if test x"$PERL" = x""; then
        AC_MSG_WARN([No version of perl was found!])
-       AC_MSG_ERROR([Please install perl from http://www.perl.com/])
+       $2
+else
+       if test x"$debug" = x"yes";then
+               PERL="$PERL -W"
+       fi
+       export PERL
+       $1
 fi
-if test x"$debug" = x"yes";then
-       PERL="$PERL -W"
-fi
-export PERL
+])
+
+AC_SAMBA_PERL([], [AC_MSG_ERROR([Please install perl from http://www.perl.com/])])
 
 AC_PATH_PROG(YAPP, yapp, false)