aboutsummaryrefslogtreecommitdiff
path: root/Makefile.shared
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-05 11:47:14 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-06 17:57:19 +0100
commitc86ddbe61323e371f6ac88728581481a1aa6f0e6 (patch)
tree1cc940589c78f16480486d89223fb2a2775ac470 /Makefile.shared
parentb438f0ed8f3ff1df59698b868e7bdbdaa215e7e1 (diff)
downloadopenssl-c86ddbe61323e371f6ac88728581481a1aa6f0e6.zip
openssl-c86ddbe61323e371f6ac88728581481a1aa6f0e6.tar.gz
openssl-c86ddbe61323e371f6ac88728581481a1aa6f0e6.tar.bz2
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be divided into lflags and ex_libs. These got divided in two settings, lflags and ex_libs, and the former was interpreted to be general linking flags. Unfortunately, that conclusion wasn't entirely accurate. Most of those linking were meant to end up in a very precise position on the linking command line, just before the spec of libraries the linking depends on. Back to the drawing board, we're diving things further, now having lflags, which are linking flags that aren't depending on command line position, plib_lflags, which are linking flags that should show up just before the spec of libraries to depend on, and finally ex_libs, which is the spec of extra libraries to depend on. Also, documentation is changed in Configurations/README. This was previously forgotten. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'Makefile.shared')
-rw-r--r--Makefile.shared20
1 files changed, 10 insertions, 10 deletions
diff --git a/Makefile.shared b/Makefile.shared
index 70980ad..d8bd9ed 100644
--- a/Makefile.shared
+++ b/Makefile.shared
@@ -11,8 +11,8 @@ CFLAGS=$(CFLAG)
# LDFLAGS contains flags to be used when temporary object files (when building
# shared libraries) are created, or when an application is linked.
# SHARED_LDFLAGS contains flags to be used when the shared library is created.
-LDFLAGS=
-SHARED_LDFLAGS=
+LDFLAGS=$(LDFLAG)
+SHARED_LDFLAGS=$(SHARED_LDFLAG)
NM=nm
@@ -92,7 +92,7 @@ CALC_VERSIONS= \
LINK_APP= \
( $(SET_X); \
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
- LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
+ LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS) $(LDFLAGS)}"; \
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
@@ -153,7 +153,7 @@ DO_GNU_SO=$(CALC_VERSIONS); \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
+DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"
#This is rather special. It's a special target with which one can link
#applications without bothering with any features that have anything to
@@ -203,7 +203,7 @@ link_a.bsd:
fi; $(LINK_SO_A)
link_app.bsd:
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
- LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \
fi; $(LINK_APP)
# For Darwin AKA Mac OS/X (dyld)
@@ -357,7 +357,7 @@ link_app.alpha-osf1:
@if $(DETECT_GNU_LD); then \
$(DO_GNU_APP); \
else \
- LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS) -rpath $(LIBRPATH)"; \
fi; \
$(LINK_APP)
@@ -398,7 +398,7 @@ link_app.solaris:
@ if $(DETECT_GNU_LD); then \
$(DO_GNU_APP); \
else \
- LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS) -R $(LIBRPATH)"; \
fi; \
$(LINK_APP)
@@ -493,7 +493,7 @@ link_a.irix:
fi; \
$(LINK_SO_A)
link_app.irix:
- @LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
+ @LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
$(LINK_APP)
# 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
@@ -532,7 +532,7 @@ link_a.hpux:
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
link_app.hpux:
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
- LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
fi; \
$(LINK_APP)
@@ -557,7 +557,7 @@ link_a.aix:
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
$(LINK_SO_A_VIA_O)
link_app.aix:
- LDFLAGS="$(CFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
$(LINK_APP)