Index: openssl/Makefile.shared |
=================================================================== |
--- openssl/Makefile.shared (revision 105093) |
+++ openssl/Makefile.shared (working copy) |
@@ -14,6 +14,8 @@ |
LDFLAGS= |
SHARED_LDFLAGS= |
+NM=nm |
+ |
# LIBNAME contains just the name of the library, without prefix ("lib" |
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so, |
# .dll, ...). This one MUST have a value when using this makefile to |
@@ -91,7 +93,7 @@ |
( $(SET_X); \ |
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \ |
LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \ |
- LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \ |
+ 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 \ |
$${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} ) |
@@ -101,7 +103,7 @@ |
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \ |
SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \ |
SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \ |
- LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \ |
+ 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 \ |
$${SHAREDCMD} $${SHAREDFLAGS} \ |
@@ -133,7 +135,7 @@ |
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \ |
( $(SET_X); \ |
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \ |
- $(LINK_SO) && rm -f $(LIBNAME).o |
+ $(LINK_SO) && rm -f lib$(LIBNAME).o |
LINK_SO_A_UNPACKED= \ |
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \ |
@@ -142,7 +144,7 @@ |
SHOBJECTS=$$UNPACKDIR/*.o; \ |
$(LINK_SO) && rm -rf $$UNPACKDIR |
-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); \ |
SHLIB=lib$(LIBNAME).so; \ |
@@ -168,8 +170,19 @@ |
link_app.gnu: |
@ $(DO_GNU_APP); $(LINK_APP) |
+DO_BEOS_SO= SHLIB=lib$(LIBNAME).so; \ |
+ SHLIB_SUFFIX=; \ |
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SUFFIX" |
+ |
+link_o.beos: |
+ @ $(DO_BEOS_SO); $(LINK_SO_O) |
+link_a.beos: |
+ @ $(DO_BEOS_SO); $(LINK_SO_A) |
+ |
link_o.bsd: |
- @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ |
+ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
$(CALC_VERSIONS); \ |
SHLIB=lib$(LIBNAME).so; \ |
SHLIB_SUFFIX=; \ |
@@ -179,7 +192,7 @@ |
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ |
fi; $(LINK_SO_O) |
link_a.bsd: |
- @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ |
+ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
$(CALC_VERSIONS); \ |
SHLIB=lib$(LIBNAME).so; \ |
SHLIB_SUFFIX=; \ |
@@ -189,24 +202,34 @@ |
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ |
fi; $(LINK_SO_A) |
link_app.bsd: |
- @if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \ |
+ @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ |
LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \ |
fi; $(LINK_APP) |
# For Darwin AKA Mac OS/X (dyld) |
-# link_o.darwin produces .so, because we let it use dso_dlfcn module, |
-# which has .so extension hard-coded. One can argue that one should |
-# develop special dso module for MacOS X. At least manual encourages |
-# to use native NSModule(3) API and refers to dlfcn as termporary hack. |
+# Originally link_o.darwin produced .so, because it was hard-coded |
+# in dso_dlfcn module. At later point dso_dlfcn switched to .dylib |
+# extension in order to allow for run-time linking with vendor- |
+# supplied shared libraries such as libz, so that link_o.darwin had |
+# to be harmonized with it. This caused minor controversy, because |
+# it was believed that dlopen can't be used to dynamically load |
+# .dylib-s, only so called bundle modules (ones linked with -bundle |
+# flag). The belief seems to be originating from pre-10.4 release, |
+# where dlfcn functionality was emulated by dlcompat add-on. In |
+# 10.4 dlopen was rewritten as native part of dyld and is documented |
+# to be capable of loading both dynamic libraries and bundles. In |
+# order to provide compatibility with pre-10.4 dlopen, modules are |
+# linked with -bundle flag, which makes .dylib extension misleading. |
+# It works, because dlopen is [and always was] extension-agnostic. |
+# Alternative to this heuristic approach is to develop specific |
+# MacOS X dso module relying on whichever "native" dyld interface. |
link_o.darwin: |
@ $(CALC_VERSIONS); \ |
- SHLIB=`expr "$$THIS" : '.*/\([^/\.]*\)\.'`; \ |
- SHLIB=$${SHLIB:-lib$(LIBNAME)}; \ |
- SHLIB_SUFFIX=`expr "$$THIS" : '.*\(\.[^\.]*\)$$'`; \ |
- SHLIB_SUFFIX=$${SHLIB_SUFFIX:-.so}; \ |
+ SHLIB=lib$(LIBNAME); \ |
+ SHLIB_SUFFIX=.dylib; \ |
ALLSYMSFLAGS='-all_load'; \ |
NOALLSYMSFLAGS=''; \ |
- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \ |
+ SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \ |
if [ -n "$(LIBVERSION)" ]; then \ |
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \ |
fi; \ |
@@ -227,7 +250,7 @@ |
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \ |
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \ |
fi; \ |
- SHAREDFLAGS="$$SHAREDFLAGS -install_name ${INSTALLTOP}/lib/$$SHLIB${SHLIB_EXT}"; \ |
+ SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \ |
$(LINK_SO_A) |
link_app.darwin: # is there run-path on darwin? |
$(LINK_APP) |
@@ -237,40 +260,59 @@ |
INHIBIT_SYMLINKS=yes; \ |
SHLIB=cyg$(LIBNAME); \ |
base=-Wl,--enable-auto-image-base; \ |
+ deffile=; \ |
if expr $(PLATFORM) : 'mingw' > /dev/null; then \ |
SHLIB=$(LIBNAME)eay32; base=; \ |
+ if test -f $(LIBNAME)eay32.def; then \ |
+ deffile=$(LIBNAME)eay32.def; \ |
+ fi; \ |
fi; \ |
SHLIB_SUFFIX=.dll; \ |
LIBVERSION="$(LIBVERSION)"; \ |
SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \ |
ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \ |
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \ |
$(LINK_SO_O) |
+#for mingw target if def-file is in use dll-name should match library-name |
link_a.cygwin: |
@ $(CALC_VERSIONS); \ |
INHIBIT_SYMLINKS=yes; \ |
- SHLIB=cyg$(LIBNAME); \ |
+ SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \ |
+ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \ |
base=-Wl,--enable-auto-image-base; \ |
if expr $(PLATFORM) : 'mingw' > /dev/null; then \ |
- SHLIB=$(LIBNAME)eay32; \ |
- base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \ |
+ case $(LIBNAME) in \ |
+ crypto) SHLIB=libeay;; \ |
+ ssl) SHLIB=ssleay;; \ |
+ esac; \ |
+ SHLIB_SOVER=32; \ |
+ extras="$(LIBNAME).def"; \ |
+ $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \ |
+ base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \ |
fi; \ |
- SHLIB_SUFFIX=.dll; \ |
- SHLIB_SOVER=-$(LIBVERSION); \ |
+ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ |
+ $(PERL) util/mkrc.pl $$dll_name | \ |
+ $(CROSS_COMPILE)windres -o rc.o; \ |
+ extras="$$extras rc.o"; \ |
ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \ |
- [ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \ |
- [ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \ |
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ |
+ [ -f apps/$$dll_name ] && rm apps/$$dll_name; \ |
+ [ -f test/$$dll_name ] && rm test/$$dll_name; \ |
$(LINK_SO_A) || exit 1; \ |
- cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX apps/; \ |
- cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX test/ |
+ rm $$extras; \ |
+ cp -p $$dll_name apps/; \ |
+ cp -p $$dll_name test/ |
link_app.cygwin: |
+ @if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \ |
+ LIBDEPS="$(TOP)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \ |
+ export LIBDEPS; \ |
+ fi; \ |
$(LINK_APP) |
link_o.alpha-osf1: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
SHLIB=lib$(LIBNAME).so; \ |
@@ -291,7 +333,7 @@ |
fi; \ |
$(LINK_SO_O) |
link_a.alpha-osf1: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
SHLIB=lib$(LIBNAME).so; \ |
@@ -312,7 +354,7 @@ |
fi; \ |
$(LINK_SO_A) |
link_app.alpha-osf1: |
- @if ${DETECT_GNU_LD}; then \ |
+ @if $(DETECT_GNU_LD); then \ |
$(DO_GNU_APP); \ |
else \ |
LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \ |
@@ -320,7 +362,7 @@ |
$(LINK_APP) |
link_o.solaris: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
@@ -334,12 +376,12 @@ |
fi; \ |
$(LINK_SO_O) |
link_a.solaris: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
MINUSZ='-z '; \ |
- (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \ |
+ ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \ |
SHLIB=lib$(LIBNAME).so; \ |
SHLIB_SUFFIX=;\ |
ALLSYMSFLAGS="$${MINUSZ}allextract"; \ |
@@ -348,7 +390,7 @@ |
fi; \ |
$(LINK_SO_A) |
link_app.solaris: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_APP); \ |
else \ |
LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \ |
@@ -357,7 +399,7 @@ |
# OpenServer 5 native compilers used |
link_o.svr3: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
@@ -369,7 +411,7 @@ |
fi; \ |
$(LINK_SO_O) |
link_a.svr3: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
@@ -381,12 +423,12 @@ |
fi; \ |
$(LINK_SO_A_UNPACKED) |
link_app.svr3: |
- @${DETECT_GNU_LD} && $(DO_GNU_APP); \ |
+ @$(DETECT_GNU_LD) && $(DO_GNU_APP); \ |
$(LINK_APP) |
# UnixWare 7 and OpenUNIX 8 native compilers used |
link_o.svr5: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
@@ -400,12 +442,12 @@ |
fi; \ |
$(LINK_SO_O) |
link_a.svr5: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
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_SUFFIX=; \ |
ALLSYMSFLAGS=''; \ |
@@ -414,11 +456,11 @@ |
fi; \ |
$(LINK_SO_A_UNPACKED) |
link_app.svr5: |
- @${DETECT_GNU_LD} && $(DO_GNU_APP); \ |
+ @$(DETECT_GNU_LD) && $(DO_GNU_APP); \ |
$(LINK_APP) |
link_o.irix: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
@@ -432,7 +474,7 @@ |
fi; \ |
$(LINK_SO_O) |
link_a.irix: |
- @ if ${DETECT_GNU_LD}; then \ |
+ @ if $(DETECT_GNU_LD); then \ |
$(DO_GNU_SO); \ |
else \ |
$(CALC_VERSIONS); \ |
@@ -458,7 +500,7 @@ |
# ELFs by the way]. |
# |
link_o.hpux: |
- @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ |
+ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
$(CALC_VERSIONS); \ |
SHLIB=lib$(LIBNAME).sl; \ |
expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \ |
@@ -471,7 +513,7 @@ |
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \ |
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX |
link_a.hpux: |
- @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ |
+ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
$(CALC_VERSIONS); \ |
SHLIB=lib$(LIBNAME).sl; \ |
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ |
@@ -484,7 +526,7 @@ |
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \ |
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX |
link_app.hpux: |
- @if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \ |
+ @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ |
LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \ |
fi; \ |
$(LINK_APP) |
@@ -549,7 +591,7 @@ |
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ |
$(SYMLINK_SO) |
# The following lines means those specific architectures do no symlinks |
-symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath: |
+symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos: |
# Compatibility targets |
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu |
@@ -607,3 +649,7 @@ |
link_a.reliantunix-shared: link_a.reliantunix |
link_app.reliantunix-shared: link_app.reliantunix |
symlink.reliantunix-shared: symlink.reliantunix |
+link_o.beos-shared: link_o.beos |
+link_a.beos-shared: link_a.beos |
+link_app.beos-shared: link_app.gnu |
+symlink.beos-shared: symlink.beos |