2 # Copyright © 2005 Scott James Remnant <scott@netsplit.com>
3 # Copyright © 2007 Frank Lichtenheld <djpig@debian.org>
4 # Copyright © 2007, 2009, 2011 Guillem Jover <guillem@debian.org>
8 # Locate perl interpreter in the path
9 AC_DEFUN([DPKG_PROG_PERL], [
10 AC_ARG_VAR([PERL], [Perl interpreter])dnl
11 m4_define([_PERL_MIN_VERSION], [5.28.1])
12 AC_SUBST([PERL_MIN_VERSION], [_PERL_MIN_VERSION])
13 AC_CACHE_CHECK([for perl >= _PERL_MIN_VERSION], [ac_cv_path_PERL], [
14 AC_PATH_PROGS_FEATURE_CHECK([PERL], [perl], [
15 perlcheck=$(test -x $ac_path_PERL && \
16 $ac_path_PERL -MConfig -Mversion -e \
17 'my $r = qv("v$Config{version}") >= qv("_PERL_MIN_VERSION");
19 AS_IF([test "x$perlcheck" = "xyes"], [
20 ac_cv_path_PERL=$ac_path_PERL ac_path_PERL_found=:
23 AC_MSG_ERROR([cannot find perl >= _PERL_MIN_VERSION])
26 AC_SUBST([PERL], [$ac_cv_path_PERL])
27 AC_ARG_VAR([PERL_LIBDIR], [Perl library directory])dnl
28 # Let the user override the variable.
29 AS_IF([test -z "$PERL_LIBDIR"], [
30 PERL_LIBDIR=$($PERL -MConfig -e \
31 'my $r = $Config{vendorlibexp};
32 $r =~ s/$Config{vendorprefixexp}/\$(prefix)/;
39 AC_DEFUN([DPKG_PROG_PO4A], [
41 AC_REQUIRE([DPKG_PROG_PERL])
42 AC_ARG_VAR([PO4A], [po4a program])
43 m4_define([_PO4A_MIN_VERSION], [0.59])
44 AC_CACHE_CHECK([for po4a >= _PO4A_MIN_VERSION], [ac_cv_path_PO4A], [
45 AC_PATH_PROGS_FEATURE_CHECK([PO4A], [po4a], [
46 po4aversion=$(LC_ALL=C $ac_path_PO4A --version \
47 | $SED -ne 's/^po4a version \(.*\)\.$/\1/p')
48 AS_VERSION_COMPARE([$po4aversion], [_PO4A_MIN_VERSION],
49 [po4acheck=no], [po4acheck=yes], [po4acheck=yes])
50 AS_IF([test "x$po4acheck" = "xyes"], [
51 ac_cv_path_PO4A=$ac_path_PO4A ac_path_PO4A_found=:
57 AC_SUBST([PO4A], [$ac_cv_path_PO4A])
59 AS_IF([test "$USE_NLS" = "yes" && test "$ac_cv_path_PO4A" != "no"], [
69 AC_DEFUN([DPKG_PROG_POD2MAN], [
70 AC_ARG_VAR([POD2MAN], [pod2man program])
71 AC_CHECK_PROGS([POD2MAN], [pod2man])
72 AM_CONDITIONAL([BUILD_POD_DOC], [test "x$POD2MAN" != "x"])
77 # Specify GNU tar program name to use by dpkg. On GNU systems this is
78 # usually simply tar, on BSD systems this is usually gnutar or gtar.
79 AC_DEFUN([DPKG_PROG_TAR], [
80 AC_ARG_VAR([TAR], [GNU tar program])
81 AC_CHECK_PROGS([TAR], [gnutar gtar tar], [tar])
82 AS_IF([! $TAR --version 2>/dev/null | grep -q '^tar (GNU tar)'], [
83 AC_MSG_ERROR([cannot find a GNU tar program])
85 AC_DEFINE_UNQUOTED([TAR], ["$TAR"], [GNU tar program])
90 # Specify GNU patch program name to use by dpkg-source. On GNU systems this
91 # is usually simply patch, on BSD systems this is usually gpatch.
92 # Even though most invocations would work with other patch implementations,
93 # currently only GNU patch is directory traversal resistant.
94 AC_DEFUN([DPKG_PROG_PATCH], [
95 AC_ARG_VAR([PATCH], [GNU patch program])
96 AC_CHECK_PROGS([PATCH], [gpatch patch], [patch])
97 AS_IF([! $PATCH --version 2>/dev/null | grep -q '^GNU patch'], [
98 AC_MSG_ERROR([cannot find a GNU patch program])
100 AC_DEFINE_UNQUOTED([PATCH], ["$PATCH"], [GNU patch program])