2002-10-11 00:37:11 +00:00
|
|
|
#
|
|
|
|
# Helper makefile to link shared libraries in a portable way.
|
|
|
|
# This is much simpler than libtool, and hopefully not too error-prone.
|
|
|
|
#
|
|
|
|
# The following variables need to be set on the command line to build
|
|
|
|
# properly
|
|
|
|
|
|
|
|
# CC contains the current compiler. This one MUST be defined
|
|
|
|
CC=cc
|
2005-05-15 23:59:04 +00:00
|
|
|
CFLAGS=$(CFLAG)
|
2003-02-13 23:52:54 +00:00
|
|
|
# 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.
|
2002-10-11 00:37:11 +00:00
|
|
|
LDFLAGS=
|
|
|
|
SHARED_LDFLAGS=
|
|
|
|
|
2006-10-21 13:38:16 +00:00
|
|
|
NM=nm
|
|
|
|
|
2003-02-13 23:52:54 +00:00
|
|
|
# LIBNAME contains just the name of the library, without prefix ("lib"
|
2002-10-11 00:37:11 +00:00
|
|
|
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
|
2003-02-13 23:52:54 +00:00
|
|
|
# .dll, ...). This one MUST have a value when using this makefile to
|
|
|
|
# build shared libraries.
|
2002-10-11 00:37:11 +00:00
|
|
|
# For example, to build libfoo.so, you need to do the following:
|
|
|
|
#LIBNAME=foo
|
|
|
|
LIBNAME=
|
|
|
|
|
2003-02-13 23:52:54 +00:00
|
|
|
# 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=
|
|
|
|
|
|
|
|
# OBJECTS contains all the object files to link together into the application.
|
|
|
|
# This must contain at least one object file.
|
|
|
|
#OBJECTS=foo.o
|
|
|
|
OBJECTS=
|
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
# LIBEXTRAS contains extra modules to link together with the library.
|
2002-11-06 23:39:03 +00:00
|
|
|
# For example, if a second library, say libbar.a needs to be linked into
|
2002-10-11 00:37:11 +00:00
|
|
|
# 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.
|
|
|
|
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=
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# The rest is private to this makefile.
|
|
|
|
|
2005-05-16 00:01:49 +00:00
|
|
|
SET_X=:
|
|
|
|
#SET_X=set -x
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
top:
|
|
|
|
echo "Trying to use this makefile interactively? Don't."
|
|
|
|
|
|
|
|
CALC_VERSIONS= \
|
|
|
|
SHLIB_COMPAT=; SHLIB_SOVER=; \
|
2002-10-11 11:14:41 +00:00
|
|
|
if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
|
2002-10-11 00:37:11 +00:00
|
|
|
prev=""; \
|
|
|
|
for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB_SOVER_NODOT=$$v; \
|
2002-10-11 00:37:11 +00:00
|
|
|
SHLIB_SOVER=.$$v; \
|
|
|
|
if [ -n "$$prev" ]; then \
|
2002-10-14 09:24:50 +00:00
|
|
|
SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
|
2002-10-11 00:37:11 +00:00
|
|
|
fi; \
|
|
|
|
prev=$$v; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
2003-02-13 23:52:54 +00:00
|
|
|
LINK_APP= \
|
2005-02-06 13:18:40 +00:00
|
|
|
( $(SET_X); \
|
2005-06-22 23:42:34 +00:00
|
|
|
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
|
|
|
|
LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
|
2003-04-08 09:27:43 +00:00
|
|
|
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`; \
|
2003-04-08 08:57:23 +00:00
|
|
|
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
2003-04-08 08:36:20 +00:00
|
|
|
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
2005-06-22 23:42:34 +00:00
|
|
|
$${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
|
2003-02-13 23:52:54 +00:00
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
LINK_SO= \
|
2005-02-06 13:18:40 +00:00
|
|
|
( $(SET_X); \
|
2005-06-22 23:42:34 +00:00
|
|
|
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
|
|
|
|
SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
|
|
|
|
SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
|
2006-10-21 13:38:16 +00:00
|
|
|
$(NM) -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
|
2003-04-08 09:27:43 +00:00
|
|
|
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`; \
|
2003-04-08 08:57:23 +00:00
|
|
|
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
2003-04-08 08:36:20 +00:00
|
|
|
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
2005-06-22 23:42:34 +00:00
|
|
|
$${SHAREDCMD} $${SHAREDFLAGS} \
|
2005-05-15 23:59:04 +00:00
|
|
|
-o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
|
|
|
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
|
|
|
|
) && $(SYMLINK_SO); \
|
|
|
|
( $(SET_X); rm -f lib$(LIBNAME).exp )
|
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
SYMLINK_SO= \
|
2002-11-15 16:56:36 +00:00
|
|
|
if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
|
|
|
|
prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
|
|
|
|
if [ -n "$$SHLIB_COMPAT" ]; then \
|
|
|
|
for x in $$SHLIB_COMPAT; do \
|
2005-02-06 13:18:40 +00:00
|
|
|
( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
|
2002-11-15 16:56:36 +00:00
|
|
|
ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
|
|
|
|
prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
|
|
|
|
done; \
|
|
|
|
fi; \
|
|
|
|
if [ -n "$$SHLIB_SOVER" ]; then \
|
2005-02-06 13:18:40 +00:00
|
|
|
( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
|
2002-11-15 16:56:36 +00:00
|
|
|
ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
|
|
|
|
fi; \
|
2002-10-11 00:37:11 +00:00
|
|
|
fi
|
2002-10-11 11:14:41 +00:00
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
|
|
|
|
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
|
2005-05-15 23:59:04 +00:00
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
LINK_SO_A_VIA_O= \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHOBJECTS=lib$(LIBNAME).o; \
|
|
|
|
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
|
2005-02-06 13:18:40 +00:00
|
|
|
( $(SET_X); \
|
2002-10-11 00:37:11 +00:00
|
|
|
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
|
|
|
|
$(LINK_SO) && rm -f $(LIBNAME).o
|
2005-05-15 23:59:04 +00:00
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
LINK_SO_A_UNPACKED= \
|
|
|
|
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
|
2003-04-08 08:36:20 +00:00
|
|
|
(cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \
|
|
|
|
([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
|
2002-10-11 00:37:11 +00:00
|
|
|
SHOBJECTS=$$UNPACKDIR/*.o; \
|
|
|
|
$(LINK_SO) && rm -rf $$UNPACKDIR
|
|
|
|
|
2002-12-14 20:52:19 +00:00
|
|
|
DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
|
|
|
|
2003-02-13 23:52:54 +00:00
|
|
|
DO_GNU_SO=$(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
|
|
|
|
|
|
|
|
DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
|
2002-10-15 12:09:22 +00:00
|
|
|
|
2003-02-22 14:41:34 +00:00
|
|
|
#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)
|
|
|
|
|
2002-10-15 12:09:22 +00:00
|
|
|
link_o.gnu:
|
2003-02-13 23:52:54 +00:00
|
|
|
@ $(DO_GNU_SO); $(LINK_SO_O)
|
2002-10-11 00:37:11 +00:00
|
|
|
link_a.gnu:
|
2003-02-13 23:52:54 +00:00
|
|
|
@ $(DO_GNU_SO); $(LINK_SO_A)
|
|
|
|
link_app.gnu:
|
|
|
|
@ $(DO_GNU_APP); $(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
2006-04-11 21:34:21 +00:00
|
|
|
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)
|
|
|
|
|
2004-08-29 21:36:37 +00:00
|
|
|
link_o.bsd:
|
|
|
|
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2005-05-15 23:59:04 +00:00
|
|
|
LIBDEPS=" "; \
|
2004-08-29 21:36:37 +00:00
|
|
|
ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
|
|
|
|
NOALLSYMSFLAGS=; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
2004-08-29 21:36:37 +00:00
|
|
|
fi; $(LINK_SO_O)
|
|
|
|
link_a.bsd:
|
|
|
|
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2005-05-15 23:59:04 +00:00
|
|
|
LIBDEPS=" "; \
|
2004-08-29 21:36:37 +00:00
|
|
|
ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
|
|
|
|
NOALLSYMSFLAGS=; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
2004-08-29 21:36:37 +00:00
|
|
|
fi; $(LINK_SO_A)
|
|
|
|
link_app.bsd:
|
|
|
|
@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
|
2005-01-26 23:51:20 +00:00
|
|
|
LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
|
2004-08-29 21:36:37 +00:00
|
|
|
fi; $(LINK_APP)
|
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
# For Darwin AKA Mac OS/X (dyld)
|
2005-10-25 21:58:59 +00:00
|
|
|
# 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.
|
2002-10-11 00:37:11 +00:00
|
|
|
link_o.darwin:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME); \
|
2005-10-25 21:58:59 +00:00
|
|
|
SHLIB_SUFFIX=.so; \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-all_load'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-06-23 20:44:27 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
if [ -n "$(LIBVERSION)" ]; then \
|
2002-12-16 23:35:17 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
fi; \
|
|
|
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
2002-12-16 23:35:17 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
fi; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(LINK_SO_O)
|
|
|
|
link_a.darwin:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME); \
|
|
|
|
SHLIB_SUFFIX=.dylib; \
|
|
|
|
ALLSYMSFLAGS='-all_load'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-06-23 20:44:27 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
if [ -n "$(LIBVERSION)" ]; then \
|
2002-12-16 23:35:17 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
fi; \
|
|
|
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
2002-12-16 23:35:17 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
fi; \
|
2005-10-28 08:10:47 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -install_name ${INSTALLTOP}/lib/$$SHLIB${SHLIB_EXT}"; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(LINK_SO_A)
|
2005-05-15 23:59:04 +00:00
|
|
|
link_app.darwin: # is there run-path on darwin?
|
2003-02-13 23:52:54 +00:00
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
link_o.cygwin:
|
2002-11-15 16:56:36 +00:00
|
|
|
@ $(CALC_VERSIONS); \
|
|
|
|
INHIBIT_SYMLINKS=yes; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=cyg$(LIBNAME); \
|
2006-10-23 07:30:19 +00:00
|
|
|
expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB_SUFFIX=.dll; \
|
2005-05-21 16:41:34 +00:00
|
|
|
LIBVERSION="$(LIBVERSION)"; \
|
|
|
|
SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2006-10-24 22:14:20 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-s,-Bsymbolic"; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(LINK_SO_O)
|
|
|
|
link_a.cygwin:
|
2002-11-15 16:56:36 +00:00
|
|
|
@ $(CALC_VERSIONS); \
|
|
|
|
INHIBIT_SYMLINKS=yes; \
|
2006-10-24 22:14:20 +00:00
|
|
|
SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
|
|
|
|
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
|
2006-10-23 07:30:19 +00:00
|
|
|
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
2006-10-23 11:54:18 +00:00
|
|
|
SHLIB=$(LIBNAME); SHLIB_SOVER=32; \
|
2006-10-24 22:14:20 +00:00
|
|
|
extras="$(LIBNAME).def"; \
|
|
|
|
$(PERL) util/mkdef.pl 32 $(LIBNAME) > $$extras; \
|
2006-10-23 07:30:19 +00:00
|
|
|
fi; \
|
2006-10-24 22:14:20 +00:00
|
|
|
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
|
|
|
|
$(PERL) util/mkrc.pl $$dll_name | \
|
|
|
|
$(CROSS_COMPILE_PREFIX)windres -o rc.o; \
|
|
|
|
extras="$$extras rc.o"; \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2005-05-21 16:41:34 +00:00
|
|
|
base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
|
2006-10-24 22:14:20 +00:00
|
|
|
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; \
|
2005-04-30 23:45:53 +00:00
|
|
|
$(LINK_SO_A) || exit 1; \
|
2006-10-24 22:14:20 +00:00
|
|
|
rm $$extras; \
|
|
|
|
cp -p $$dll_name apps/; \
|
|
|
|
cp -p $$dll_name test/
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.cygwin:
|
2006-10-24 22:14:20 +00:00
|
|
|
@if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \
|
|
|
|
LIBDEPS="$(TOP)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \
|
|
|
|
export LIBDEPS; \
|
|
|
|
fi; \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
link_o.alpha-osf1:
|
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2002-10-11 00:37:11 +00:00
|
|
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
|
|
|
if [ -n "$$SHLIB_HIST" ]; then \
|
|
|
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
|
|
|
else \
|
|
|
|
SHLIB_HIST="$(LIBVERSION)"; \
|
2002-12-16 23:35:17 +00:00
|
|
|
fi; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB_SOVER=; \
|
|
|
|
ALLSYMSFLAGS='-all'; \
|
|
|
|
NOALLSYMSFLAGS='-none'; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
if [ -n "$$SHLIB_HIST" ]; then \
|
2005-12-16 20:51:03 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
fi; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2002-10-11 00:37:11 +00:00
|
|
|
link_a.alpha-osf1:
|
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2002-10-11 00:37:11 +00:00
|
|
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
|
|
|
if [ -n "$$SHLIB_HIST" ]; then \
|
|
|
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
|
|
|
else \
|
|
|
|
SHLIB_HIST="$(LIBVERSION)"; \
|
2002-12-16 23:35:17 +00:00
|
|
|
fi; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB_SOVER=; \
|
|
|
|
ALLSYMSFLAGS='-all'; \
|
|
|
|
NOALLSYMSFLAGS='-none'; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
if [ -n "$$SHLIB_HIST" ]; then \
|
2005-12-16 20:51:03 +00:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
|
2002-10-11 19:56:57 +00:00
|
|
|
fi; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.alpha-osf1:
|
2005-05-15 23:59:04 +00:00
|
|
|
@if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_APP); \
|
|
|
|
else \
|
2005-01-26 23:51:20 +00:00
|
|
|
LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
link_o.solaris:
|
2002-10-14 09:24:50 +00:00
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-16 20:33:38 +00:00
|
|
|
MINUSZ='-z '; \
|
2005-05-15 23:59:04 +00:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
|
|
|
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2002-10-11 00:37:11 +00:00
|
|
|
link_a.solaris:
|
2002-10-14 09:24:50 +00:00
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-16 20:33:38 +00:00
|
|
|
MINUSZ='-z '; \
|
|
|
|
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=;\
|
|
|
|
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
|
|
|
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.solaris:
|
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
|
|
|
$(DO_GNU_APP); \
|
|
|
|
else \
|
2005-01-26 23:51:20 +00:00
|
|
|
LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
# OpenServer 5 native compilers used
|
|
|
|
link_o.svr3:
|
2003-04-08 09:27:43 +00:00
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
|
|
|
$(DO_GNU_SO); \
|
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-26 23:51:20 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2003-04-08 09:27:43 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
|
|
|
link_a.svr3:
|
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
|
|
|
$(DO_GNU_SO); \
|
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-26 23:51:20 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2003-04-08 09:27:43 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A_UNPACKED)
|
|
|
|
link_app.svr3:
|
2005-05-15 23:59:04 +00:00
|
|
|
@${DETECT_GNU_LD} && $(DO_GNU_APP); \
|
2003-04-08 09:27:43 +00:00
|
|
|
$(LINK_APP)
|
|
|
|
|
|
|
|
# UnixWare 7 and OpenUNIX 8 native compilers used
|
|
|
|
link_o.svr5:
|
2002-10-11 00:37:11 +00:00
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2003-04-01 10:59:15 +00:00
|
|
|
SHARE_FLAG='-G'; \
|
2005-05-15 23:59:04 +00:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2003-04-08 08:36:20 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-26 23:51:20 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2003-04-08 09:27:43 +00:00
|
|
|
link_a.svr5:
|
2002-10-11 00:37:11 +00:00
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2003-04-01 10:59:15 +00:00
|
|
|
SHARE_FLAG='-G'; \
|
2003-04-08 08:36:20 +00:00
|
|
|
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2003-04-08 08:36:20 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-26 23:51:20 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A_UNPACKED)
|
2003-04-08 09:27:43 +00:00
|
|
|
link_app.svr5:
|
2005-05-15 23:59:04 +00:00
|
|
|
@${DETECT_GNU_LD} && $(DO_GNU_APP); \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
link_o.irix:
|
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2004-03-12 21:52:54 +00:00
|
|
|
MINUSWL=""; \
|
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
|
|
|
|
ALLSYMSFLAGS="$${MINUSWL}-all"; \
|
2004-12-27 14:59:36 +00:00
|
|
|
NOALLSYMSFLAGS="$${MINUSWL}-none"; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2002-10-11 00:37:11 +00:00
|
|
|
link_a.irix:
|
|
|
|
@ if ${DETECT_GNU_LD}; then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2004-03-12 21:52:54 +00:00
|
|
|
MINUSWL=""; \
|
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
|
|
|
|
ALLSYMSFLAGS="$${MINUSWL}-all"; \
|
2004-12-27 14:59:36 +00:00
|
|
|
NOALLSYMSFLAGS="$${MINUSWL}-none"; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.irix:
|
2005-05-15 23:59:04 +00:00
|
|
|
@LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
2004-05-31 22:29:26 +00:00
|
|
|
# 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].
|
2002-10-11 00:37:11 +00:00
|
|
|
#
|
2004-05-28 22:18:48 +00:00
|
|
|
link_o.hpux:
|
2004-05-28 22:38:05 +00:00
|
|
|
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).sl; \
|
2006-05-20 08:52:34 +00:00
|
|
|
expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB_SUFFIX=; \
|
2004-05-27 22:23:40 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,-Fl'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2004-05-28 22:18:48 +00:00
|
|
|
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2004-05-28 22:38:05 +00:00
|
|
|
fi; \
|
2005-06-23 15:36:15 +00:00
|
|
|
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
|
2002-10-11 07:33:38 +00:00
|
|
|
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
2004-05-28 22:18:48 +00:00
|
|
|
link_a.hpux:
|
2004-05-28 22:38:05 +00:00
|
|
|
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).sl; \
|
2004-07-24 14:17:32 +00:00
|
|
|
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB_SUFFIX=; \
|
2004-05-27 22:23:40 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,-Fl'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2004-05-28 22:18:48 +00:00
|
|
|
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2004-05-28 22:38:05 +00:00
|
|
|
fi; \
|
2005-06-23 15:36:15 +00:00
|
|
|
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
|
2002-10-11 07:33:38 +00:00
|
|
|
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
2004-05-28 22:18:48 +00:00
|
|
|
link_app.hpux:
|
2004-05-28 22:38:05 +00:00
|
|
|
@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
|
2005-01-26 23:51:20 +00:00
|
|
|
LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
|
2004-05-28 22:38:05 +00:00
|
|
|
fi; \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
link_o.aix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2005-02-06 13:18:40 +00:00
|
|
|
OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]\([0-9]*\)'`; \
|
|
|
|
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2007-03-22 08:46:33 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2007-03-22 08:46:33 +00:00
|
|
|
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -G -bexpall -bnolibpath -bM:SRE'; \
|
|
|
|
$(LINK_SO_O);
|
2002-10-11 00:37:11 +00:00
|
|
|
link_a.aix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2005-02-06 13:18:40 +00:00
|
|
|
OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]\([0-9]*\)'`; \
|
|
|
|
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS='-bnogc'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2007-03-22 08:46:33 +00:00
|
|
|
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -G -bexpall -bnolibpath -bM:SRE'; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(LINK_SO_A_VIA_O)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.aix:
|
2007-03-22 08:46:33 +00:00
|
|
|
LDFLAGS="$(CFLAGS) -brtl -blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
link_o.reliantunix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS=; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-26 23:51:20 +00:00
|
|
|
SHAREDFLAGS='$(CFLAGS) -G'; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(LINK_SO_O)
|
|
|
|
link_a.reliantunix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS=; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-26 23:51:20 +00:00
|
|
|
SHAREDFLAGS='$(CFLAGS) -G'; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(LINK_SO_A_UNPACKED)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.reliantunix:
|
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
# Targets to build symbolic links when needed
|
2003-04-08 09:27:43 +00:00
|
|
|
symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.aix symlink.reliantunix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-11-15 16:56:36 +00:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(SYMLINK_SO)
|
2002-10-11 07:33:38 +00:00
|
|
|
symlink.darwin:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-19 21:13:29 +00:00
|
|
|
SHLIB=lib$(LIBNAME); \
|
2002-11-15 16:56:36 +00:00
|
|
|
SHLIB_SUFFIX=.dylib; \
|
2002-10-11 07:33:38 +00:00
|
|
|
$(SYMLINK_SO)
|
2004-05-28 22:18:48 +00:00
|
|
|
symlink.hpux:
|
2002-10-11 00:37:11 +00:00
|
|
|
@ $(CALC_VERSIONS); \
|
2002-11-15 16:56:36 +00:00
|
|
|
SHLIB=lib$(LIBNAME).sl; \
|
2004-07-24 14:17:32 +00:00
|
|
|
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
2002-10-11 00:37:11 +00:00
|
|
|
$(SYMLINK_SO)
|
2002-11-15 16:56:36 +00:00
|
|
|
# The following lines means those specific architectures do no symlinks
|
2006-04-11 21:34:21 +00:00
|
|
|
symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos:
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
# 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
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
|
2004-08-29 21:36:37 +00:00
|
|
|
symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
|
|
|
|
link_o.bsd-shared: link_o.bsd
|
|
|
|
link_a.bsd-shared: link_a.bsd
|
|
|
|
link_app.bsd-shared: link_app.bsd
|
2002-10-11 00:37:11 +00:00
|
|
|
link_o.darwin-shared: link_o.darwin
|
|
|
|
link_a.darwin-shared: link_a.darwin
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.darwin-shared: link_app.darwin
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.darwin-shared: symlink.darwin
|
|
|
|
link_o.cygwin-shared: link_o.cygwin
|
|
|
|
link_a.cygwin-shared: link_a.cygwin
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.cygwin-shared: link_app.cygwin
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.cygwin-shared: symlink.cygwin
|
|
|
|
link_o.alpha-osf1-shared: link_o.alpha-osf1
|
|
|
|
link_a.alpha-osf1-shared: link_a.alpha-osf1
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.alpha-osf1-shared: link_app.alpha-osf1
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.alpha-osf1-shared: symlink.alpha-osf1
|
|
|
|
link_o.tru64-shared: link_o.tru64
|
|
|
|
link_a.tru64-shared: link_a.tru64
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.tru64-shared: link_app.tru64
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.tru64-shared: symlink.tru64
|
|
|
|
link_o.tru64-shared-rpath: link_o.tru64-rpath
|
|
|
|
link_a.tru64-shared-rpath: link_a.tru64-rpath
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.tru64-shared-rpath: link_app.tru64-rpath
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.tru64-shared-rpath: symlink.tru64-rpath
|
|
|
|
link_o.solaris-shared: link_o.solaris
|
|
|
|
link_a.solaris-shared: link_a.solaris
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.solaris-shared: link_app.solaris
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.solaris-shared: symlink.solaris
|
|
|
|
link_o.svr3-shared: link_o.svr3
|
|
|
|
link_a.svr3-shared: link_a.svr3
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.svr3-shared: link_app.svr3
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.svr3-shared: symlink.svr3
|
2003-04-08 09:27:43 +00:00
|
|
|
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
|
2002-10-11 00:37:11 +00:00
|
|
|
link_o.irix-shared: link_o.irix
|
|
|
|
link_a.irix-shared: link_a.irix
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.irix-shared: link_app.irix
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.irix-shared: symlink.irix
|
2004-05-28 22:18:48 +00:00
|
|
|
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
|
2002-10-11 00:37:11 +00:00
|
|
|
link_o.aix-shared: link_o.aix
|
|
|
|
link_a.aix-shared: link_a.aix
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.aix-shared: link_app.aix
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.aix-shared: symlink.aix
|
|
|
|
link_o.reliantunix-shared: link_o.reliantunix
|
|
|
|
link_a.reliantunix-shared: link_a.reliantunix
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.reliantunix-shared: link_app.reliantunix
|
2002-10-11 00:37:11 +00:00
|
|
|
symlink.reliantunix-shared: symlink.reliantunix
|
2006-04-11 21:34:21 +00:00
|
|
|
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
|