2010-09-21 04:08:53 +08:00
|
|
|
# config/perl.m4
|
2001-08-27 06:28:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
# PGAC_PATH_PERL
|
|
|
|
# --------------
|
|
|
|
AC_DEFUN([PGAC_PATH_PERL],
|
2010-01-07 09:41:11 +08:00
|
|
|
[# Let the user override the search
|
|
|
|
if test -z "$PERL"; then
|
|
|
|
AC_PATH_PROG(PERL, perl)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$PERL"; then
|
2010-02-24 02:35:07 +08:00
|
|
|
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']`
|
2010-01-07 09:41:11 +08:00
|
|
|
AC_MSG_NOTICE([using perl $pgac_perl_version])
|
|
|
|
if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
|
2016-05-02 23:18:10 +08:00
|
|
|
$AWK '{ if ([$]1 == 5 && [$]2 >= 8) exit 1; else exit 0;}'
|
2010-01-07 09:41:11 +08:00
|
|
|
then
|
|
|
|
AC_MSG_WARN([
|
|
|
|
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
|
|
|
|
*** Perl version 5.8 or later is required, but this is $pgac_perl_version.])
|
|
|
|
PERL=""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$PERL"; then
|
|
|
|
AC_MSG_WARN([
|
2010-09-23 07:51:39 +08:00
|
|
|
*** Without Perl you will not be able to build PostgreSQL from Git.
|
2010-01-07 09:41:11 +08:00
|
|
|
*** You can obtain Perl from any CPAN mirror site.
|
2010-02-23 05:16:50 +08:00
|
|
|
*** (If you are using the official distribution of PostgreSQL then you do not
|
2010-01-07 09:41:11 +08:00
|
|
|
*** need to worry about this, because the Perl output is pre-generated.)])
|
|
|
|
fi
|
|
|
|
])# PGAC_PATH_PERL
|
2001-08-27 06:28:04 +08:00
|
|
|
|
|
|
|
|
2002-05-29 00:57:53 +08:00
|
|
|
# PGAC_CHECK_PERL_CONFIG(NAME)
|
|
|
|
# ----------------------------
|
|
|
|
AC_DEFUN([PGAC_CHECK_PERL_CONFIG],
|
|
|
|
[AC_REQUIRE([PGAC_PATH_PERL])
|
|
|
|
AC_MSG_CHECKING([for Perl $1])
|
|
|
|
perl_$1=`$PERL -MConfig -e 'print $Config{$1}'`
|
2013-01-10 06:49:23 +08:00
|
|
|
test "$PORTNAME" = "win32" && perl_$1=`echo $perl_$1 | sed 's,\\\\,/,g'`
|
2002-05-29 00:57:53 +08:00
|
|
|
AC_SUBST(perl_$1)dnl
|
|
|
|
AC_MSG_RESULT([$perl_$1])])
|
2001-08-27 06:28:04 +08:00
|
|
|
|
|
|
|
|
2002-05-29 00:57:53 +08:00
|
|
|
# PGAC_CHECK_PERL_CONFIGS(NAMES)
|
|
|
|
# ------------------------------
|
|
|
|
AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
|
|
|
|
[m4_foreach([pgac_item], [$1], [PGAC_CHECK_PERL_CONFIG(pgac_item)])])
|
2001-08-27 06:28:04 +08:00
|
|
|
|
2002-05-29 00:57:53 +08:00
|
|
|
|
|
|
|
# PGAC_CHECK_PERL_EMBED_LDFLAGS
|
|
|
|
# -----------------------------
|
2009-09-09 02:15:55 +08:00
|
|
|
# We are after Embed's ldopts, but without the subset mentioned in
|
|
|
|
# Config's ccdlflags; and also without any -arch flags, which recent
|
|
|
|
# Apple releases put in unhelpfully. (If you want a multiarch build
|
|
|
|
# you'd better be specifying it in more places than plperl's final link.)
|
2002-05-29 00:57:53 +08:00
|
|
|
AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
|
|
|
|
[AC_REQUIRE([PGAC_PATH_PERL])
|
|
|
|
AC_MSG_CHECKING(for flags to link embedded Perl)
|
2013-01-10 06:49:23 +08:00
|
|
|
if test "$PORTNAME" = "win32" ; then
|
|
|
|
perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
|
|
|
|
test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
|
|
|
|
else
|
2002-05-29 00:57:53 +08:00
|
|
|
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
|
|
|
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
2009-09-09 02:15:55 +08:00
|
|
|
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
|
2013-01-10 06:49:23 +08:00
|
|
|
fi
|
2002-05-29 00:57:53 +08:00
|
|
|
AC_SUBST(perl_embed_ldflags)dnl
|
2008-11-12 08:00:05 +08:00
|
|
|
if test -z "$perl_embed_ldflags" ; then
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_ERROR([could not determine flags for linking embedded Perl.
|
|
|
|
This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
|
|
|
|
installed.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([$perl_embed_ldflags])
|
|
|
|
fi
|
|
|
|
])# PGAC_CHECK_PERL_EMBED_LDFLAGS
|