X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=Makefile.shared;h=105398947e0b0ecf207145c26a101cd7d0349d20;hp=033c8b7c6745eb7d915276ff82a7933f8e396301;hb=3c051806ce842ebcc56b4818fa2fdf0fe3ee5c34;hpb=30afcc072acd4f70590fec68bf0590da4e4f1883 diff --git a/Makefile.shared b/Makefile.shared index 033c8b7c67..105398947e 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -7,45 +7,83 @@ # CC contains the current compiler. This one MUST be defined CC=cc -# LDFLAGS contains flags to be used when the temporary object file is -# created. SHARED_LDFLAGS contains flags to be used when the shared -# library is created. -LDFLAGS= -SHARED_LDFLAGS= +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=$(LDFLAG) +SHARED_LDFLAGS=$(SHARED_LDFLAG) -# LIBNAME contains just the name of thhe library, without prefix ("lib" +RC=windres +# SHARED_RCFLAGS are flags used with windres, i.e. when build for Cygwin +# or Mingw. +SHARED_RCFLAGS=$(SHARED_RCFLAG) + +NM=nm +ECHO=echo + +# 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. +# .dll, ...). This one MUST have a value when using this makefile to +# build shared libraries. # For example, to build libfoo.so, you need to do the following: #LIBNAME=foo LIBNAME= +# STLIBNAME contains the path of the static library to build the shared +# library from, for example: +#STLIBNAME=libfoo.a +STLIBNAME= + +# On most Unix platforms, SHLIBNAME contains the path of the short name of +# the shared library to build, for example +#SHLIBNAME=libfoo.so +# On Windows POSIX layers (cygwin and mingw), SHLIBNAME contains the import +# library name for the shared library to be built, for example: +#SHLIBNAME=libfoo.dll.a + +# SHLIBNAME_FULL contains the path of the full name of the shared library to +# build, for example: +#SHLIBNAME_FULL=libfoo.so.1.2 +# When building DSOs, SHLIBNAME_FULL contains path of the full DSO name, for +# example: +#SHLIBNAME_FULL=dir/dso.so +SHLIBNAME_FULL= + +# SHLIBVERSION contains the current version of the shared library (not to +# be confused with the project version) +#SHLIBVERSION=1.2 +SHLIBVERSION= + +# NOTE: to build shared libraries, LIBNAME, STLIBNAME, SHLIBNAME and +# SHLIBNAME_FULL MUST have values when using this makefile, and in some +# cases, SHLIBVERSION as well. To build DSOs, SHLIBNAME_FULL MUST have +# a value, the rest can be left alone. + + +# APPNAME contains just the name of the application, without suffix ("" +# on Unix, ".exe" on Windows, ...). This one MUST have a value when using +# this makefile to build applications. +# For example, to build foo, you need to do the following: +#APPNAME=foo +APPNAME= + +# SRCDIR is the top directory of the source tree. +SRCDIR=. + +# OBJECTS contains all the object files to link together into the application. +# This must contain at least one object file. +#OBJECTS=foo.o +OBJECTS= + # LIBEXTRAS contains extra modules to link together with the library. -# For example, if a seond 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: #LIBEXTRAS=libbar.a -# Note that this MUST be used when using the link_o targets, to hold the -# names of all object files that go into the target library. +# 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 shared object. LIBEXTRAS= -# LIBVERSION contains the current version of the library. -# For example, to build libfoo.so.1.2, you need to do the following: -#LIBVERSION=1.2 -LIBVERSION= - -# LIBCOMPATVERSIONS contains the compatibility versions (a list) of -# the library. They MUST be in decreasing order. -# For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2 -# and libfoo.so.1, you need to do the following: -#LIBCOMPATVERSIONS=1.2 1 -# Note that on systems that use sonames, the last number will appear as -# part of it. -# It's also possible, for systems that support it (Tru64, for example), -# to add extra compatibility info with more precision, by adding a second -# list of versions, separated from the first with a semicolon, like this: -#LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0 -LIBCOMPATVERSIONS= - # LIBDEPS contains all the flags necessary to cover all necessary # dependencies to other libraries. LIBDEPS= @@ -53,525 +91,431 @@ LIBDEPS= #------------------------------------------------------------------------------ # The rest is private to this makefile. -#DEBUG=: -DEBUG=set -x +SET_X=: +#SET_X=set -x top: - echo "Trying to use this makefile interactively? Don't." - -CALC_VERSIONS= \ - SHLIB_COMPAT=; SHLIB_SOVER=; \ - if [ -n "$(LIBVERSION) $(LIBCOMPATVERSIONS)" ]; then \ - prev=""; \ - for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \ - SHLIB_SOVER=.$$v; \ - if [ -n "$$prev" ]; then \ - SHLIB_COMPAT=$$SHLIB_COMPAT .$$prev; \ - fi; \ - prev=$$v; \ - done; \ - fi + echo "Trying to use this makefile interactively? Don't." ; exit 1 + +LINK_APP= \ + ( $(SET_X); \ + LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \ + 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'`; \ + $(ECHO) LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ + $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS}; \ + LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ + $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} ) LINK_SO= \ - ( $(DEBUG); \ - nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \ - $$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER \ - $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \ - $(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp ) + ( $(SET_X); \ + LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \ + SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \ + SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_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'`; \ + $(ECHO) LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ + $${SHAREDCMD} $${SHAREDFLAGS} \ + -o $(SHLIBNAME_FULL) \ + $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS; \ + LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ + $${SHAREDCMD} $${SHAREDFLAGS} \ + -o $(SHLIBNAME_FULL) \ + $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \ + ) && $(SYMLINK_SO) + SYMLINK_SO= \ - if [ -n "$$SHLIB_COMPAT"]; then \ - prev=$$SHLIB$$SHLIB_SOVER; \ - for x in $$SHLIB_COMPAT; do \ - ( $(DEBUG); rm -f $$SHLIB$$x; \ - ln -s $$prev $$SHLIB$$x ); \ - prev=$$SHLIB$$x; \ - done; \ + if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \ + if [ -n "$(SHLIBNAME_FULL)" -a -n "$(SHLIBNAME)" -a \ + "$(SHLIBNAME_FULL)" != "$(SHLIBNAME)" ]; then \ + ( $(SET_X); \ + rm -f $(SHLIBNAME); \ + ln -s $(SHLIBNAME_FULL) $(SHLIBNAME) ); \ + fi; \ fi -LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO) -LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO) -LINK_SO_A_VIA_O= \ - SHOBJECTS=lib$(LIBNAME).o ALL=$$ALLSYMSFLAGS ALLSYMSFLAGS= NOALLSYMSFLAGS=; \ - ( $(DEBUG); \ - ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \ - $(LINK_SO) && rm -f $(LIBNAME).o -LINK_SO_A_UNPACKED= \ + +LINK_SO_SHLIB= SHOBJECTS="$(STLIBNAME) $(LIBEXTRAS)"; $(LINK_SO) +LINK_SO_DSO= INHIBIT_SYMLINKS=yes; SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO) + +LINK_SO_SHLIB_VIA_O= \ + SHOBJECTS=$(STLIBNAME).o; \ + ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \ + ( $(ECHO) ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(STLIBNAME) $(LIBEXTRAS); \ + ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(STLIBNAME) $(LIBEXTRAS) ); \ + $(LINK_SO) && ( $(ECHO) rm -f $$SHOBJECTS; rm -f $$SHOBJECTS ) + +LINK_SO_SHLIB_UNPACKED= \ UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \ - (cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && cp $(LIBEXTRAS) $$UNPACKDIR && \ + (cd $$UNPACKDIR; ar x ../$(STLIBNAME)) && \ + ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \ SHOBJECTS=$$UNPACKDIR/*.o; \ $(LINK_SO) && rm -rf $$UNPACKDIR -DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \ - my_ld=`gcc -print-prog-name=ld 2>&1` && \ - [ -n "$$my_ld" ] && \ - $$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1 - -link_o.gnu: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - NOALLSYMSFLAGS='-Wl,--no-whole-archive' \ - SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O) -link_a.gnu: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-Wl,--whole-archive' \ - NOALLSYMSFLAGS='-Wl,--no-whole-archive' \ - SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A) +DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null + +DO_GNU_SO_COMMON=\ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$(SHLIBNAME_FULL)" +DO_GNU_DSO=\ + $(DO_GNU_SO_COMMON) +DO_GNU_SO=\ + ALLSYMSFLAGS='-Wl,--whole-archive'; \ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ + $(DO_GNU_SO_COMMON) +DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS)" + +#This is rather special. It's a special target with which one can link +#applications without bothering with any features that have anything to +#do with shared libraries, for example when linking against static +#libraries. It's mostly here to avoid a lot of conditionals everywhere +#else... +link_app.: + $(LINK_APP) + +link_dso.gnu: + @ $(DO_GNU_DSO); $(LINK_SO_DSO) +link_shlib.gnu: + @ $(DO_GNU_SO); $(LINK_SO_SHLIB) +link_app.gnu: + @ $(DO_GNU_APP); $(LINK_APP) + +link_shlib.linux-shared: + @$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \ + $(DO_GNU_SO); \ + ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \ + $(LINK_SO_SHLIB) + +link_dso.bsd: + @if $(DETECT_GNU_LD); then $(DO_GNU_DSO); else \ + LIBDEPS=" "; \ + ALLSYMSFLAGS=; \ + NOALLSYMSFLAGS=; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ + fi; $(LINK_SO_DSO) +link_shlib.bsd: + @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ + LIBDEPS=" "; \ + ALLSYMSFLAGS="-Wl,-Bforcearchive"; \ + NOALLSYMSFLAGS=; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ + fi; $(LINK_SO_SHLIB) +link_app.bsd: + @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ + LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \ + fi; $(LINK_APP) # For Darwin AKA Mac OS/X (dyld) -link_o.darwin: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).dylib \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-all_load' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS="-current_version $(LIBVERSION) -compatibility_version $$SHLIB_SOVER" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O) -link_a.darwin: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME)$$SHLIB_SOVER.dylib \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-all_load' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS="-dynamiclib -current_version $(LIBVERSION) -compatibility_version $$SHLIB_SOVER" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A) - -link_o.cygwin: - @ SHLIB=cyg$(LIBNAME).dll \ - LIBDEPS="$(LIBDEPS)" \ - SHLIB_SOVER= \ - ALLSYMSFLAGS='-Wl,--whole-archive' \ - NOALLSYMSFLAGS='-Wl,--no-whole-archive' \ - SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \ - SHAREDCMD='${CC}'; \ - $(LINK_SO_O) -link_a.cygwin: - @ SHLIB=cyg$(LIBNAME).dll \ - LIBDEPS="$(LIBDEPS)" \ - SHLIB_SOVER= \ - ALLSYMSFLAGS='-Wl,--whole-archive' \ - NOALLSYMSFLAGS='-Wl,--no-whole-archive' \ - SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \ - SHAREDCMD='${CC}'; \ - $(LINK_SO_A) - -link_o.alpha-osf1: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ - else \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - 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' \ - NOALLSYMSFLAGS='-none' \ - SHAREDFLAGS="-shared -set_version \"$$SHLIB_HIST\"" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O); \ - fi -link_a.alpha-osf1: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ - else \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - 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' \ - NOALLSYMSFLAGS='-none' \ - SHAREDFLAGS="-shared -set_version \"$$SHLIB_HIST\"" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A); \ - fi +# Originally link_dso.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_dso.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_dso.darwin: + @ ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \ + $(LINK_SO_DSO) +link_shlib.darwin: + @ ALLSYMSFLAGS='-all_load'; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -current_version $(SHLIBVERSION) -compatibility_version $(SHLIBVERSION) -install_name $(INSTALLTOP)/$(LIBDIR)/$(SHLIBNAME_FULL)"; \ + $(LINK_SO_SHLIB) +link_app.darwin: # is there run-path on darwin? + $(LINK_APP) -# The difference between alpha-osf1-shared and tru64-shared is the `-msym' -# option passed to the linker. -link_o.tru64: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ +link_dso.cygwin: + @ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + base=-Wl,--enable-auto-image-base; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic"; \ + $(LINK_SO_DSO) +link_shlib.cygwin: + @ INHIBIT_SYMLINKS=yes; \ + $(ECHO) "$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) |" \ + "$(RC) $(SHARED_RCFLAGS) -o rc.o"; \ + $(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) | \ + $(RC) $(SHARED_RCFLAGS) -o rc.o; \ + ALLSYMSFLAGS='-Wl,--whole-archive'; \ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,--enable-auto-image-base -Wl,-Bsymbolic -Wl,--out-implib,$(SHLIBNAME) rc.o"; \ + $(LINK_SO_SHLIB) || exit 1; \ + rm rc.o +link_app.cygwin: + $(LINK_APP) + +# link_dso.mingw-shared and link_app.mingw-shared are mapped to the +# corresponding cygwin targets, as they do the exact same thing. +link_shlib.mingw: + @ INHIBIT_SYMLINKS=yes; \ + $(PERL) $(SRCDIR)/util/mkdef.pl 32 $(LIBNAME) \ + | sed -e 's|^\(LIBRARY *\)$(LIBNAME)32|\1$(SHLIBNAME_FULL)|' \ + > $(LIBNAME).def; \ + echo "$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) |" \ + "$(RC) $(SHARED_RCFLAGS) -o rc.o"; \ + $(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) | \ + $(RC) $(SHARED_RCFLAGS) -o rc.o; \ + ALLSYMSFLAGS='-Wl,--whole-archive'; \ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,--out-implib,$(SHLIBNAME) $(LIBNAME).def rc.o"; \ + $(LINK_SO_SHLIB) || exit 1; \ + rm $(LIBNAME).def rc.o + +link_dso.alpha-osf1: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_DSO); \ else \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - 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' \ - NOALLSYMSFLAGS='-none' \ - SHAREDFLAGS="-shared -msym -set_version \"$$SHLIB_HIST\"" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O); \ - fi -link_a.tru64: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \ + fi; \ + $(LINK_SO_DSO) +link_shlib.alpha-osf1: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_SO); \ else \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - 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' \ - NOALLSYMSFLAGS='-none' \ - SHAREDFLAGS="-shared -msym -set_version \"$$SHLIB_HIST\"" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A); \ - fi + ALLSYMSFLAGS='-all'; \ + NOALLSYMSFLAGS='-none'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic -set_version $(SHLIBVERSION)"; \ + fi; \ + $(LINK_SO_SHLIB) +link_app.alpha-osf1: + @if $(DETECT_GNU_LD); then \ + $(DO_GNU_APP); \ + else \ + LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \ + fi; \ + $(LINK_APP) -# The difference between tru64-shared and tru64-shared-rpath is the -# -rpath ${LIBRPATH} passed to the linker. -link_o.tru64-rpath: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ +link_dso.solaris: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_DSO); \ else \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - 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' \ - NOALLSYMSFLAGS='-none' \ - SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH) -set_version \"$$SHLIB_HIST\"" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O); \ - fi -link_a.tru64-rpath: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ + ALLSYMSFLAGS=""; \ + NOALLSYMSFLAGS=""; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $(SHLIBNAME_FULL) -Wl,-Bsymbolic"; \ + fi; \ + $(LINK_SO_DSO) +link_shlib.solaris: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_SO); \ else \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - 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' \ - NOALLSYMSFLAGS='-none' \ - SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH) -set_version \"$$SHLIB_HIST\"" \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A); \ - fi + $(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \ + ALLSYMSFLAGS="-Wl,-z,allextract,-M,$(LIBNAME).map"; \ + NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $(SHLIBNAME_FULL) -Wl,-Bsymbolic"; \ + fi; \ + $(LINK_SO_SHLIB) +link_app.solaris: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_APP); \ + else \ + LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \ + fi; \ + $(LINK_APP) -link_o.solaris: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ +# OpenServer 5 native compilers used +link_dso.svr3: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_DSO); \ else \ - $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-z allextract' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O); \ - fi -link_a.solaris: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) -G -h $(SHLIBNAME_FULL)"; \ + fi; \ + $(LINK_SO_DSO) +link_shlib.svr3: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_SO); \ else \ - $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-z allextract' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A); \ - fi + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) -G -h $(SHLIBNAME_FULL)"; \ + fi; \ + $(LINK_SO_SHLIB_UNPACKED) +link_app.svr3: + @$(DETECT_GNU_LD) && $(DO_GNU_APP); \ + $(LINK_APP) -# OpenServer 5 native compilers used # UnixWare 7 and OpenUNIX 8 native compilers used -link_o.svr3: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ +link_dso.svr5: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_DSO); \ else \ - $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-z allextract' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O); \ - fi -link_a.svr3: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ + SHARE_FLAG='-G'; \ + ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $(SHLIBNAME_FULL)"; \ + fi; \ + $(LINK_SO_DSO) +link_shlib.svr5: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_SO); \ else \ - $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-z allextract' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A_UNPACKED); \ - fi + SHARE_FLAG='-G'; \ + ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $(SHLIBNAME_FULL)"; \ + fi; \ + $(LINK_SO_SHLIB_UNPACKED) +link_app.svr5: + @$(DETECT_GNU_LD) && $(DO_GNU_APP); \ + $(LINK_APP) -link_o.irix: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ +link_dso.irix: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_DSO); \ else \ - $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-all' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O); \ - fi -link_a.irix: - @ if ${DETECT_GNU_LD}; then \ - $(MAKE) -f $(SHARED_MAKEFILE) CC="$(CC)" LDFLAGS="$(LDFLAGS) \ - SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \ - LIBNAME="$(LIBNAME)" LIBEXTRAS="$(LIBEXTRAS)" \ - LIBVERSION="$(LIBVERSION)" - LIBCOMPATVERSIONS="$(LIBCOMPATVERSIONS)" \ - LIBDEPS="$(LIBDEPS)" link_o.gnu; \ + ALLSYMSFLAGS=""; \ + NOALLSYMSFLAGS=""; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$(SHLIBNAME_FULL),-B,symbolic"; \ + fi; \ + $(LINK_SO_DSO) +link_shlib.irix: + @ if $(DETECT_GNU_LD); then \ + $(DO_GNU_SO); \ else \ - $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-all' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A); \ - fi + MINUSWL=""; \ + ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \ + ALLSYMSFLAGS="$${MINUSWL}-all"; \ + NOALLSYMSFLAGS="$${MINUSWL}-none"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$(SHLIBNAME_FULL),-B,symbolic"; \ + fi; \ + $(LINK_SO_SHLIB) +link_app.irix: + @LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \ + $(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. -# -# 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 \ - LIBDEPS="$(LIBDEPS) -lc" \ - ALLSYMSFLAGS='-Fl' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='/usr/ccs/bin/ld'; \ - $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER -link_a.hpux32: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).sl \ - LIBDEPS="$(LIBDEPS) -lc" \ - ALLSYMSFLAGS='-Fl' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='/usr/ccs/bin/ld'; \ - $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER - -# 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. +# 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]. # -# 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 \ - LIBDEPS="$(LIBDEPS) -lc" \ - ALLSYMSFLAGS='+forceload' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='/usr/ccs/bin/ld'; \ - $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER -link_a.hpux64: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).sl \ - LIBDEPS="$(LIBDEPS) -lc" \ - ALLSYMSFLAGS='+forceload' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER' \ - SHAREDCMD='/usr/ccs/bin/ld'; \ - $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER - -link_o.aix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-bnogc' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O) -link_a.aix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS='-bnogc' \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A_VIA_O) - -link_o.reliantunix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS= \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_O) -link_a.reliantunix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - LIBDEPS="$(LIBDEPS)" \ - ALLSYMSFLAGS= \ - NOALLSYMSFLAGS='' \ - SHAREDFLAGS='-G' \ - SHAREDCMD='$(CC)'; \ - $(LINK_SO_A_UNPACKED) +link_dso.hpux: + @if $(DETECT_GNU_LD); then $(DO_GNU_DSO); else \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$(SHLIBNAME_FULL),+cdp,../:,+cdp,./:"; \ + fi; \ + rm -f $(SHLIBNAME_FULL) || :; \ + $(LINK_SO_DSO) && chmod a=rx $(SHLIBNAME_FULL) +link_shlib.hpux: + @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ + ALLSYMSFLAGS='-Wl,-Fl'; \ + NOALLSYMSFLAGS=''; \ + expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$(SHLIBNAME_FULL),+cdp,../:,+cdp,./:"; \ + fi; \ + rm -f $(SHLIBNAME_FULL) || :; \ + $(LINK_SO_SHLIB) && chmod a=rx $(SHLIBNAME_FULL) +link_app.hpux: + @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ + LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:"; \ + fi; \ + $(LINK_APP) + +link_dso.aix: + @OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \ + OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \ + ALLSYMSFLAGS=''; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \ + rm -f $(SHLIBNAME_FULL) 2>&1 > /dev/null ; \ + $(LINK_SO_DSO); +link_shlib.aix: + @ OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \ + OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \ + ALLSYMSFLAGS='-bnogc'; \ + NOALLSYMSFLAGS=''; \ + SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \ + rm -f $(SHLIBNAME_FULL) 2>&1 > /dev/null ; \ + $(LINK_SO_SHLIB_VIA_O) +link_app.aix: + LDFLAGS="$(CFLAGS) -Wl,-bsvr4 $(LDFLAGS)"; \ + $(LINK_APP) + # Targets to build symbolic links when needed -symlink.gnu symlink.darwin symlink.solaris symlink.svr3 symlink.irix \ -symlink.aix symlink.reliantunix: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).so \ - $(SYMLINK_SO) -symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath: -symlink.hpux32 symlink.hpux64: - @ $(CALC_VERSIONS); \ - SHLIB=lib$(LIBNAME).sl \ - $(SYMLINK_SO) +symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \ +symlink.aix: + @ $(SYMLINK_SO) +symlink.darwin: + @ $(SYMLINK_SO) +symlink.hpux: + @ $(SYMLINK_SO) +# The following lines means those specific architectures do no symlinks +symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath: # Compatibility targets -link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu -link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu -symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu -link_o.darwin-shared: link_o.darwin -link_a.darwin-shared: link_a.darwin +link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared: link_dso.gnu +link_shlib.bsd-gcc-shared: link_shlib.linux-shared +link_shlib.gnu-shared: link_shlib.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 +link_dso.bsd-shared: link_dso.bsd +link_shlib.bsd-shared: link_shlib.bsd +link_app.bsd-shared: link_app.bsd +link_dso.darwin-shared: link_dso.darwin +link_shlib.darwin-shared: link_shlib.darwin +link_app.darwin-shared: link_app.darwin symlink.darwin-shared: symlink.darwin -link_o.cygwin-shared: link_o.cygwin -link_a.cygwin-shared: link_a.cygwin +link_dso.cygwin-shared: link_dso.cygwin +link_shlib.cygwin-shared: link_shlib.cygwin +link_app.cygwin-shared: link_app.cygwin symlink.cygwin-shared: symlink.cygwin -link_o.alpha-osf1-shared: link_o.alpha-osf1 -link_a.alpha-osf1-shared: link_a.alpha-osf1 +link_dso.mingw-shared: link_dso.cygwin +link_shlib.mingw-shared: link_shlib.mingw +link_app.mingw-shared: link_app.cygwin +symlink.mingw-shared: symlink.cygwin +link_dso.alpha-osf1-shared: link_dso.alpha-osf1 +link_shlib.alpha-osf1-shared: link_shlib.alpha-osf1 +link_app.alpha-osf1-shared: link_app.alpha-osf1 symlink.alpha-osf1-shared: symlink.alpha-osf1 -link_o.tru64-shared: link_o.tru64 -link_a.tru64-shared: link_a.tru64 +link_dso.tru64-shared: link_dso.tru64 +link_shlib.tru64-shared: link_shlib.tru64 +link_app.tru64-shared: link_app.tru64 symlink.tru64-shared: symlink.tru64 -link_o.tru64-shared-rpath: link_o.tru64-rpath -link_a.tru64-shared-rpath: link_a.tru64-rpath +link_dso.tru64-shared-rpath: link_dso.tru64-rpath +link_shlib.tru64-shared-rpath: link_shlib.tru64-rpath +link_app.tru64-shared-rpath: link_app.tru64-rpath symlink.tru64-shared-rpath: symlink.tru64-rpath -link_o.solaris-shared: link_o.solaris -link_a.solaris-shared: link_a.solaris +link_dso.solaris-shared: link_dso.solaris +link_shlib.solaris-shared: link_shlib.solaris +link_app.solaris-shared: link_app.solaris symlink.solaris-shared: symlink.solaris -link_o.svr3-shared: link_o.svr3 -link_a.svr3-shared: link_a.svr3 +link_dso.svr3-shared: link_dso.svr3 +link_shlib.svr3-shared: link_shlib.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 -symlink.svr5-shared: symlink.svr3 -link_o.irix-shared: link_o.irix -link_a.irix-shared: link_a.irix +link_dso.svr5-shared: link_dso.svr5 +link_shlib.svr5-shared: link_shlib.svr5 +link_app.svr5-shared: link_app.svr5 +symlink.svr5-shared: symlink.svr5 +link_dso.irix-shared: link_dso.irix +link_shlib.irix-shared: link_shlib.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 -symlink.hpux-shared: symlink.hpux32 -link_o.hpux64-shared: link_o.hpux64 -link_a.hpux64-shared: link_a.hpux64 -symlink.hpux64-shared: symlink.hpux64 -link_o.aix-shared: link_o.aix -link_a.aix-shared: link_a.aix +link_dso.hpux-shared: link_dso.hpux +link_shlib.hpux-shared: link_shlib.hpux +link_app.hpux-shared: link_app.hpux +symlink.hpux-shared: symlink.hpux +link_dso.aix-shared: link_dso.aix +link_shlib.aix-shared: link_shlib.aix +link_app.aix-shared: link_app.aix symlink.aix-shared: symlink.aix -link_o.reliantunix-shared: link_o.reliantunix -link_a.reliantunix-shared: link_a.reliantunix -symlink.reliantunix-shared: symlink.reliantunix