summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-01-09 19:41:37 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2013-01-09 19:41:37 -0500
commit1f3ed51f8e197e9bbf18737a1aa1148ed730f7d8 (patch)
tree229ee8809d73c788b92fc42c46f6b833abc8e12f /configure
parent7fb97ecd137a879831ec6e3dce14c9f2e2a3d6b5 (diff)
downloadpostgresql-1f3ed51f8e197e9bbf18737a1aa1148ed730f7d8.tar.gz
Add explicit configure-time checks for perl.h and libperl.so.
Although most platforms seem to package Perl in such a way that these files are present even in basic Perl installations, Debian does not. Hence, make an effort to fail during configure rather than build if --with-perl was given and these files are lacking. Per gripe from Josh Berkus.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure125
1 files changed, 125 insertions, 0 deletions
diff --git a/configure b/configure
index 13dad004db..a20dc3e734 100755
--- a/configure
+++ b/configure
@@ -29124,6 +29124,131 @@ fi
CPPFLAGS=$ac_save_CPPFLAGS
fi
+# check for <perl.h>
+if test "$with_perl" = yes; then
+ ac_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="-I$perl_archlibexp/CORE $CPPFLAGS"
+ { $as_echo "$as_me:$LINENO: checking for perl.h" >&5
+$as_echo_n "checking for perl.h... " >&6; }
+if test "${ac_cv_header_perl_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <EXTERN.h>
+
+#include <perl.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_perl_h=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_perl_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_perl_h" >&5
+$as_echo "$ac_cv_header_perl_h" >&6; }
+if test "x$ac_cv_header_perl_h" = x""yes; then
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: header file <perl.h> is required for Perl" >&5
+$as_echo "$as_me: error: header file <perl.h> is required for Perl" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+ # While we're at it, check that we can link to libperl.
+ # On most platforms, if perl.h is there then libperl.so will be too, but at
+ # this writing Debian packages them separately. There is no known reason to
+ # waste cycles on separate probes for the Tcl or Python libraries, though.
+ pgac_save_LIBS=$LIBS
+ LIBS="$perl_embed_ldflags $LIBS"
+ { $as_echo "$as_me:$LINENO: checking for libperl" >&5
+$as_echo_n "checking for libperl... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <EXTERN.h>
+#include <perl.h>
+
+int
+main ()
+{
+perl_alloc();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:$LINENO: error: libperl library is required for Perl" >&5
+$as_echo "$as_me: error: libperl library is required for Perl" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$pgac_save_LIBS
+ CPPFLAGS=$ac_save_CPPFLAGS
+fi
+
# check for <Python.h>
if test "$with_python" = yes; then
ac_save_CPPFLAGS=$CPPFLAGS