summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/python.m44
-rwxr-xr-xconfigure14
-rw-r--r--configure.ac7
-rw-r--r--src/Makefile.global.in2
-rw-r--r--src/backend/jit/Makefile2
-rw-r--r--src/backend/utils/fmgr/Makefile2
-rw-r--r--src/backend/utils/fmgr/dfmgr.c5
-rw-r--r--src/bin/pg_upgrade/Makefile2
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/port/win32_port.h3
-rw-r--r--src/interfaces/ecpg/test/Makefile1
-rw-r--r--src/makefiles/Makefile.aix1
-rw-r--r--src/makefiles/Makefile.cygwin1
-rw-r--r--src/makefiles/Makefile.darwin2
-rw-r--r--src/makefiles/Makefile.freebsd2
-rw-r--r--src/makefiles/Makefile.hpux6
-rw-r--r--src/makefiles/Makefile.linux2
-rw-r--r--src/makefiles/Makefile.netbsd2
-rw-r--r--src/makefiles/Makefile.openbsd2
-rw-r--r--src/makefiles/Makefile.solaris2
-rw-r--r--src/makefiles/Makefile.win321
-rw-r--r--src/template/cygwin2
-rw-r--r--src/template/hpux7
-rw-r--r--src/template/win322
-rw-r--r--src/test/regress/GNUmakefile3
-rw-r--r--src/tools/msvc/Solution.pm1
26 files changed, 42 insertions, 39 deletions
diff --git a/config/python.m4 b/config/python.m4
index 52f34070dd..e500873ff3 100644
--- a/config/python.m4
+++ b/config/python.m4
@@ -120,7 +120,9 @@ else
found_shlib=0
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
- # We don't know the platform DLSUFFIX here, so check 'em all.
+ # Note: DLSUFFIX is for loadable modules, not shared
+ # libraries, so cannot be used here portably. Just
+ # check all known possibilities.
for e in .so .dll .dylib .sl; do
if test -e "$d/lib${ldlibrary}$e"; then
python_libdir="$d"
diff --git a/configure b/configure
index e066cbe2c8..8b361e211b 100755
--- a/configure
+++ b/configure
@@ -734,6 +734,7 @@ autodepend
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
+DLSUFFIX
TAS
GCC
CPP
@@ -3033,6 +3034,9 @@ PORTNAME=$template
need_tas=no
tas_file=dummy.s
+# Default, works for most platforms, override in template file if needed
+DLSUFFIX=".so"
+
##
@@ -7688,6 +7692,12 @@ else
fi
+
+cat >>confdefs.h <<_ACEOF
+#define DLSUFFIX "$DLSUFFIX"
+_ACEOF
+
+
#
# Set up pkg_config in case we need it below
#
@@ -10560,7 +10570,9 @@ else
found_shlib=0
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
- # We don't know the platform DLSUFFIX here, so check 'em all.
+ # Note: DLSUFFIX is for loadable modules, not shared
+ # libraries, so cannot be used here portably. Just
+ # check all known possibilities.
for e in .so .dll .dylib .sl; do
if test -e "$d/lib${ldlibrary}$e"; then
python_libdir="$d"
diff --git a/configure.ac b/configure.ac
index 078381e568..68ade8f7a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,6 +103,9 @@ AC_SUBST(PORTNAME)
need_tas=no
tas_file=dummy.s
+# Default, works for most platforms, override in template file if needed
+DLSUFFIX=".so"
+
##
@@ -721,6 +724,10 @@ else
fi
AC_SUBST(TAS)
+AC_SUBST(DLSUFFIX)dnl
+AC_DEFINE_UNQUOTED([DLSUFFIX], ["$DLSUFFIX"],
+ [Define to the file name extension of dynamically-loadable modules.])
+
#
# Set up pkg_config in case we need it below
#
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index bbdc1c4bda..0726b2020f 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -545,6 +545,8 @@ WIN32_STACK_RLIMIT=4194304
# Set if we have a working win32 crashdump header
have_win32_dbghelp = @have_win32_dbghelp@
+DLSUFFIX = @DLSUFFIX@
+
# Pull in platform-specific magic
include $(top_builddir)/src/Makefile.port
diff --git a/src/backend/jit/Makefile b/src/backend/jit/Makefile
index a895ebac5f..a9a603e639 100644
--- a/src/backend/jit/Makefile
+++ b/src/backend/jit/Makefile
@@ -15,8 +15,6 @@ subdir = src/backend/jit
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
-
OBJS = \
jit.o
diff --git a/src/backend/utils/fmgr/Makefile b/src/backend/utils/fmgr/Makefile
index f552b95ca9..ceffb807fb 100644
--- a/src/backend/utils/fmgr/Makefile
+++ b/src/backend/utils/fmgr/Makefile
@@ -17,6 +17,4 @@ OBJS = \
fmgr.o \
funcapi.o
-override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
-
include $(top_srcdir)/src/backend/common.mk
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 050da78080..3774f33e0e 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -483,11 +483,6 @@ file_exists(const char *name)
}
-/* Example format: ".so" */
-#ifndef DLSUFFIX
-#error "DLSUFFIX must be defined to compile this file."
-#endif
-
/*
* If name contains a slash, check if the file exists, if so return
* the name. Else (no slash) try to expand using search path (see
diff --git a/src/bin/pg_upgrade/Makefile b/src/bin/pg_upgrade/Makefile
index 49b94f0ac7..7a3225b27c 100644
--- a/src/bin/pg_upgrade/Makefile
+++ b/src/bin/pg_upgrade/Makefile
@@ -25,7 +25,7 @@ OBJS = \
util.o \
version.o
-override CPPFLAGS := -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
all: pg_upgrade
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 635fbb2181..9e2ca83993 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -42,6 +42,9 @@
/* Define to the default TCP port number as a string constant. */
#undef DEF_PGPORT_STR
+/* Define to the file name extension of dynamically-loadable modules. */
+#undef DLSUFFIX
+
/* Define to build with GSSAPI support. (--with-gssapi) */
#undef ENABLE_GSS
diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h
index d3cb765976..4bb6fc5e1e 100644
--- a/src/include/port/win32_port.h
+++ b/src/include/port/win32_port.h
@@ -529,9 +529,6 @@ typedef unsigned short mode_t;
#define W_OK 2
#define R_OK 4
-/* Pulled from Makefile.port in MinGW */
-#define DLSUFFIX ".dll"
-
#endif /* _MSC_VER */
#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || \
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index be53b7b94d..10f53c708c 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -12,7 +12,6 @@ override CPPFLAGS := \
'-I$(top_srcdir)/src/test/regress' \
'-DHOST_TUPLE="$(host_tuple)"' \
'-DSHELLPROG="$(SHELL)"' \
- '-DDLSUFFIX="$(DLSUFFIX)"' \
$(CPPFLAGS)
# default encoding for regression tests
diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix
index ba3695dd57..84f26b49b8 100644
--- a/src/makefiles/Makefile.aix
+++ b/src/makefiles/Makefile.aix
@@ -14,7 +14,6 @@ else
rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
endif
-DLSUFFIX = .so
ifeq ($(host_os), aix3.2.5)
ifneq ($(GCC), yes)
LDFLAGS_SL += -e _nostart -H512 -bM:SRE
diff --git a/src/makefiles/Makefile.cygwin b/src/makefiles/Makefile.cygwin
index 81089d6257..6afa9a06a1 100644
--- a/src/makefiles/Makefile.cygwin
+++ b/src/makefiles/Makefile.cygwin
@@ -11,7 +11,6 @@ endif
LIBS:=$(filter-out -lm -lc, $(LIBS))
AROPT = crs
-DLSUFFIX = .dll
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin
index b17598f058..4fc81c1584 100644
--- a/src/makefiles/Makefile.darwin
+++ b/src/makefiles/Makefile.darwin
@@ -1,7 +1,5 @@
AROPT = crs
-DLSUFFIX = .so
-
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = DYLD_LIBRARY_PATH
diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd
index 75db21ba14..0e77616b0f 100644
--- a/src/makefiles/Makefile.freebsd
+++ b/src/makefiles/Makefile.freebsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-export-dynamic
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# extra stuff for $(with_temp_install)
# we need this to get LD_LIBRARY_PATH searched ahead of the compiled-in
# rpath, if no DT_RUNPATH is present in the executable. The conditions
diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux
index 7e18770d89..25e036bd8d 100644
--- a/src/makefiles/Makefile.hpux
+++ b/src/makefiles/Makefile.hpux
@@ -25,12 +25,6 @@ INSTALL_SHLIB_OPTS = -m 555
AROPT = crs
-ifeq ($(host_cpu), ia64)
- DLSUFFIX = .so
-else
- DLSUFFIX = .sl
-endif
-
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = SHLIB_PATH
diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux
index 645f73aa2b..1ffec9d169 100644
--- a/src/makefiles/Makefile.linux
+++ b/src/makefiles/Makefile.linux
@@ -5,8 +5,6 @@ export_dynamic = -Wl,-E
# This allows LD_LIBRARY_PATH to still work when needed.
rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd
index 6f9cb1d45d..421b735e40 100644
--- a/src/makefiles/Makefile.netbsd
+++ b/src/makefiles/Makefile.netbsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-E
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd
index 6f9cb1d45d..421b735e40 100644
--- a/src/makefiles/Makefile.openbsd
+++ b/src/makefiles/Makefile.openbsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-E
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris
index 62a6c01c3a..5496edcafc 100644
--- a/src/makefiles/Makefile.solaris
+++ b/src/makefiles/Makefile.solaris
@@ -9,8 +9,6 @@ else
rpath = -Wl,-R'$(rpathdir)'
endif
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.win32 b/src/makefiles/Makefile.win32
index e72cb2db0e..17d6819644 100644
--- a/src/makefiles/Makefile.win32
+++ b/src/makefiles/Makefile.win32
@@ -11,7 +11,6 @@ endif
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
AROPT = crs
-DLSUFFIX = .dll
ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir)))
diff --git a/src/template/cygwin b/src/template/cygwin
index 1e7274bc33..3f42e2f8b6 100644
--- a/src/template/cygwin
+++ b/src/template/cygwin
@@ -13,3 +13,5 @@ CFLAGS_SL=""
# 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/hpux b/src/template/hpux
index 50fff80c53..5105a74c78 100644
--- a/src/template/hpux
+++ b/src/template/hpux
@@ -25,3 +25,10 @@ case $host in
fi
;;
esac
+
+case $host_cpu in
+ ia64)
+ DLSUFFIX=".so";;
+ *)
+ DLSUFFIX=".sl";;
+esac
diff --git a/src/template/win32 b/src/template/win32
index 1380d16548..1895f067a8 100644
--- a/src/template/win32
+++ b/src/template/win32
@@ -7,3 +7,5 @@ CFLAGS_SL=""
# 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"
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index b40361c84c..88b82d9268 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -25,8 +25,7 @@ endif
# stuff to pass into build of pg_regress
EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
- '-DSHELLPROG="$(SHELL)"' \
- '-DDLSUFFIX="$(DLSUFFIX)"'
+ '-DSHELLPROG="$(SHELL)"'
##
## Prepare for tests
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a21ea9bef9..ef5476d034 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -216,6 +216,7 @@ sub GenerateFiles
CONFIGURE_ARGS => '"' . $self->GetFakeConfigure() . '"',
DEF_PGPORT => $port,
DEF_PGPORT_STR => qq{"$port"},
+ DLSUFFIX => '".dll"',
ENABLE_GSS => $self->{options}->{gss} ? 1 : undef,
ENABLE_NLS => $self->{options}->{nls} ? 1 : undef,
ENABLE_THREAD_SAFETY => 1,