提交 e048fd51 编写于 作者: R Richard Levitte

Big rename fest in makefile.shared: link_a / link_o -> link_shlib / link_dso

Originally, the Makefile.shared targets described what they used as
input for a shared object, be it a shared library or a DSO.  It turned
out, however, that the link_o targets were used exclusively for
engines and the link_a targets were for libcrypto and libssl.

This rename fest turns and indication on the kind of input the targets
get to the intention with using them.
Reviewed-by: NAndy Polyakov <appro@openssl.org>
上级 f5c174ff
...@@ -847,7 +847,7 @@ $target : $lib\$(LIB_EXT) $deps $ordinalsfile ...@@ -847,7 +847,7 @@ $target : $lib\$(LIB_EXT) $deps $ordinalsfile
CROSS_COMPILE="\$(CROSS_COMPILE)" \\ CROSS_COMPILE="\$(CROSS_COMPILE)" \\
SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=\$(SHLIB_EXT) \\ SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=\$(SHLIB_EXT) \\
SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\ SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\
link_a.$shlib_target link_shlib.$shlib_target
EOF EOF
. (windowsdll() ? <<"EOF" : ""); . (windowsdll() ? <<"EOF" : "");
rm -f apps/$shlib\$(SHLIB_EXT) rm -f apps/$shlib\$(SHLIB_EXT)
...@@ -881,7 +881,7 @@ $target: $objs $deps ...@@ -881,7 +881,7 @@ $target: $objs $deps
SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" \\ SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" \\
SHLIB_EXT=\$(DSO_EXT) \\ SHLIB_EXT=\$(DSO_EXT) \\
LIBEXTRAS="$objs" \\ LIBEXTRAS="$objs" \\
link_o.$shlib_target link_dso.$shlib_target
EOF EOF
} }
sub obj2lib { sub obj2lib {
......
...@@ -378,7 +378,7 @@ do_$(SHLIB_TARGET): ...@@ -378,7 +378,7 @@ do_$(SHLIB_TARGET):
LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
LIBDEPS="$$libs $(EX_LIBS)" \ LIBDEPS="$$libs $(EX_LIBS)" \
link_a.$(SHLIB_TARGET); \ link_shlib.$(SHLIB_TARGET); \
libs="-l$$i $$libs"; \ libs="-l$$i $$libs"; \
case "$(PLATFORM)" in \ case "$(PLATFORM)" in \
Cygwin*) \ Cygwin*) \
......
...@@ -50,8 +50,8 @@ OBJECTS= ...@@ -50,8 +50,8 @@ OBJECTS=
# For example, if a second library, say libbar.a needs to be linked into # For example, if a second library, say libbar.a needs to be linked into
# libfoo.so, you need to do the following: # libfoo.so, you need to do the following:
#LIBEXTRAS=libbar.a #LIBEXTRAS=libbar.a
# Note that this MUST be used when using the link_o targets, to hold the # Note that this MUST be used when using the link_dso targets, to hold the
# names of all object files that go into the target library. # names of all object files that go into the target shared object.
LIBEXTRAS= LIBEXTRAS=
# LIBVERSION contains the current version of the library. # LIBVERSION contains the current version of the library.
...@@ -143,17 +143,17 @@ SYMLINK_SO= \ ...@@ -143,17 +143,17 @@ SYMLINK_SO= \
fi; \ fi; \
fi fi
LINK_SO_A= SHOBJECTS="$(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO) LINK_SO_SHLIB= SHOBJECTS="$(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO) LINK_SO_DSO= INHIBIT_SYMLINKS=yes; SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
LINK_SO_A_VIA_O= \ LINK_SO_SHLIB_VIA_O= \
SHOBJECTS=$(DSTDIR)/lib$(LIBNAME).o; \ SHOBJECTS=$(DSTDIR)/lib$(LIBNAME).o; \
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \ ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
( echo ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \ ( echo ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \
ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL $(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS) ); \ ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL $(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS) ); \
$(LINK_SO) && ( echo rm -f $$SHOBJECTS; rm -f $$SHOBJECTS ) $(LINK_SO) && ( echo rm -f $$SHOBJECTS; rm -f $$SHOBJECTS )
LINK_SO_A_UNPACKED= \ LINK_SO_SHLIB_UNPACKED= \
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \ UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
(cd $$UNPACKDIR; ar x ../$(DSTDIR)/lib$(LIBNAME).a) && \ (cd $$UNPACKDIR; ar x ../$(DSTDIR)/lib$(LIBNAME).a) && \
([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \ ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
...@@ -162,13 +162,13 @@ LINK_SO_A_UNPACKED= \ ...@@ -162,13 +162,13 @@ LINK_SO_A_UNPACKED= \
DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
DO_GNU_SO=$(CALC_VERSIONS); \ DO_GNU_SO_NOCALC=\
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
DO_GNU_SO=$(CALC_VERSIONS); $(DO_GNU_SO_NOCALC); SHLIB=lib$$SHLIB
DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -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 #This is rather special. It's a special target with which one can link
...@@ -179,14 +179,14 @@ DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)" ...@@ -179,14 +179,14 @@ DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"
link_app.: link_app.:
$(LINK_APP) $(LINK_APP)
link_o.gnu: link_dso.gnu:
@ $(DO_GNU_SO); $(LINK_SO_O) @ $(DO_GNU_SO_NOCALC); $(LINK_SO_DSO)
link_a.gnu: link_shlib.gnu:
@ $(DO_GNU_SO); $(LINK_SO_A) @ $(DO_GNU_SO); $(LINK_SO_SHLIB)
link_app.gnu: link_app.gnu:
@ $(DO_GNU_APP); $(LINK_APP) @ $(DO_GNU_APP); $(LINK_APP)
link_a.linux-shared: link_shlib.linux-shared:
@if [ $(LIBNAME) != "crypto" -a $(LIBNAME) != "ssl" ]; then $(DO_GNU_SO); else \ @if [ $(LIBNAME) != "crypto" -a $(LIBNAME) != "ssl" ]; then $(DO_GNU_SO); else \
$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \ $(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
$(CALC_VERSIONS); \ $(CALC_VERSIONS); \
...@@ -195,19 +195,18 @@ link_a.linux-shared: ...@@ -195,19 +195,18 @@ link_a.linux-shared:
ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \ ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
fi; $(LINK_SO_A) fi; $(LINK_SO_SHLIB)
link_o.bsd: link_dso.bsd:
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ @if $(DETECT_GNU_LD); then $(DO_GNU_SO_NOCALC); else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
LIBDEPS=" "; \ LIBDEPS=" "; \
ALLSYMSFLAGS="-Wl,-Bforcearchive"; \ ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
NOALLSYMSFLAGS=; \ NOALLSYMSFLAGS=; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
fi; $(LINK_SO_O) fi; $(LINK_SO_DSO)
link_a.bsd: link_shlib.bsd:
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
$(CALC_VERSIONS); \ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
...@@ -216,17 +215,17 @@ link_a.bsd: ...@@ -216,17 +215,17 @@ link_a.bsd:
ALLSYMSFLAGS="-Wl,-Bforcearchive"; \ ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
NOALLSYMSFLAGS=; \ NOALLSYMSFLAGS=; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
fi; $(LINK_SO_A) fi; $(LINK_SO_SHLIB)
link_app.bsd: link_app.bsd:
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \
fi; $(LINK_APP) fi; $(LINK_APP)
# For Darwin AKA Mac OS/X (dyld) # For Darwin AKA Mac OS/X (dyld)
# Originally link_o.darwin produced .so, because it was hard-coded # Originally link_dso.darwin produced .so, because it was hard-coded
# in dso_dlfcn module. At later point dso_dlfcn switched to .dylib # in dso_dlfcn module. At later point dso_dlfcn switched to .dylib
# extension in order to allow for run-time linking with vendor- # extension in order to allow for run-time linking with vendor-
# supplied shared libraries such as libz, so that link_o.darwin had # supplied shared libraries such as libz, so that link_dso.darwin had
# to be harmonized with it. This caused minor controversy, because # to be harmonized with it. This caused minor controversy, because
# it was believed that dlopen can't be used to dynamically load # it was believed that dlopen can't be used to dynamically load
# .dylib-s, only so called bundle modules (ones linked with -bundle # .dylib-s, only so called bundle modules (ones linked with -bundle
...@@ -239,21 +238,14 @@ link_app.bsd: ...@@ -239,21 +238,14 @@ link_app.bsd:
# It works, because dlopen is [and always was] extension-agnostic. # It works, because dlopen is [and always was] extension-agnostic.
# Alternative to this heuristic approach is to develop specific # Alternative to this heuristic approach is to develop specific
# MacOS X dso module relying on whichever "native" dyld interface. # MacOS X dso module relying on whichever "native" dyld interface.
link_o.darwin: link_dso.darwin:
@ $(CALC_VERSIONS); \ @ SHLIB=lib$(LIBNAME); \
SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \ SHLIB_SUFFIX=.dylib; \
ALLSYMSFLAGS='-all_load'; \ ALLSYMSFLAGS='-all_load'; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \ SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
if [ -n "$(LIBVERSION)" ]; then \ $(LINK_SO_DSO)
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \ link_shlib.darwin:
fi; \
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
fi; \
$(LINK_SO_O)
link_a.darwin:
@ $(CALC_VERSIONS); \ @ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \ SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \ SHLIB_SUFFIX=.dylib; \
...@@ -267,12 +259,11 @@ link_a.darwin: ...@@ -267,12 +259,11 @@ link_a.darwin:
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \ SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
fi; \ fi; \
SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \ SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \
$(LINK_SO_A) $(LINK_SO_SHLIB)
link_app.darwin: # is there run-path on darwin? link_app.darwin: # is there run-path on darwin?
$(LINK_APP) $(LINK_APP)
link_o.cygwin: link_dso.cygwin:
@ $(CALC_VERSIONS); \
INHIBIT_SYMLINKS=yes; \ INHIBIT_SYMLINKS=yes; \
SHLIB=cyg$(LIBNAME); \ SHLIB=cyg$(LIBNAME); \
base=-Wl,--enable-auto-image-base; \ base=-Wl,--enable-auto-image-base; \
...@@ -284,14 +275,12 @@ link_o.cygwin: ...@@ -284,14 +275,12 @@ link_o.cygwin:
fi; \ fi; \
fi; \ fi; \
SHLIB_SUFFIX=.dll; \ SHLIB_SUFFIX=.dll; \
LIBVERSION="$(LIBVERSION)"; \
SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-Bsymbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-Bsymbolic"; \
$(LINK_SO_O) $(LINK_SO_DSO)
#for mingw target if def-file is in use dll-name should match library-name #for mingw target if def-file is in use dll-name should match library-name
link_a.cygwin: link_shlib.cygwin:
@ $(CALC_VERSIONS); \ @ $(CALC_VERSIONS); \
INHIBIT_SYMLINKS=yes; \ INHIBIT_SYMLINKS=yes; \
SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \ SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
...@@ -316,33 +305,23 @@ link_a.cygwin: ...@@ -316,33 +305,23 @@ link_a.cygwin:
ALLSYMSFLAGS='-Wl,--whole-archive'; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
$(LINK_SO_A) || exit 1; \ $(LINK_SO_SHLIB) || exit 1; \
rm $$extras rm $$extras
link_app.cygwin: link_app.cygwin:
$(LINK_APP) $(LINK_APP)
link_o.alpha-osf1: link_dso.alpha-osf1:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO_NOCALC); \
else \ else \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB_HIST="$(LIBVERSION)"; \
fi; \
SHLIB_SOVER=; \
ALLSYMSFLAGS='-all'; \ ALLSYMSFLAGS='-all'; \
NOALLSYMSFLAGS='-none'; \ NOALLSYMSFLAGS='-none'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
if [ -n "$$SHLIB_HIST" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
fi; \ fi; \
fi; \ $(LINK_SO_DSO)
$(LINK_SO_O) link_shlib.alpha-osf1:
link_a.alpha-osf1:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO); \
else \ else \
...@@ -362,7 +341,7 @@ link_a.alpha-osf1: ...@@ -362,7 +341,7 @@ link_a.alpha-osf1:
SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \ SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
fi; \ fi; \
fi; \ fi; \
$(LINK_SO_A) $(LINK_SO_SHLIB)
link_app.alpha-osf1: link_app.alpha-osf1:
@if $(DETECT_GNU_LD); then \ @if $(DETECT_GNU_LD); then \
$(DO_GNU_APP); \ $(DO_GNU_APP); \
...@@ -371,9 +350,9 @@ link_app.alpha-osf1: ...@@ -371,9 +350,9 @@ link_app.alpha-osf1:
fi; \ fi; \
$(LINK_APP) $(LINK_APP)
link_o.solaris: link_dso.solaris:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO_NOCALC); \
else \ else \
$(CALC_VERSIONS); \ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
...@@ -382,8 +361,8 @@ link_o.solaris: ...@@ -382,8 +361,8 @@ link_o.solaris:
NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \ NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
fi; \ fi; \
$(LINK_SO_O) $(LINK_SO_DSO)
link_a.solaris: link_shlib.solaris:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO); \
else \ else \
...@@ -399,7 +378,7 @@ link_a.solaris: ...@@ -399,7 +378,7 @@ link_a.solaris:
NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \ NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
fi; \ fi; \
$(LINK_SO_A) $(LINK_SO_SHLIB)
link_app.solaris: link_app.solaris:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_APP); \ $(DO_GNU_APP); \
...@@ -409,19 +388,19 @@ link_app.solaris: ...@@ -409,19 +388,19 @@ link_app.solaris:
$(LINK_APP) $(LINK_APP)
# OpenServer 5 native compilers used # OpenServer 5 native compilers used
link_o.svr3: link_dso.svr3:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO_NOCALC); \
else \ else \
$(CALC_VERSIONS); \ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
ALLSYMSFLAGS=''; \ ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SUFFIX"; \
fi; \ fi; \
$(LINK_SO_O) $(LINK_SO_DSO)
link_a.svr3: link_shlib.svr3:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO); \
else \ else \
...@@ -432,27 +411,26 @@ link_a.svr3: ...@@ -432,27 +411,26 @@ link_a.svr3:
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
fi; \ fi; \
$(LINK_SO_A_UNPACKED) $(LINK_SO_SHLIB_UNPACKED)
link_app.svr3: link_app.svr3:
@$(DETECT_GNU_LD) && $(DO_GNU_APP); \ @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
$(LINK_APP) $(LINK_APP)
# UnixWare 7 and OpenUNIX 8 native compilers used # UnixWare 7 and OpenUNIX 8 native compilers used
link_o.svr5: link_dso.svr5:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO_NOCALC); \
else \ else \
$(CALC_VERSIONS); \
SHARE_FLAG='-G'; \ SHARE_FLAG='-G'; \
($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \ ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
ALLSYMSFLAGS=''; \ ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SUFFIX"; \
fi; \ fi; \
$(LINK_SO_O) $(LINK_SO_DSO)
link_a.svr5: link_shlib.svr5:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO); \
else \ else \
...@@ -465,26 +443,25 @@ link_a.svr5: ...@@ -465,26 +443,25 @@ link_a.svr5:
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
fi; \ fi; \
$(LINK_SO_A_UNPACKED) $(LINK_SO_SHLIB_UNPACKED)
link_app.svr5: link_app.svr5:
@$(DETECT_GNU_LD) && $(DO_GNU_APP); \ @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
$(LINK_APP) $(LINK_APP)
link_o.irix: link_dso.irix:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO_NOCALC); \
else \ else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
MINUSWL=""; \ MINUSWL=""; \
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \ ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
ALLSYMSFLAGS="$${MINUSWL}-all"; \ ALLSYMSFLAGS="$${MINUSWL}-all"; \
NOALLSYMSFLAGS="$${MINUSWL}-none"; \ NOALLSYMSFLAGS="$${MINUSWL}-none"; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SUFFIX,-B,symbolic"; \
fi; \ fi; \
$(LINK_SO_O) $(LINK_SO_DSO)
link_a.irix: link_shlib.irix:
@ if $(DETECT_GNU_LD); then \ @ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \ $(DO_GNU_SO); \
else \ else \
...@@ -497,7 +474,7 @@ link_a.irix: ...@@ -497,7 +474,7 @@ link_a.irix:
NOALLSYMSFLAGS="$${MINUSWL}-none"; \ NOALLSYMSFLAGS="$${MINUSWL}-none"; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \
fi; \ fi; \
$(LINK_SO_A) $(LINK_SO_SHLIB)
link_app.irix: link_app.irix:
@LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \ @LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
$(LINK_APP) $(LINK_APP)
...@@ -510,20 +487,19 @@ link_app.irix: ...@@ -510,20 +487,19 @@ link_app.irix:
# editor context only [it's simply ignored in other cases, which are all # editor context only [it's simply ignored in other cases, which are all
# ELFs by the way]. # ELFs by the way].
# #
link_o.hpux: link_dso.hpux:
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ @if $(DETECT_GNU_LD); then $(DO_GNU_SO_NOCALC); else \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \ SHLIB=lib$(LIBNAME).sl; \
expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \ expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
ALLSYMSFLAGS='-Wl,-Fl'; \ ALLSYMSFLAGS='-Wl,-Fl'; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
fi; \ fi; \
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \ rm -f $$SHLIB$$SHLIB_SUFFIX || :; \
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX $(LINK_SO_DSO) && chmod a=rx $$SHLIB$$SHLIB_SUFFIX
link_a.hpux: link_shlib.hpux:
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
$(CALC_VERSIONS); \ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).sl; \ SHLIB=lib$(LIBNAME).sl; \
...@@ -535,24 +511,23 @@ link_a.hpux: ...@@ -535,24 +511,23 @@ link_a.hpux:
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
fi; \ fi; \
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \ rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX $(LINK_SO_SHLIB) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
link_app.hpux: link_app.hpux:
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
fi; \ fi; \
$(LINK_APP) $(LINK_APP)
link_o.aix: link_dso.aix:
@ $(CALC_VERSIONS); \ @OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \ OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
SHLIB=lib$(LIBNAME).so; \ SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \ SHLIB_SUFFIX=; \
ALLSYMSFLAGS=''; \ ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \ SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
$(LINK_SO_O); $(LINK_SO_DSO);
link_a.aix: link_shlib.aix:
@ $(CALC_VERSIONS); \ @ $(CALC_VERSIONS); \
OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \ OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \ OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
...@@ -561,7 +536,7 @@ link_a.aix: ...@@ -561,7 +536,7 @@ link_a.aix:
ALLSYMSFLAGS='-bnogc'; \ ALLSYMSFLAGS='-bnogc'; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \ SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
$(LINK_SO_A_VIA_O) $(LINK_SO_SHLIB_VIA_O)
link_app.aix: link_app.aix:
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
$(LINK_APP) $(LINK_APP)
...@@ -587,54 +562,54 @@ symlink.hpux: ...@@ -587,54 +562,54 @@ symlink.hpux:
symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath: symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
# Compatibility targets # Compatibility targets
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared: link_dso.gnu
link_a.bsd-gcc-shared link_a.gnu-shared: link_a.gnu link_shlib.bsd-gcc-shared link_shlib.gnu-shared: link_shlib.gnu
link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
link_o.bsd-shared: link_o.bsd link_dso.bsd-shared: link_dso.bsd
link_a.bsd-shared: link_a.bsd link_shlib.bsd-shared: link_shlib.bsd
link_app.bsd-shared: link_app.bsd link_app.bsd-shared: link_app.bsd
link_o.darwin-shared: link_o.darwin link_dso.darwin-shared: link_dso.darwin
link_a.darwin-shared: link_a.darwin link_shlib.darwin-shared: link_shlib.darwin
link_app.darwin-shared: link_app.darwin link_app.darwin-shared: link_app.darwin
symlink.darwin-shared: symlink.darwin symlink.darwin-shared: symlink.darwin
link_o.cygwin-shared: link_o.cygwin link_dso.cygwin-shared: link_dso.cygwin
link_a.cygwin-shared: link_a.cygwin link_shlib.cygwin-shared: link_shlib.cygwin
link_app.cygwin-shared: link_app.cygwin link_app.cygwin-shared: link_app.cygwin
symlink.cygwin-shared: symlink.cygwin symlink.cygwin-shared: symlink.cygwin
link_o.alpha-osf1-shared: link_o.alpha-osf1 link_dso.alpha-osf1-shared: link_dso.alpha-osf1
link_a.alpha-osf1-shared: link_a.alpha-osf1 link_shlib.alpha-osf1-shared: link_shlib.alpha-osf1
link_app.alpha-osf1-shared: link_app.alpha-osf1 link_app.alpha-osf1-shared: link_app.alpha-osf1
symlink.alpha-osf1-shared: symlink.alpha-osf1 symlink.alpha-osf1-shared: symlink.alpha-osf1
link_o.tru64-shared: link_o.tru64 link_dso.tru64-shared: link_dso.tru64
link_a.tru64-shared: link_a.tru64 link_shlib.tru64-shared: link_shlib.tru64
link_app.tru64-shared: link_app.tru64 link_app.tru64-shared: link_app.tru64
symlink.tru64-shared: symlink.tru64 symlink.tru64-shared: symlink.tru64
link_o.tru64-shared-rpath: link_o.tru64-rpath link_dso.tru64-shared-rpath: link_dso.tru64-rpath
link_a.tru64-shared-rpath: link_a.tru64-rpath link_shlib.tru64-shared-rpath: link_shlib.tru64-rpath
link_app.tru64-shared-rpath: link_app.tru64-rpath link_app.tru64-shared-rpath: link_app.tru64-rpath
symlink.tru64-shared-rpath: symlink.tru64-rpath symlink.tru64-shared-rpath: symlink.tru64-rpath
link_o.solaris-shared: link_o.solaris link_dso.solaris-shared: link_dso.solaris
link_a.solaris-shared: link_a.solaris link_shlib.solaris-shared: link_shlib.solaris
link_app.solaris-shared: link_app.solaris link_app.solaris-shared: link_app.solaris
symlink.solaris-shared: symlink.solaris symlink.solaris-shared: symlink.solaris
link_o.svr3-shared: link_o.svr3 link_dso.svr3-shared: link_dso.svr3
link_a.svr3-shared: link_a.svr3 link_shlib.svr3-shared: link_shlib.svr3
link_app.svr3-shared: link_app.svr3 link_app.svr3-shared: link_app.svr3
symlink.svr3-shared: symlink.svr3 symlink.svr3-shared: symlink.svr3
link_o.svr5-shared: link_o.svr5 link_dso.svr5-shared: link_dso.svr5
link_a.svr5-shared: link_a.svr5 link_shlib.svr5-shared: link_shlib.svr5
link_app.svr5-shared: link_app.svr5 link_app.svr5-shared: link_app.svr5
symlink.svr5-shared: symlink.svr5 symlink.svr5-shared: symlink.svr5
link_o.irix-shared: link_o.irix link_dso.irix-shared: link_dso.irix
link_a.irix-shared: link_a.irix link_shlib.irix-shared: link_shlib.irix
link_app.irix-shared: link_app.irix link_app.irix-shared: link_app.irix
symlink.irix-shared: symlink.irix symlink.irix-shared: symlink.irix
link_o.hpux-shared: link_o.hpux link_dso.hpux-shared: link_dso.hpux
link_a.hpux-shared: link_a.hpux link_shlib.hpux-shared: link_shlib.hpux
link_app.hpux-shared: link_app.hpux link_app.hpux-shared: link_app.hpux
symlink.hpux-shared: symlink.hpux symlink.hpux-shared: symlink.hpux
link_o.aix-shared: link_o.aix link_dso.aix-shared: link_dso.aix
link_a.aix-shared: link_a.aix link_shlib.aix-shared: link_shlib.aix
link_app.aix-shared: link_app.aix link_app.aix-shared: link_app.aix
symlink.aix-shared: symlink.aix symlink.aix-shared: symlink.aix
...@@ -63,7 +63,7 @@ lib: $(LIBOBJ) $(TESTLIBOBJ) ...@@ -63,7 +63,7 @@ lib: $(LIBOBJ) $(TESTLIBOBJ)
$(MAKE) -f ../Makefile.shared -e \ $(MAKE) -f ../Makefile.shared -e \
LIBNAME=$$l LIBEXTRAS="e_$$l*.o" \ LIBNAME=$$l LIBEXTRAS="e_$$l*.o" \
LIBDEPS='$(PLIB_LDFLAG) -L.. -lcrypto $(EX_LIBS)' \ LIBDEPS='$(PLIB_LDFLAG) -L.. -lcrypto $(EX_LIBS)' \
link_o.$(SHLIB_TARGET); \ link_dso.$(SHLIB_TARGET); \
done; \ done; \
else \ else \
$(AR) $(LIB) $(LIBOBJ); \ $(AR) $(LIB) $(LIBOBJ); \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册