aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/tcl.m413
-rwxr-xr-xconfigure20
-rw-r--r--configure.in11
-rw-r--r--contrib/hstore_plperl/Makefile2
-rw-r--r--src/Makefile.global.in1
-rw-r--r--src/pl/plperl/GNUmakefile2
-rw-r--r--src/template/darwin12
7 files changed, 55 insertions, 6 deletions
diff --git a/config/tcl.m4 b/config/tcl.m4
index a4bf231947f..581471f3384 100644
--- a/config/tcl.m4
+++ b/config/tcl.m4
@@ -13,6 +13,10 @@ fi
# PGAC_PATH_TCLCONFIGSH([SEARCH-PATH])
# ------------------------------------
+# If the user doesn't specify $TCL_CONFIG_SH directly, search for it in
+# the list of directories passed as parameter (from --with-tclconfig).
+# If no list is given, try the Tcl shell's $auto_path.
+
AC_DEFUN([PGAC_PATH_TCLCONFIGSH],
[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
AC_BEFORE([$0], [PGAC_PATH_TKCONFIGSH])[]dnl
@@ -24,7 +28,14 @@ if test -z "$TCL_CONFIG_SH"; then
set X $pgac_test_dirs; shift
if test $[#] -eq 0; then
test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tclConfig.sh because no Tcl shell was found])
- set X `echo 'puts $auto_path' | $TCLSH`; shift
+ pgac_test_dirs=`echo 'puts $auto_path' | $TCLSH`
+ # On newer macOS, $auto_path frequently doesn't include the place
+ # where tclConfig.sh actually lives. Append that to the end, so as not
+ # to break cases where a non-default Tcl installation is being used.
+ if test -d "$PG_SYSROOT/System/Library/Frameworks/Tcl.framework" ; then
+ pgac_test_dirs="$pgac_test_dirs $PG_SYSROOT/System/Library/Frameworks/Tcl.framework"
+ fi
+ set X $pgac_test_dirs; shift
fi
for pgac_dir do
diff --git a/configure b/configure
index 0c3bf1a5d87..37c028e6f78 100755
--- a/configure
+++ b/configure
@@ -669,6 +669,7 @@ python_majorversion
PYTHON
perl_embed_ldflags
perl_embed_ccflags
+perl_includedir
perl_useshrplib
perl_privlibexp
perl_archlibexp
@@ -7971,6 +7972,14 @@ You might have to rebuild your Perl installation. Refer to the
documentation for details. Use --without-perl to disable building
PL/Perl." "$LINENO" 5
fi
+ # On most platforms, archlibexp is also where the Perl include files live ...
+ perl_includedir="$perl_archlibexp"
+ # ... but on some macOS versions, we must look under $PG_SYSROOT instead
+ if test x"$PG_SYSROOT" != x"" ; then
+ if test -d "$PG_SYSROOT$perl_archlibexp" ; then
+ perl_includedir="$PG_SYSROOT$perl_archlibexp"
+ fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS recommended by Perl" >&5
$as_echo_n "checking for CFLAGS recommended by Perl... " >&6; }
@@ -16161,7 +16170,14 @@ if test -z "$TCL_CONFIG_SH"; then
set X $pgac_test_dirs; shift
if test $# -eq 0; then
test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
- set X `echo 'puts $auto_path' | $TCLSH`; shift
+ pgac_test_dirs=`echo 'puts $auto_path' | $TCLSH`
+ # On newer macOS, $auto_path frequently doesn't include the place
+ # where tclConfig.sh actually lives. Append that to the end, so as not
+ # to break cases where a non-default Tcl installation is being used.
+ if test -d "$PG_SYSROOT/System/Library/Frameworks/Tcl.framework" ; then
+ pgac_test_dirs="$pgac_test_dirs $PG_SYSROOT/System/Library/Frameworks/Tcl.framework"
+ fi
+ set X $pgac_test_dirs; shift
fi
for pgac_dir do
@@ -16210,7 +16226,7 @@ fi
# check for <perl.h>
if test "$with_perl" = yes; then
ac_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
+ CPPFLAGS="$CPPFLAGS -I$perl_includedir/CORE"
ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
"
if test "x$ac_cv_header_perl_h" = xyes; then :
diff --git a/configure.in b/configure.in
index 119d8d882f1..ffac14af4cd 100644
--- a/configure.in
+++ b/configure.in
@@ -968,6 +968,15 @@ You might have to rebuild your Perl installation. Refer to the
documentation for details. Use --without-perl to disable building
PL/Perl.])
fi
+ # On most platforms, archlibexp is also where the Perl include files live ...
+ perl_includedir="$perl_archlibexp"
+ # ... but on some macOS versions, we must look under $PG_SYSROOT instead
+ if test x"$PG_SYSROOT" != x"" ; then
+ if test -d "$PG_SYSROOT$perl_archlibexp" ; then
+ perl_includedir="$PG_SYSROOT$perl_archlibexp"
+ fi
+ fi
+ AC_SUBST(perl_includedir)dnl
PGAC_CHECK_PERL_EMBED_CCFLAGS
PGAC_CHECK_PERL_EMBED_LDFLAGS
fi
@@ -2103,7 +2112,7 @@ fi
# check for <perl.h>
if test "$with_perl" = yes; then
ac_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
+ CPPFLAGS="$CPPFLAGS -I$perl_includedir/CORE"
AC_CHECK_HEADER(perl.h, [], [AC_MSG_ERROR([header file <perl.h> is required for Perl])],
[#include <EXTERN.h>])
# While we're at it, check that we can link to libperl.
diff --git a/contrib/hstore_plperl/Makefile b/contrib/hstore_plperl/Makefile
index f63cba27456..194424716a6 100644
--- a/contrib/hstore_plperl/Makefile
+++ b/contrib/hstore_plperl/Makefile
@@ -38,4 +38,4 @@ endif
# last, probably because it sometimes contains some header files with names
# that clash with some of ours, or with some that we include, notably on
# Windows.
-override CPPFLAGS := $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_archlibexp)/CORE
+override CPPFLAGS := $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_includedir)/CORE
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index d1b8e4fedee..b549212c021 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -313,6 +313,7 @@ else
endif
perl_archlibexp = @perl_archlibexp@
perl_privlibexp = @perl_privlibexp@
+perl_includedir = @perl_includedir@
perl_embed_ccflags = @perl_embed_ccflags@
perl_embed_ldflags = @perl_embed_ldflags@
diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile
index 191f74067a6..d1c84279a6a 100644
--- a/src/pl/plperl/GNUmakefile
+++ b/src/pl/plperl/GNUmakefile
@@ -16,7 +16,7 @@ endif
# probably because it sometimes contains some header files with names
# that clash with some of ours, or with some that we include, notably on
# Windows.
-override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_archlibexp)/CORE
+override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_includedir)/CORE
rpathdir = $(perl_archlibexp)/CORE
diff --git a/src/template/darwin b/src/template/darwin
index ea6d3b0b042..cff258be26b 100644
--- a/src/template/darwin
+++ b/src/template/darwin
@@ -3,6 +3,18 @@
# Note: Darwin is the original code name for macOS, also known as OS X.
# We still use "darwin" as the port name, partly because config.guess does.
+# Select where system include files should be sought.
+if test x"$PG_SYSROOT" = x"" ; then
+ PG_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
+fi
+if test x"$PG_SYSROOT" != x"" ; then
+ if test -d "$PG_SYSROOT" ; then
+ CPPFLAGS="$CPPFLAGS -isysroot $PG_SYSROOT"
+ else
+ PG_SYSROOT=""
+ fi
+fi
+
# Select appropriate semaphore support. Darwin 6.0 (macOS 10.2) and up
# support System V semaphores; before that we have to use named POSIX
# semaphores, which are less good for our purposes because they eat a