summaryrefslogtreecommitdiff
path: root/src/template
diff options
context:
space:
mode:
Diffstat (limited to 'src/template')
-rw-r--r--src/template/aix5
-rw-r--r--src/template/cygwin3
-rw-r--r--src/template/darwin3
-rw-r--r--src/template/freebsd3
-rw-r--r--src/template/hpux7
-rw-r--r--src/template/linux3
-rw-r--r--src/template/netbsd3
-rw-r--r--src/template/openbsd4
-rw-r--r--src/template/solaris9
-rw-r--r--src/template/win323
10 files changed, 43 insertions, 0 deletions
diff --git a/src/template/aix b/src/template/aix
index 999cd359457..cec240d27b9 100644
--- a/src/template/aix
+++ b/src/template/aix
@@ -1,3 +1,5 @@
+# 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
@@ -17,6 +19,9 @@ if test "$GCC" != yes ; then
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
diff --git a/src/template/cygwin b/src/template/cygwin
index b6ea0ded522..79a108145ff 100644
--- a/src/template/cygwin
+++ b/src/template/cygwin
@@ -2,6 +2,9 @@
SRCH_LIB="/usr/local/lib"
+# 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,
diff --git a/src/template/darwin b/src/template/darwin
index c05adca0bfb..f4d4e9d7cf8 100644
--- a/src/template/darwin
+++ b/src/template/darwin
@@ -16,6 +16,9 @@ if test x"$PG_SYSROOT" != x"" ; then
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
diff --git a/src/template/freebsd b/src/template/freebsd
index a82d5a494c9..41fa4a1aba1 100644
--- a/src/template/freebsd
+++ b/src/template/freebsd
@@ -4,3 +4,6 @@
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
index 79d3475664e..50fff80c530 100644
--- a/src/template/hpux
+++ b/src/template/hpux
@@ -8,6 +8,13 @@ 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
diff --git a/src/template/linux b/src/template/linux
index e39290845ad..ec3302c4a22 100644
--- a/src/template/linux
+++ b/src/template/linux
@@ -9,6 +9,9 @@ fi
# 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"
diff --git a/src/template/netbsd b/src/template/netbsd
index 198697723df..d97f995c748 100644
--- a/src/template/netbsd
+++ b/src/template/netbsd
@@ -1,2 +1,5 @@
# src/template/netbsd
# tools/thread/thread_test must be run
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL="-fPIC -DPIC"
diff --git a/src/template/openbsd b/src/template/openbsd
index e69de29bb2d..365268c4897 100644
--- a/src/template/openbsd
+++ 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
index e07b9a0a8d6..f88b1cdad37 100644
--- a/src/template/solaris
+++ b/src/template/solaris
@@ -1,3 +1,12 @@
+# 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
diff --git a/src/template/win32 b/src/template/win32
index 7da9719acbd..1380d16548c 100644
--- a/src/template/win32
+++ b/src/template/win32
@@ -1,5 +1,8 @@
# 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