blob: 020b4bde84b182ae0edd3f2710ebe036a0083a8b [file]
# src/template/darwin
# 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
PG_SYSROOT=`${srcdir}/src/tools/darwin_sysroot $PG_SYSROOT`
if test -d "$PG_SYSROOT" ; then
CPPFLAGS="-isysroot $PG_SYSROOT $CPPFLAGS"
LDFLAGS="-isysroot $PG_SYSROOT $LDFLAGS"
fi
# Extra CFLAGS for code that will go into a shared library
CFLAGS_SL=""
# 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
# file descriptor per backend per max_connection slot.
case $host_os in
darwin[015].*)
USE_NAMED_POSIX_SEMAPHORES=1
;;
*)
USE_SYSV_SEMAPHORES=1
;;
esac
# PG 16 upstream (b55f62abb2c) unified DLSUFFIX to .dylib on macOS.
# Cloudberry's catalog SQL and cdb_init.d scripts (and many test
# expected files) hard-code "$libdir/foo.so" — when PG sees an
# explicit suffix it does NOT re-append DLSUFFIX, so .so / .dylib
# divergence breaks the catalog bootstrap. Keep the pre-PG16
# behaviour of DLSUFFIX=.so so all those references continue to
# resolve. The Python-shared-library check below is patched in
# configure to try .dylib as a fallback for macOS's libpython.
DLSUFFIX=".so"