Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ed1bb25

Browse files
committed
Move port-specific parts of with_temp_install to port makefile.
Rather than define ld_library_path_ver with a big nested $(if), just put the overriding values in the makefiles for the relevant ports. Also add a variable for port makefiles to append their own stuff to with_temp_install, and use it to set LD_LIBRARY_PATH_RPATH=1 on FreeBSD which is needed to make LD_LIBRARY_PATH override DT_RPATH if DT_RUNPATH is not set (which seems to depend in unpredictable ways on the choice of compiler, at least on my system). Backpatch for the benefit of anyone doing regression tests on FreeBSD. (For other platforms there should be no functional change.)
1 parent 40e821b commit ed1bb25

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

src/Makefile.global.in

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,16 @@ $(1)="$(if $($(1)),$(2):$$$(1),$(2))"
414414
endef
415415

416416
# platform-specific environment variable to set shared library path
417-
define ld_library_path_var
418-
$(if $(filter $(PORTNAME),darwin),DYLD_LIBRARY_PATH,$(if $(filter $(PORTNAME),aix),LIBPATH,$(if $(filter $(PORTNAME),hpux),SHLIB_PATH,LD_LIBRARY_PATH)))
419-
endef
420-
421-
define with_temp_install
422-
PATH="$(abs_top_builddir)/tmp_install$(bindir):$$PATH" $(call add_to_path,$(ld_library_path_var),$(abs_top_builddir)/tmp_install$(libdir))
423-
endef
417+
# individual ports can override this later, this is the default name
418+
ld_library_path_var = LD_LIBRARY_PATH
419+
420+
# with_temp_install_extra is for individual ports to define if they
421+
# need something more here. If not defined then the expansion does
422+
# nothing.
423+
with_temp_install = \
424+
PATH="$(abs_top_builddir)/tmp_install$(bindir):$$PATH" \
425+
$(call add_to_path,$(strip $(ld_library_path_var)),$(abs_top_builddir)/tmp_install$(libdir)) \
426+
$(with_temp_install_extra)
424427

425428
ifeq ($(enable_tap_tests),yes)
426429

src/makefiles/Makefile.aix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ else
2323
LDFLAGS_SL += -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE
2424
endif
2525

26+
# env var name to use in place of LD_LIBRARY_PATH
27+
ld_library_path_var = LIBPATH
28+
2629

2730
POSTGRES_IMP= postgres.imp
2831

src/makefiles/Makefile.darwin

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ AROPT = crs
22

33
DLSUFFIX = .so
44

5+
# env var name to use in place of LD_LIBRARY_PATH
6+
ld_library_path_var = DYLD_LIBRARY_PATH
7+
58
ifdef PGXS
69
BE_DLLLIBS = -bundle_loader $(bindir)/postgres
710
else

src/makefiles/Makefile.freebsd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ DLSUFFIX = .so
99

1010
CFLAGS_SL = -fPIC -DPIC
1111

12+
# extra stuff for $(with_temp_install)
13+
# we need this to get LD_LIBRARY_PATH searched ahead of the compiled-in
14+
# rpath, if no DT_RUNPATH is present in the executable. The conditions
15+
# under which DT_RUNPATH are added seem unpredictable, so be safe.
16+
17+
define with_temp_install_extra
18+
LD_LIBRARY_PATH_RPATH=1
19+
endef
1220

1321
# Rule for building a shared library from a single .o file
1422
%.so: %.o

src/makefiles/Makefile.hpux

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ else
3636
CFLAGS_SL = +Z
3737
endif
3838

39+
# env var name to use in place of LD_LIBRARY_PATH
40+
ld_library_path_var = SHLIB_PATH
41+
3942
# Rule for building a shared library from a single .o file
4043
%$(DLSUFFIX): %.o
4144
ifeq ($(GCC), yes)

0 commit comments

Comments
 (0)