summaryrefslogtreecommitdiffstats
path: root/src/template
diff options
context:
space:
mode:
Diffstat (limited to 'src/template')
-rw-r--r--src/template/aix28
-rw-r--r--src/template/cygwin17
-rw-r--r--src/template/darwin57
-rw-r--r--src/template/freebsd9
-rw-r--r--src/template/hpux34
-rw-r--r--src/template/linux39
-rw-r--r--src/template/netbsd13
-rw-r--r--src/template/openbsd4
-rw-r--r--src/template/solaris31
-rw-r--r--src/template/win3211
10 files changed, 243 insertions, 0 deletions
diff --git a/src/template/aix b/src/template/aix
new file mode 100644
index 0000000..cec240d
--- /dev/null
+++ b/src/template/aix
@@ -0,0 +1,28 @@
+# src/template/aix
+
+# Set default options if using xlc. This formerly included -qsrcmsg, but that
+# option elicits internal compiler errors from xlc v16.1.0. Note: configure
+# will add -qnoansialias if the compiler accepts it, even if user specifies a
+# non-default CFLAGS setting.
+if test "$GCC" != yes ; then
+ case $host_os in
+ aix3.2.5 | aix4.1*)
+ CFLAGS="-O -qmaxmem=16384"
+ ;;
+ *)
+ CFLAGS="-O2 -qmaxmem=16384"
+ ;;
+ esac
+
+ # Due to a compiler bug, see 20171013023536.GA492146@rfd.leadboat.com for details,
+ # force restrict not to be used when compiling with xlc.
+ FORCE_DISABLE_RESTRICT=yes
+fi
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL=""
+
+# Native memset() is faster, tested on:
+# AIX 5.1 and 5.2, XLC 6.0 (IBM's cc)
+# AIX 5.3 ML3, gcc 4.0.1
+MEMSET_LOOP_LIMIT=0
diff --git a/src/template/cygwin b/src/template/cygwin
new file mode 100644
index 0000000..3f42e2f
--- /dev/null
+++ b/src/template/cygwin
@@ -0,0 +1,17 @@
+# src/template/cygwin
+
+SRCH_LIB="/usr/local/lib"
+
+# This is required for ppoll(2), and perhaps other things
+CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL=""
+
+# --allow-multiple-definition is required to link pg_dump because it finds
+# pg_toupper() etc. in both libpq and pgport
+# we'd prefer to use --disable-auto-import to match MSVC linking behavior,
+# but support for it in Cygwin is too haphazard
+LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition -Wl,--enable-auto-import"
+
+DLSUFFIX=".dll"
diff --git a/src/template/darwin b/src/template/darwin
new file mode 100644
index 0000000..e14d53b
--- /dev/null
+++ b/src/template/darwin
@@ -0,0 +1,57 @@
+# 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, if user didn't say.
+if test x"$PG_SYSROOT" = x"" ; then
+ # This is far more complicated than it ought to be. We first ask
+ # "xcrun --show-sdk-path", which seems to match the default -isysroot
+ # setting of Apple's compilers.
+ PG_SYSROOT=`xcrun --show-sdk-path 2>/dev/null`
+ # That may fail, or produce a result that is not version-specific (i.e.,
+ # just ".../SDKs/MacOSX.sdk"). Using a version-specific sysroot seems
+ # desirable, so if the path is a non-version-specific symlink, expand it.
+ if test -L "$PG_SYSROOT"; then
+ if expr x"$PG_SYSROOT" : '.*[0-9]\.[0-9][^/]*$' >/dev/null ; then : okay
+ else
+ PG_SYSROOT=`expr "$PG_SYSROOT" : '\(.*\)/'`/`readlink "$PG_SYSROOT"`
+ fi
+ fi
+ # If there are still not digits in the directory name, try
+ # "xcrun --sdk macosx --show-sdk-path"; and if that still doesn't work,
+ # fall back to asking xcodebuild, which is often a good deal slower.
+ if expr x"$PG_SYSROOT" : '.*[0-9]\.[0-9][^/]*$' >/dev/null ; then : okay
+ else
+ PG_SYSROOT=`xcrun --sdk macosx --show-sdk-path 2>/dev/null`
+ if expr x"$PG_SYSROOT" : '.*[0-9]\.[0-9][^/]*$' >/dev/null ; then : okay
+ else
+ PG_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
+ fi
+ fi
+fi
+# Validate the result: if it doesn't point at a directory, ignore it.
+if test x"$PG_SYSROOT" != x"" ; then
+ if test -d "$PG_SYSROOT" ; then
+ CPPFLAGS="-isysroot $PG_SYSROOT $CPPFLAGS"
+ LDFLAGS="-isysroot $PG_SYSROOT $LDFLAGS"
+ else
+ PG_SYSROOT=""
+ fi
+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
diff --git a/src/template/freebsd b/src/template/freebsd
new file mode 100644
index 0000000..41fa4a1
--- /dev/null
+++ b/src/template/freebsd
@@ -0,0 +1,9 @@
+# src/template/freebsd
+
+# Prefer unnamed POSIX semaphores if available, unless user overrides choice
+if test x"$PREFERRED_SEMAPHORES" = x"" ; then
+ PREFERRED_SEMAPHORES=UNNAMED_POSIX
+fi
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL="-fPIC -DPIC"
diff --git a/src/template/hpux b/src/template/hpux
new file mode 100644
index 0000000..5105a74
--- /dev/null
+++ b/src/template/hpux
@@ -0,0 +1,34 @@
+# src/template/hpux
+
+# Need this for access to many modern library features
+CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
+
+# HP's compiler likes the spelling +O2 not -O2, so adjust default CFLAGS
+if test "$GCC" != yes ; then
+ CFLAGS="+O2"
+fi
+
+# Extra CFLAGS for code that will go into a shared library
+if test "$GCC" = yes ; then
+ CFLAGS_SL="-fPIC"
+else
+ CFLAGS_SL="+Z"
+fi
+
+# Pick right test-and-set (TAS) code. We need out-of-line assembler
+# when not using gcc.
+case $host in
+ hppa*-*-hpux*)
+ if test "$GCC" != yes ; then
+ need_tas=yes
+ tas_file=hpux_hppa.s
+ fi
+ ;;
+esac
+
+case $host_cpu in
+ ia64)
+ DLSUFFIX=".so";;
+ *)
+ DLSUFFIX=".sl";;
+esac
diff --git a/src/template/linux b/src/template/linux
new file mode 100644
index 0000000..ec3302c
--- /dev/null
+++ b/src/template/linux
@@ -0,0 +1,39 @@
+# src/template/linux
+
+# Prefer unnamed POSIX semaphores if available, unless user overrides choice
+if test x"$PREFERRED_SEMAPHORES" = x"" ; then
+ PREFERRED_SEMAPHORES=UNNAMED_POSIX
+fi
+
+# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
+# This is also required for ppoll(2), and perhaps other things
+CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL="-fPIC"
+
+# If --enable-profiling is specified, we need -DLINUX_PROFILE
+PLATFORM_PROFILE_FLAGS="-DLINUX_PROFILE"
+
+if test "$SUN_STUDIO_CC" = "yes" ; then
+ CC="$CC -Xa" # relaxed ISO C mode
+ CFLAGS="-v" # -v is like gcc -Wall
+ if test "$enable_debug" != yes; then
+ CFLAGS="$CFLAGS -O" # any optimization breaks debug
+ fi
+
+ # Pick the right test-and-set (TAS) code for the Sun compiler.
+ # We would like to use in-line assembler, but the compiler
+ # requires *.il files to be on every compile line, making
+ # the build system too fragile.
+ case $host_cpu in
+ sparc)
+ need_tas=yes
+ tas_file=sunstudio_sparc.s
+ ;;
+ i?86|x86_64)
+ need_tas=yes
+ tas_file=sunstudio_x86.s
+ ;;
+ esac
+fi
diff --git a/src/template/netbsd b/src/template/netbsd
new file mode 100644
index 0000000..550e8f0
--- /dev/null
+++ b/src/template/netbsd
@@ -0,0 +1,13 @@
+# src/template/netbsd
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL="-fPIC -DPIC"
+
+# We must resolve all dynamic linking in the core server at program start.
+# Otherwise the postmaster can self-deadlock due to signals interrupting
+# resolution of calls, since NetBSD's linker takes a lock while doing that and
+# some postmaster signal handlers do things that will also acquire that lock.
+# As long as we need "-z now", might as well specify "-z relro" too.
+# While there's not a hard reason to adopt these settings for our other
+# executables, there's also little reason not to, so just add them to LDFLAGS.
+LDFLAGS="$LDFLAGS -Wl,-z,now -Wl,-z,relro"
diff --git a/src/template/openbsd b/src/template/openbsd
new file mode 100644
index 0000000..365268c
--- /dev/null
+++ b/src/template/openbsd
@@ -0,0 +1,4 @@
+# src/template/openbsd
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL="-fPIC -DPIC"
diff --git a/src/template/solaris b/src/template/solaris
new file mode 100644
index 0000000..f88b1cd
--- /dev/null
+++ b/src/template/solaris
@@ -0,0 +1,31 @@
+# src/template/solaris
+
+# Extra CFLAGS for code that will go into a shared library
+if test "$GCC" = yes ; then
+ CFLAGS_SL="-fPIC"
+else
+ CFLAGS_SL="-KPIC"
+fi
+
+if test "$SUN_STUDIO_CC" = yes ; then
+ CC="$CC -Xa" # relaxed ISO C mode
+ CFLAGS="-v" # -v is like gcc -Wall
+ if test "$enable_debug" != yes; then
+ CFLAGS="$CFLAGS -O" # any optimization breaks debug
+ fi
+
+ # Pick the right test-and-set (TAS) code for the Sun compiler.
+ # We would like to use in-line assembler, but the compiler
+ # requires *.il files to be on every compile line, making
+ # the build system too fragile.
+ case $host_cpu in
+ sparc)
+ need_tas=yes
+ tas_file=sunstudio_sparc.s
+ ;;
+ i?86|x86_64)
+ need_tas=yes
+ tas_file=sunstudio_x86.s
+ ;;
+ esac
+fi
diff --git a/src/template/win32 b/src/template/win32
new file mode 100644
index 0000000..1895f06
--- /dev/null
+++ b/src/template/win32
@@ -0,0 +1,11 @@
+# src/template/win32
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL=""
+
+# --allow-multiple-definition is required to link pg_dump because it finds
+# pg_toupper() etc. in both libpq and pgport
+# --disable-auto-import is to ensure we get MSVC-like linking behavior
+LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition -Wl,--disable-auto-import"
+
+DLSUFFIX=".dll"