OSDN Git Service

Revert "Don't select log_cnt in sequence regression tests."
[pg-rex/syncrep.git] / config / perl.m4
1 # config/perl.m4
2
3
4 # PGAC_PATH_PERL
5 # --------------
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)
10 fi
11
12 if test "$PERL"; then
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;}'
17   then
18     AC_MSG_WARN([
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.])
21     PERL=""
22   fi
23 fi
24
25 if test -z "$PERL"; then
26   AC_MSG_WARN([
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.)])
31 fi
32 ])# PGAC_PATH_PERL
33
34
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}'`
41 AC_SUBST(perl_$1)dnl
42 AC_MSG_RESULT([$perl_$1])])
43
44
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)])])
49
50
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
65         AC_MSG_RESULT(no)
66         AC_MSG_ERROR([could not determine flags for linking embedded Perl.
67 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
68 installed.])
69 else
70         AC_MSG_RESULT([$perl_embed_ldflags])
71 fi
72 ])# PGAC_CHECK_PERL_EMBED_LDFLAGS