diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-10-21 12:32:36 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-10-21 12:32:36 -0400 |
commit | 11330c311a1770447b76d42f20ede68d28e0ee87 (patch) | |
tree | 0c6002bafa0bc764aa84e3efdfa23ac88d4b3bdb /src/makefiles | |
parent | 62e881946c4d15f779808991f97ea379263a591d (diff) | |
download | postgresql-11330c311a1770447b76d42f20ede68d28e0ee87.tar.gz |
Select CFLAGS_SL at configure time, not in platform-specific Makefiles.
Move the platform-dependent logic that sets CFLAGS_SL from
src/makefiles/Makefile.foo to src/template/foo, so that the value
is determined at configure time and thus is available while running
configure's tests.
On a couple of platforms this might save a few microseconds of build
time by eliminating a test that make otherwise has to do over and over.
Otherwise it's pretty much a wash for build purposes; in particular,
this makes no difference to anyone who might be overriding CFLAGS_SL
via a make option.
This patch in itself does nothing with the value and thus should not
change any behavior, though you'll probably have to re-run configure
to get a correctly updated Makefile.global. We'll use the new
configure variable in a follow-on patch.
Per gripe from Kyotaro Horiguchi. Back-patch to all supported branches,
because the follow-on patch is a portability bug fix.
Discussion: https://postgr.es/m/20191010.144533.263180400.horikyota.ntt@gmail.com
Diffstat (limited to 'src/makefiles')
-rw-r--r-- | src/makefiles/Makefile.cygwin | 1 | ||||
-rw-r--r-- | src/makefiles/Makefile.freebsd | 2 | ||||
-rw-r--r-- | src/makefiles/Makefile.hpux | 5 | ||||
-rw-r--r-- | src/makefiles/Makefile.linux | 2 | ||||
-rw-r--r-- | src/makefiles/Makefile.netbsd | 2 | ||||
-rw-r--r-- | src/makefiles/Makefile.openbsd | 2 | ||||
-rw-r--r-- | src/makefiles/Makefile.sco | 6 | ||||
-rw-r--r-- | src/makefiles/Makefile.solaris | 6 | ||||
-rw-r--r-- | src/makefiles/Makefile.unixware | 6 | ||||
-rw-r--r-- | src/makefiles/Makefile.win32 | 1 |
10 files changed, 3 insertions, 30 deletions
diff --git a/src/makefiles/Makefile.cygwin b/src/makefiles/Makefile.cygwin index 2d57b4b089..df22d9fd99 100644 --- a/src/makefiles/Makefile.cygwin +++ b/src/makefiles/Makefile.cygwin @@ -12,7 +12,6 @@ LIBS:=$(filter-out -lm -lc, $(LIBS)) AROPT = crs DLSUFFIX = .dll -CFLAGS_SL = override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT) diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd index 5008c96b3f..8e5bc9c6ec 100644 --- a/src/makefiles/Makefile.freebsd +++ b/src/makefiles/Makefile.freebsd @@ -7,8 +7,6 @@ endif DLSUFFIX = .so -CFLAGS_SL = -fPIC -DPIC - # 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 aef035e846..bb76afc9b8 100644 --- a/src/makefiles/Makefile.hpux +++ b/src/makefiles/Makefile.hpux @@ -37,11 +37,6 @@ ifeq ($(host_cpu), ia64) else DLSUFFIX = .sl endif -ifeq ($(GCC), yes) - CFLAGS_SL = -fPIC -else - CFLAGS_SL = +Z -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 f4f091caef..c6d0546e4d 100644 --- a/src/makefiles/Makefile.linux +++ b/src/makefiles/Makefile.linux @@ -7,8 +7,6 @@ rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags DLSUFFIX = .so -CFLAGS_SL = -fPIC - # 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 43841c1597..c2a3cce4f0 100644 --- a/src/makefiles/Makefile.netbsd +++ b/src/makefiles/Makefile.netbsd @@ -9,8 +9,6 @@ endif DLSUFFIX = .so -CFLAGS_SL = -fPIC -DPIC - # 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 d8fde49d5c..0c5a7b4eb3 100644 --- a/src/makefiles/Makefile.openbsd +++ b/src/makefiles/Makefile.openbsd @@ -7,8 +7,6 @@ endif DLSUFFIX = .so -CFLAGS_SL = -fPIC -DPIC - # Rule for building a shared library from a single .o file %.so: %.o diff --git a/src/makefiles/Makefile.sco b/src/makefiles/Makefile.sco index 993861570a..49c6693f14 100644 --- a/src/makefiles/Makefile.sco +++ b/src/makefiles/Makefile.sco @@ -2,11 +2,7 @@ AROPT = cr export_dynamic = -Wl,-Bexport DLSUFFIX = .so -ifeq ($(GCC), yes) -CFLAGS_SL = -fpic -else -CFLAGS_SL = -K PIC -endif + # 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 e459de30cf..a05c0e0d3d 100644 --- a/src/makefiles/Makefile.solaris +++ b/src/makefiles/Makefile.solaris @@ -10,11 +10,7 @@ rpath = -Wl,-R'$(rpathdir)' endif DLSUFFIX = .so -ifeq ($(GCC), yes) -CFLAGS_SL = -fPIC -else -CFLAGS_SL = -KPIC -endif + # Rule for building a shared library from a single .o file %.so: %.o diff --git a/src/makefiles/Makefile.unixware b/src/makefiles/Makefile.unixware index a52717b268..3d177b76e9 100644 --- a/src/makefiles/Makefile.unixware +++ b/src/makefiles/Makefile.unixware @@ -17,11 +17,7 @@ endif CFLAGS += $(PTHREAD_CFLAGS) DLSUFFIX = .so -ifeq ($(GCC), yes) -CFLAGS_SL = -fpic -else -CFLAGS_SL = -K PIC -endif + ifeq ($(GCC), yes) SO_FLAGS = -shared else diff --git a/src/makefiles/Makefile.win32 b/src/makefiles/Makefile.win32 index 3c8024a715..d02dfd2b18 100644 --- a/src/makefiles/Makefile.win32 +++ b/src/makefiles/Makefile.win32 @@ -13,7 +13,6 @@ override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT) AROPT = crs DLSUFFIX = .dll -CFLAGS_SL = ifneq (,$(findstring backend,$(subdir))) ifeq (,$(findstring conversion_procs,$(subdir))) |