X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Makefile.shared;h=ce6775b4b38a6535f3248dbfbf7c6585a795c28c;hp=c39c8424e6aba5c8ec0a9e734fb7eafb46a1facb;hb=00555c2f2fa65701b40402f4bf47fc450bd5523d;hpb=e96133e4cf60f9185203202b7bbbd79485eeeb12 diff --git a/Makefile.shared b/Makefile.shared index c39c8424e6..ce6775b4b3 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -88,16 +88,16 @@ CALC_VERSIONS= \ LINK_APP= \ ( $(DEBUG); \ - 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 | while read d; do echo -n $${d}:; done'`; \ - LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'` + 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=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ $$LDCMD $(LDFLAGS) $$LDFLAGS -o $$APPNAME $(OBJECTS) $$LIBDEPS ) LINK_SO= \ ( $(DEBUG); \ nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \ - 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 | while read d; do echo -n $${d}:; done'`; \ - LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'` + 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=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ $$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \ $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \ @@ -457,8 +457,47 @@ link_app.solaris: $(LINK_APP) # OpenServer 5 native compilers used -# UnixWare 7 and OpenUNIX 8 native compilers used link_o.svr3: + @ if ${DETECT_GNU_LD}; then \ + $(DO_GNU_SO); \ + else \ + $(CALC_VERSIONS); \ + SHLIB=lib$(LIBNAME).so; \ + SHLIB_SUFFIX=; \ + LIBDEPS="$(LIBDEPS) -lc"; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ + SHAREDCMD='$(CC)'; \ + fi; \ + $(LINK_SO_O) +link_a.svr3: + @ if ${DETECT_GNU_LD}; then \ + $(DO_GNU_SO); \ + else \ + $(CALC_VERSIONS); \ + SHLIB=lib$(LIBNAME).so; \ + SHLIB_SUFFIX=; \ + LIBDEPS="$(LIBDEPS) -lc"; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ + SHAREDCMD='$(CC)'; \ + fi; \ + $(LINK_SO_A_UNPACKED) +link_app.svr3: + @ if ${DETECT_GNU_LD}; then \ + $(DO_GNU_APP); \ + else \ + LDCMD=$(CC);\ + LDFLAGS=""; \ + LIBDEPS="$(LIBDEPS) -lc"; \ + APPNAME="$(APPNAME)"; \ + fi; \ + $(LINK_APP) + +# UnixWare 7 and OpenUNIX 8 native compilers used +link_o.svr5: @ if ${DETECT_GNU_LD}; then \ $(DO_GNU_SO); \ else \ @@ -474,7 +513,7 @@ link_o.svr3: SHAREDCMD='$(CC)'; \ fi; \ $(LINK_SO_O) -link_a.svr3: +link_a.svr5: @ if ${DETECT_GNU_LD}; then \ $(DO_GNU_SO); \ else \ @@ -490,7 +529,7 @@ link_a.svr3: SHAREDCMD='$(CC)'; \ fi; \ $(LINK_SO_A_UNPACKED) -link_app.svr3: +link_app.svr5: @ if ${DETECT_GNU_LD}; then \ $(DO_GNU_APP); \ else \ @@ -509,8 +548,10 @@ link_o.irix: SHLIB=lib$(LIBNAME).so; \ SHLIB_SUFFIX=; \ LIBDEPS="$(LIBDEPS) -lc"; \ - ALLSYMSFLAGS='-all'; \ - NOALLSYMSFLAGS=''; \ + MINUSWL=""; \ + ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \ + ALLSYMSFLAGS="$${MINUSWL}-all"; \ + NOALLSYMSFLAGS="$${MINUSWL}-notall"; \ SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \ SHAREDCMD='$(CC)'; \ fi; \ @@ -523,8 +564,10 @@ link_a.irix: SHLIB=lib$(LIBNAME).so; \ SHLIB_SUFFIX=; \ LIBDEPS="$(LIBDEPS) -lc"; \ - ALLSYMSFLAGS='-all'; \ - NOALLSYMSFLAGS=''; \ + MINUSWL=""; \ + ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \ + ALLSYMSFLAGS="$${MINUSWL}-all"; \ + NOALLSYMSFLAGS="$${MINUSWL}-notall"; \ SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \ SHAREDCMD='$(CC)'; \ fi; \ @@ -540,76 +583,49 @@ link_app.irix: fi; \ $(LINK_APP) -# HP-UX includes the full pathname of libs we depend on, so we would get -# ./libcrypto (with ./ as path information) compiled into libssl, hence -# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto -# anyway. -# The object modules are loaded from lib$i.a using the undocumented -Fl -# option. +# 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so +# we compensate for it with +cdp ../: and +cdp ./:. Yes, these rewrite +# rules imply that we can only link one level down in catalog structure, +# but that's what takes place for the moment of this writing. +cdp option +# was introduced in HP-UX 11.x and applies in 32-bit PA-RISC link +# editor context only [it's simply ignored in other cases, which are all +# ELFs by the way]. # -# WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH -# by temporarily specifying "+s"! -# -link_o.hpux32: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).sl; \ - SHLIB_SUFFIX=; \ - LIBDEPS="$(LIBDEPS) -lc"; \ - ALLSYMSFLAGS='-Fl'; \ - NOALLSYMSFLAGS=''; \ - SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \ - SHAREDCMD='/usr/ccs/bin/ld'; \ - $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -link_a.hpux32: - @ $(CALC_VERSIONS); \ +link_o.hpux: + @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ + $(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME).sl; \ + expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ SHLIB_SUFFIX=; \ - LIBDEPS="$(LIBDEPS) -lc"; \ - ALLSYMSFLAGS='-Fl'; \ - NOALLSYMSFLAGS=''; \ - SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \ - SHAREDCMD='/usr/ccs/bin/ld'; \ - $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -link_app.hpux32: - LDCMD=$(CC);\ - LDFLAGS="-Wl,+b,$(LIBRPATH)"; \ - LIBDEPS="$(LIBDEPS) -lc"; \ - APPNAME="$(APPNAME)" - $(LINK_APP) - -# HP-UX includes the full pathname of libs we depend on, so we would get -# ./libcrypto (with ./ as path information) compiled into libssl, hence -# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto -# anyway. -# -# HP-UX in 64bit mode has "+s" enabled by default; it will search for -# shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH. -# -link_o.hpux64: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).sl; \ - SHLIB_SUFFIX=; \ - LIBDEPS="$(LIBDEPS) -lc"; \ - ALLSYMSFLAGS='+forceload'; \ + LIBDEPS="$(LIBDEPS)"; \ + ALLSYMSFLAGS='-Wl,-Fl'; \ NOALLSYMSFLAGS=''; \ - SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \ - SHAREDCMD='/usr/ccs/bin/ld'; \ + expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ + SHAREDFLAGS="-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \ + SHAREDCMD=$(CC); \ + fi; \ $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -link_a.hpux64: - @ $(CALC_VERSIONS); \ +link_a.hpux: + @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ + $(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME).sl; \ + expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ SHLIB_SUFFIX=; \ - LIBDEPS="$(LIBDEPS) -lc"; \ - ALLSYMSFLAGS='+forceload'; \ + LIBDEPS="$(LIBDEPS)"; \ + ALLSYMSFLAGS='-Wl,-Fl'; \ NOALLSYMSFLAGS=''; \ - SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \ - SHAREDCMD='/usr/ccs/bin/ld'; \ + expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ + SHAREDFLAGS="-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \ + SHAREDCMD='$(CC)'; \ + fi; \ $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -link_app.hpux64: +link_app.hpux: + @if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \ LDCMD=$(CC);\ - LDFLAGS="-Wl,+b,$(LIBRPATH)"; \ - LIBDEPS="$(LIBDEPS) -lc"; \ - APPNAME="$(APPNAME)" + LDFLAGS="-Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \ + LIBDEPS="$(LIBDEPS)"; \ + APPNAME="$(APPNAME)"; \ + fi; \ $(LINK_APP) link_o.aix: @@ -667,7 +683,7 @@ link_app.reliantunix: $(LINK_APP) # Targets to build symbolic links when needed -symlink.gnu symlink.solaris symlink.svr3 symlink.irix \ +symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \ symlink.aix symlink.reliantunix: @ $(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME).so; \ @@ -677,9 +693,10 @@ symlink.darwin: SHLIB=lib$(LIBNAME); \ SHLIB_SUFFIX=.dylib; \ $(SYMLINK_SO) -symlink.hpux32 symlink.hpux64: +symlink.hpux: @ $(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME).sl; \ + expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ $(SYMLINK_SO) # The following lines means those specific architectures do no symlinks symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath: @@ -717,22 +734,18 @@ link_o.svr3-shared: link_o.svr3 link_a.svr3-shared: link_a.svr3 link_app.svr3-shared: link_app.svr3 symlink.svr3-shared: symlink.svr3 -link_o.svr5-shared: link_o.svr3 -link_a.svr5-shared: link_a.svr3 -link_app.svr5-shared: link_app.svr3 -symlink.svr5-shared: symlink.svr3 +link_o.svr5-shared: link_o.svr5 +link_a.svr5-shared: link_a.svr5 +link_app.svr5-shared: link_app.svr5 +symlink.svr5-shared: symlink.svr5 link_o.irix-shared: link_o.irix link_a.irix-shared: link_a.irix link_app.irix-shared: link_app.irix symlink.irix-shared: symlink.irix -link_o.hpux-shared: link_o.hpux32 -link_a.hpux-shared: link_a.hpux32 -link_app.hpux-shared: link_app.hpux32 -symlink.hpux-shared: symlink.hpux32 -link_o.hpux64-shared: link_o.hpux64 -link_a.hpux64-shared: link_a.hpux64 -link_app.hpux64-shared: link_app.hpux64 -symlink.hpux64-shared: symlink.hpux64 +link_o.hpux-shared: link_o.hpux +link_a.hpux-shared: link_a.hpux +link_app.hpux-shared: link_app.hpux +symlink.hpux-shared: symlink.hpux link_o.aix-shared: link_o.aix link_a.aix-shared: link_a.aix link_app.aix-shared: link_app.aix