6 AC_DEFUN([PGAC_PATH_PERL],
7 [# Let the user override the search
8 if test -z "$PERL"; then
9 AC_PATH_PROG(PERL, perl)
13 pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']`
14 AC_MSG_NOTICE([using perl $pgac_perl_version])
15 if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
16 $AWK '{ if ([$]1 = 5 && [$]2 >= 8) exit 1; else exit 0;}'
19 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
20 *** Perl version 5.8 or later is required, but this is $pgac_perl_version.])
25 if test -z "$PERL"; then
27 *** Without Perl you will not be able to build PostgreSQL from Git.
28 *** You can obtain Perl from any CPAN mirror site.
29 *** (If you are using the official distribution of PostgreSQL then you do not
30 *** need to worry about this, because the Perl output is pre-generated.)])
35 # PGAC_CHECK_PERL_CONFIG(NAME)
36 # ----------------------------
37 AC_DEFUN([PGAC_CHECK_PERL_CONFIG],
38 [AC_REQUIRE([PGAC_PATH_PERL])
39 AC_MSG_CHECKING([for Perl $1])
40 perl_$1=`$PERL -MConfig -e 'print $Config{$1}'`
42 AC_MSG_RESULT([$perl_$1])])
45 # PGAC_CHECK_PERL_CONFIGS(NAMES)
46 # ------------------------------
47 AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
48 [m4_foreach([pgac_item], [$1], [PGAC_CHECK_PERL_CONFIG(pgac_item)])])
51 # PGAC_CHECK_PERL_EMBED_LDFLAGS
52 # -----------------------------
53 # We are after Embed's ldopts, but without the subset mentioned in
54 # Config's ccdlflags; and also without any -arch flags, which recent
55 # Apple releases put in unhelpfully. (If you want a multiarch build
56 # you'd better be specifying it in more places than plperl's final link.)
57 AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
58 [AC_REQUIRE([PGAC_PATH_PERL])
59 AC_MSG_CHECKING(for flags to link embedded Perl)
60 pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
61 pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
62 perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
63 AC_SUBST(perl_embed_ldflags)dnl
64 if test -z "$perl_embed_ldflags" ; then
66 AC_MSG_ERROR([could not determine flags for linking embedded Perl.
67 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
70 AC_MSG_RESULT([$perl_embed_ldflags])
72 ])# PGAC_CHECK_PERL_EMBED_LDFLAGS