2002-10-11 08:37:11 +08: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-16 07:59:04 +08:00
|
|
|
CFLAGS=$(CFLAG)
|
2003-02-14 07:52:54 +08: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.
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDFLAGS=$(LDFLAG)
|
|
|
|
SHARED_LDFLAGS=$(SHARED_LDFLAG)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
2016-02-05 22:17:33 +08:00
|
|
|
# SHARED_RCFLAGS are flags used with windres, i.e. when build for Cygwin
|
|
|
|
# or Mingw.
|
|
|
|
SHARED_RCFLAGS=$(SHARED_RCFLAG)
|
|
|
|
|
2006-10-21 21:38:16 +08:00
|
|
|
NM=nm
|
|
|
|
|
2003-02-14 07:52:54 +08:00
|
|
|
# LIBNAME contains just the name of the library, without prefix ("lib"
|
2002-10-11 08:37:11 +08:00
|
|
|
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
|
2003-02-14 07:52:54 +08:00
|
|
|
# .dll, ...). This one MUST have a value when using this makefile to
|
|
|
|
# build shared libraries.
|
2002-10-11 08:37:11 +08:00
|
|
|
# For example, to build libfoo.so, you need to do the following:
|
|
|
|
#LIBNAME=foo
|
|
|
|
LIBNAME=
|
|
|
|
|
2003-02-14 07:52:54 +08: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=
|
|
|
|
|
2016-01-30 07:03:58 +08:00
|
|
|
# DSTDIR is the directory where the built file should end up in.
|
|
|
|
DSTDIR=.
|
|
|
|
|
|
|
|
# SRCDIR is the top directory of the source tree.
|
|
|
|
SRCDIR=.
|
|
|
|
|
2003-02-14 07:52:54 +08:00
|
|
|
# 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 08:37:11 +08:00
|
|
|
# LIBEXTRAS contains extra modules to link together with the library.
|
2002-11-07 07:39:03 +08:00
|
|
|
# For example, if a second library, say libbar.a needs to be linked into
|
2002-10-11 08:37:11 +08: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 08:01:49 +08:00
|
|
|
SET_X=:
|
2010-07-15 21:55:38 +08:00
|
|
|
#SET_X=set -x
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
top:
|
|
|
|
echo "Trying to use this makefile interactively? Don't."
|
|
|
|
|
|
|
|
CALC_VERSIONS= \
|
|
|
|
SHLIB_COMPAT=; SHLIB_SOVER=; \
|
2002-10-11 19:14:41 +08:00
|
|
|
if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
|
2002-10-11 08:37:11 +08:00
|
|
|
prev=""; \
|
|
|
|
for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB_SOVER_NODOT=$$v; \
|
2002-10-11 08:37:11 +08:00
|
|
|
SHLIB_SOVER=.$$v; \
|
|
|
|
if [ -n "$$prev" ]; then \
|
2002-10-14 17:24:50 +08:00
|
|
|
SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
|
2002-10-11 08:37:11 +08:00
|
|
|
fi; \
|
|
|
|
prev=$$v; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
2003-02-14 07:52:54 +08:00
|
|
|
LINK_APP= \
|
2005-02-06 21:18:40 +08:00
|
|
|
( $(SET_X); \
|
2005-06-23 07:42:34 +08:00
|
|
|
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS) $(LDFLAGS)}"; \
|
2009-01-02 17:02:27 +08:00
|
|
|
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
|
2003-04-08 16:57:23 +08:00
|
|
|
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
2016-02-05 19:20:19 +08:00
|
|
|
echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
|
|
|
$${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS}; \
|
2003-04-08 16:36:20 +08:00
|
|
|
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
2005-06-23 07:42:34 +08:00
|
|
|
$${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
|
2003-02-14 07:52:54 +08:00
|
|
|
|
2002-10-11 08:37:11 +08:00
|
|
|
LINK_SO= \
|
2005-02-06 21:18:40 +08:00
|
|
|
( $(SET_X); \
|
2005-06-23 07:42:34 +08:00
|
|
|
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
|
|
|
|
SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
|
|
|
|
SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
|
2009-01-02 17:02:27 +08:00
|
|
|
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
|
2003-04-08 16:57:23 +08:00
|
|
|
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
2016-02-05 19:20:19 +08:00
|
|
|
echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
|
|
|
$${SHAREDCMD} $${SHAREDFLAGS} \
|
2016-01-30 07:03:58 +08:00
|
|
|
-o $(DSTDIR)/$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
|
2016-02-05 19:20:19 +08:00
|
|
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS; \
|
2003-04-08 16:36:20 +08:00
|
|
|
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
2005-06-23 07:42:34 +08:00
|
|
|
$${SHAREDCMD} $${SHAREDFLAGS} \
|
2016-01-30 07:03:58 +08:00
|
|
|
-o $(DSTDIR)/$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
|
2005-05-16 07:59:04 +08:00
|
|
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
|
2007-08-01 02:24:41 +08:00
|
|
|
) && $(SYMLINK_SO)
|
2005-05-16 07:59:04 +08:00
|
|
|
|
2002-10-11 08:37:11 +08:00
|
|
|
SYMLINK_SO= \
|
2002-11-16 00:56:36 +08:00
|
|
|
if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
|
|
|
|
prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
|
|
|
|
if [ -n "$$SHLIB_COMPAT" ]; then \
|
|
|
|
for x in $$SHLIB_COMPAT; do \
|
2016-01-30 07:03:58 +08:00
|
|
|
( $(SET_X); rm -f $(DSTDIR)/$$SHLIB$$x$$SHLIB_SUFFIX; \
|
|
|
|
ln -s $$prev $(DSTDIR)/$$SHLIB$$x$$SHLIB_SUFFIX ); \
|
2002-11-16 00:56:36 +08:00
|
|
|
prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
|
|
|
|
done; \
|
|
|
|
fi; \
|
|
|
|
if [ -n "$$SHLIB_SOVER" ]; then \
|
2016-01-30 07:03:58 +08:00
|
|
|
( $(SET_X); rm -f $(DSTDIR)/$$SHLIB$$SHLIB_SUFFIX; \
|
|
|
|
ln -s $$prev $(DSTDIR)/$$SHLIB$$SHLIB_SUFFIX ); \
|
2002-11-16 00:56:36 +08:00
|
|
|
fi; \
|
2002-10-11 08:37:11 +08:00
|
|
|
fi
|
2002-10-11 19:14:41 +08:00
|
|
|
|
2016-01-30 07:03:58 +08:00
|
|
|
LINK_SO_A= SHOBJECTS="$(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
|
2002-10-11 08:37:11 +08:00
|
|
|
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
|
2005-05-16 07:59:04 +08:00
|
|
|
|
2002-10-11 08:37:11 +08:00
|
|
|
LINK_SO_A_VIA_O= \
|
2016-01-30 07:03:58 +08:00
|
|
|
SHOBJECTS=$(DSTDIR)/lib$(LIBNAME).o; \
|
2002-12-20 05:13:29 +08:00
|
|
|
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
|
2016-01-30 07:03:58 +08:00
|
|
|
( echo ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \
|
|
|
|
ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL $(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS) ); \
|
|
|
|
$(LINK_SO) && ( echo rm -f $$SHOBJECTS; rm -f $$SHOBJECTS )
|
2005-05-16 07:59:04 +08:00
|
|
|
|
2002-10-11 08:37:11 +08:00
|
|
|
LINK_SO_A_UNPACKED= \
|
|
|
|
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
|
2016-01-30 07:03:58 +08:00
|
|
|
(cd $$UNPACKDIR; ar x ../$(DSTDIR)/lib$(LIBNAME).a) && \
|
2003-04-08 16:36:20 +08:00
|
|
|
([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
|
2002-10-11 08:37:11 +08:00
|
|
|
SHOBJECTS=$$UNPACKDIR/*.o; \
|
|
|
|
$(LINK_SO) && rm -rf $$UNPACKDIR
|
|
|
|
|
2008-12-30 00:17:52 +08:00
|
|
|
DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
2002-12-15 04:52:19 +08:00
|
|
|
|
2003-02-14 07:52:54 +08:00
|
|
|
DO_GNU_SO=$(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2005-05-16 07:59:04 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
|
|
|
|
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"
|
2002-10-15 20:09:22 +08:00
|
|
|
|
2003-02-22 22:41:34 +08: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 20:09:22 +08:00
|
|
|
link_o.gnu:
|
2003-02-14 07:52:54 +08:00
|
|
|
@ $(DO_GNU_SO); $(LINK_SO_O)
|
2002-10-11 08:37:11 +08:00
|
|
|
link_a.gnu:
|
2003-02-14 07:52:54 +08:00
|
|
|
@ $(DO_GNU_SO); $(LINK_SO_A)
|
|
|
|
link_app.gnu:
|
|
|
|
@ $(DO_GNU_APP); $(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
2015-12-14 17:22:58 +08:00
|
|
|
link_a.linux-shared:
|
2015-12-16 19:17:17 +08:00
|
|
|
@if [ $(LIBNAME) != "crypto" -a $(LIBNAME) != "ssl" ]; then $(DO_GNU_SO); else \
|
2016-01-30 07:03:58 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
|
2015-12-14 17:22:58 +08:00
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
|
|
|
fi; $(LINK_SO_A)
|
|
|
|
|
2004-08-30 05:36:37 +08:00
|
|
|
link_o.bsd:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
2004-08-30 05:36:37 +08:00
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2005-05-16 07:59:04 +08:00
|
|
|
LIBDEPS=" "; \
|
2004-08-30 05:36:37 +08:00
|
|
|
ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
|
|
|
|
NOALLSYMSFLAGS=; \
|
2005-05-16 07:59:04 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
2004-08-30 05:36:37 +08:00
|
|
|
fi; $(LINK_SO_O)
|
|
|
|
link_a.bsd:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
2004-08-30 05:36:37 +08:00
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2005-05-16 07:59:04 +08:00
|
|
|
LIBDEPS=" "; \
|
2004-08-30 05:36:37 +08:00
|
|
|
ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
|
|
|
|
NOALLSYMSFLAGS=; \
|
2005-05-16 07:59:04 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
2004-08-30 05:36:37 +08:00
|
|
|
fi; $(LINK_SO_A)
|
|
|
|
link_app.bsd:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \
|
2004-08-30 05:36:37 +08:00
|
|
|
fi; $(LINK_APP)
|
|
|
|
|
2002-10-11 08:37:11 +08:00
|
|
|
# For Darwin AKA Mac OS/X (dyld)
|
2010-07-15 21:53:23 +08:00
|
|
|
# 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.
|
2010-07-16 16:15:28 +08:00
|
|
|
# Alternative to this heuristic approach is to develop specific
|
|
|
|
# MacOS X dso module relying on whichever "native" dyld interface.
|
2002-10-11 08:37:11 +08:00
|
|
|
link_o.darwin:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME); \
|
2010-07-15 21:53:23 +08:00
|
|
|
SHLIB_SUFFIX=.dylib; \
|
2002-12-20 05:13:29 +08:00
|
|
|
ALLSYMSFLAGS='-all_load'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2010-08-21 19:34:46 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
if [ -n "$(LIBVERSION)" ]; then \
|
2002-12-17 07:35:17 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
fi; \
|
|
|
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
2002-12-17 07:35:17 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
fi; \
|
2002-10-11 08:37:11 +08:00
|
|
|
$(LINK_SO_O)
|
|
|
|
link_a.darwin:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME); \
|
|
|
|
SHLIB_SUFFIX=.dylib; \
|
|
|
|
ALLSYMSFLAGS='-all_load'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-06-24 04:44:27 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
if [ -n "$(LIBVERSION)" ]; then \
|
2002-12-17 07:35:17 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
fi; \
|
|
|
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
2002-12-17 07:35:17 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
fi; \
|
2009-08-10 22:48:40 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \
|
2002-10-11 08:37:11 +08:00
|
|
|
$(LINK_SO_A)
|
2005-05-16 07:59:04 +08:00
|
|
|
link_app.darwin: # is there run-path on darwin?
|
2003-02-14 07:52:54 +08:00
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
link_o.cygwin:
|
2002-11-16 00:56:36 +08:00
|
|
|
@ $(CALC_VERSIONS); \
|
|
|
|
INHIBIT_SYMLINKS=yes; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=cyg$(LIBNAME); \
|
2007-05-20 03:40:15 +08:00
|
|
|
base=-Wl,--enable-auto-image-base; \
|
2008-04-17 18:19:16 +08:00
|
|
|
deffile=; \
|
2007-05-20 03:40:15 +08:00
|
|
|
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
2008-04-17 18:19:16 +08:00
|
|
|
SHLIB=$(LIBNAME)eay32; base=; \
|
|
|
|
if test -f $(LIBNAME)eay32.def; then \
|
|
|
|
deffile=$(LIBNAME)eay32.def; \
|
|
|
|
fi; \
|
2007-05-20 03:40:15 +08:00
|
|
|
fi; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB_SUFFIX=.dll; \
|
2005-05-22 00:41:34 +08:00
|
|
|
LIBVERSION="$(LIBVERSION)"; \
|
|
|
|
SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
|
2002-12-20 05:13:29 +08:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2016-01-17 02:36:15 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-Bsymbolic"; \
|
2002-10-11 08:37:11 +08:00
|
|
|
$(LINK_SO_O)
|
2008-04-17 18:19:16 +08:00
|
|
|
#for mingw target if def-file is in use dll-name should match library-name
|
2002-10-11 08:37:11 +08:00
|
|
|
link_a.cygwin:
|
2002-11-16 00:56:36 +08:00
|
|
|
@ $(CALC_VERSIONS); \
|
|
|
|
INHIBIT_SYMLINKS=yes; \
|
2006-10-25 06:14:20 +08:00
|
|
|
SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
|
|
|
|
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
|
2007-05-20 03:40:15 +08:00
|
|
|
base=-Wl,--enable-auto-image-base; \
|
2006-10-23 15:30:19 +08:00
|
|
|
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
2008-04-17 18:19:16 +08:00
|
|
|
case $(LIBNAME) in \
|
|
|
|
crypto) SHLIB=libeay;; \
|
|
|
|
ssl) SHLIB=ssleay;; \
|
|
|
|
esac; \
|
|
|
|
SHLIB_SOVER=32; \
|
2006-10-25 06:14:20 +08:00
|
|
|
extras="$(LIBNAME).def"; \
|
2016-01-30 07:03:58 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mkdef.pl 32 $$SHLIB > $$extras; \
|
2007-05-20 03:40:15 +08:00
|
|
|
base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
|
2006-10-23 15:30:19 +08:00
|
|
|
fi; \
|
2006-10-25 06:14:20 +08:00
|
|
|
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
|
2016-02-11 19:59:33 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name | \
|
2016-02-05 22:17:33 +08:00
|
|
|
$(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
|
2006-10-25 06:14:20 +08:00
|
|
|
extras="$$extras rc.o"; \
|
2002-12-20 05:13:29 +08:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2016-01-17 02:36:15 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
|
2005-05-01 07:45:53 +08:00
|
|
|
$(LINK_SO_A) || exit 1; \
|
2016-01-30 12:45:29 +08:00
|
|
|
rm $$extras
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.cygwin:
|
2006-10-25 06:14:20 +08:00
|
|
|
@if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \
|
2016-01-30 07:03:58 +08:00
|
|
|
LIBDEPS="$(SRCDIR)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \
|
2006-10-25 06:14:20 +08:00
|
|
|
export LIBDEPS; \
|
|
|
|
fi; \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
link_o.alpha-osf1:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2002-10-11 08:37:11 +08: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-17 07:35:17 +08:00
|
|
|
fi; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB_SOVER=; \
|
|
|
|
ALLSYMSFLAGS='-all'; \
|
|
|
|
NOALLSYMSFLAGS='-none'; \
|
2007-08-26 22:12:30 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
if [ -n "$$SHLIB_HIST" ]; then \
|
2005-12-17 04:51:03 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
fi; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2002-10-11 08:37:11 +08:00
|
|
|
link_a.alpha-osf1:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2002-10-11 08:37:11 +08: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-17 07:35:17 +08:00
|
|
|
fi; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB_SOVER=; \
|
|
|
|
ALLSYMSFLAGS='-all'; \
|
|
|
|
NOALLSYMSFLAGS='-none'; \
|
2007-08-26 22:12:30 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
if [ -n "$$SHLIB_HIST" ]; then \
|
2005-12-17 04:51:03 +08:00
|
|
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
|
2002-10-12 03:56:57 +08:00
|
|
|
fi; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A)
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.alpha-osf1:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_APP); \
|
|
|
|
else \
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS) -rpath $(LIBRPATH)"; \
|
2003-02-14 07:52:54 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
link_o.solaris:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-17 04:33:38 +08:00
|
|
|
MINUSZ='-z '; \
|
2005-05-16 07:59:04 +08:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
|
|
|
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
|
2005-05-16 07:59:04 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2002-10-11 08:37:11 +08:00
|
|
|
link_a.solaris:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-17 04:33:38 +08:00
|
|
|
MINUSZ='-z '; \
|
2008-12-30 00:17:52 +08:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=;\
|
2015-12-16 19:17:17 +08:00
|
|
|
if [ $(LIBNAME) != "crypto" -a $(LIBNAME) != "ssl" ]; then \
|
|
|
|
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
|
|
|
else \
|
2016-01-30 07:03:58 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
|
2015-12-16 19:17:17 +08:00
|
|
|
ALLSYMSFLAGS="$${MINUSZ}allextract,-M,$(LIBNAME).map"; \
|
|
|
|
fi; \
|
2002-12-20 05:13:29 +08:00
|
|
|
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
|
2005-05-16 07:59:04 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A)
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.solaris:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_APP); \
|
|
|
|
else \
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS) -R $(LIBRPATH)"; \
|
2003-02-14 07:52:54 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
# OpenServer 5 native compilers used
|
|
|
|
link_o.svr3:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-04-08 17:27:43 +08:00
|
|
|
$(DO_GNU_SO); \
|
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-27 07:51:20 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2003-04-08 17:27:43 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
|
|
|
link_a.svr3:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-04-08 17:27:43 +08:00
|
|
|
$(DO_GNU_SO); \
|
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-27 07:51:20 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2003-04-08 17:27:43 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A_UNPACKED)
|
|
|
|
link_app.svr3:
|
2008-12-30 00:17:52 +08:00
|
|
|
@$(DETECT_GNU_LD) && $(DO_GNU_APP); \
|
2003-04-08 17:27:43 +08:00
|
|
|
$(LINK_APP)
|
|
|
|
|
|
|
|
# UnixWare 7 and OpenUNIX 8 native compilers used
|
|
|
|
link_o.svr5:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2003-04-01 18:59:15 +08:00
|
|
|
SHARE_FLAG='-G'; \
|
2005-05-16 07:59:04 +08:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2003-04-08 16:36:20 +08:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-20 05:13:29 +08:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-27 07:51:20 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2003-04-08 17:27:43 +08:00
|
|
|
link_a.svr5:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2003-04-01 18:59:15 +08:00
|
|
|
SHARE_FLAG='-G'; \
|
2008-12-30 00:17:52 +08:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2003-04-08 16:36:20 +08:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-20 05:13:29 +08:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2005-01-27 07:51:20 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A_UNPACKED)
|
2003-04-08 17:27:43 +08:00
|
|
|
link_app.svr5:
|
2008-12-30 00:17:52 +08:00
|
|
|
@$(DETECT_GNU_LD) && $(DO_GNU_APP); \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
link_o.irix:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2004-03-13 05:52:54 +08:00
|
|
|
MINUSWL=""; \
|
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
|
|
|
|
ALLSYMSFLAGS="$${MINUSWL}-all"; \
|
2004-12-27 22:59:36 +08:00
|
|
|
NOALLSYMSFLAGS="$${MINUSWL}-none"; \
|
2007-08-26 22:12:30 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_O)
|
2002-10-11 08:37:11 +08:00
|
|
|
link_a.irix:
|
2008-12-30 00:17:52 +08:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(DO_GNU_SO); \
|
2002-10-11 08:37:11 +08:00
|
|
|
else \
|
|
|
|
$(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2004-03-13 05:52:54 +08:00
|
|
|
MINUSWL=""; \
|
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
|
|
|
|
ALLSYMSFLAGS="$${MINUSWL}-all"; \
|
2004-12-27 22:59:36 +08:00
|
|
|
NOALLSYMSFLAGS="$${MINUSWL}-none"; \
|
2007-08-26 22:12:30 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \
|
2002-10-15 20:09:22 +08:00
|
|
|
fi; \
|
|
|
|
$(LINK_SO_A)
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.irix:
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
@LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
2004-06-01 06:29:26 +08: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 08:37:11 +08:00
|
|
|
#
|
2004-05-29 06:18:48 +08:00
|
|
|
link_o.hpux:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
2004-05-29 06:38:05 +08:00
|
|
|
$(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).sl; \
|
2006-05-20 16:52:34 +08:00
|
|
|
expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB_SUFFIX=; \
|
2004-05-28 06:23:40 +08:00
|
|
|
ALLSYMSFLAGS='-Wl,-Fl'; \
|
2002-12-20 05:13:29 +08:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2004-05-29 06:18:48 +08:00
|
|
|
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
|
2007-09-16 22:11:00 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
|
2004-05-29 06:38:05 +08:00
|
|
|
fi; \
|
2005-06-23 23:36:15 +08:00
|
|
|
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
|
2002-10-11 15:33:38 +08:00
|
|
|
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
2004-05-29 06:18:48 +08:00
|
|
|
link_a.hpux:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
2004-05-29 06:38:05 +08:00
|
|
|
$(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).sl; \
|
2004-07-24 22:17:32 +08:00
|
|
|
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB_SUFFIX=; \
|
2004-05-28 06:23:40 +08:00
|
|
|
ALLSYMSFLAGS='-Wl,-Fl'; \
|
2002-12-20 05:13:29 +08:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2004-05-29 06:18:48 +08:00
|
|
|
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
|
2007-09-16 22:11:00 +08:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
|
2004-05-29 06:38:05 +08:00
|
|
|
fi; \
|
2005-06-23 23:36:15 +08:00
|
|
|
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
|
2002-10-11 15:33:38 +08:00
|
|
|
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
2004-05-29 06:18:48 +08:00
|
|
|
link_app.hpux:
|
2008-12-30 00:17:52 +08:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
|
2004-05-29 06:38:05 +08:00
|
|
|
fi; \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
link_o.aix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2008-09-12 22:45:54 +08:00
|
|
|
OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
|
2005-02-06 21:18:40 +08:00
|
|
|
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
2007-03-22 16:46:33 +08:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-20 05:13:29 +08:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2008-09-12 22:45:54 +08:00
|
|
|
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
|
2007-03-22 16:46:33 +08:00
|
|
|
$(LINK_SO_O);
|
2002-10-11 08:37:11 +08:00
|
|
|
link_a.aix:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2008-09-12 22:45:54 +08:00
|
|
|
OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \
|
2005-02-06 21:18:40 +08:00
|
|
|
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
|
|
|
SHLIB_SUFFIX=; \
|
|
|
|
ALLSYMSFLAGS='-bnogc'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2008-09-12 22:45:54 +08:00
|
|
|
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
|
2002-10-11 08:37:11 +08:00
|
|
|
$(LINK_SO_A_VIA_O)
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.aix:
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 18:47:14 +08:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
|
2003-02-14 07:52:54 +08:00
|
|
|
$(LINK_APP)
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
# Targets to build symbolic links when needed
|
2003-04-08 17:27:43 +08:00
|
|
|
symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
|
2014-12-26 05:16:29 +08:00
|
|
|
symlink.aix:
|
2002-10-11 08:37:11 +08:00
|
|
|
@ $(CALC_VERSIONS); \
|
2002-11-16 00:56:36 +08:00
|
|
|
SHLIB=lib$(LIBNAME).so; \
|
2002-10-11 08:37:11 +08:00
|
|
|
$(SYMLINK_SO)
|
2002-10-11 15:33:38 +08:00
|
|
|
symlink.darwin:
|
|
|
|
@ $(CALC_VERSIONS); \
|
2002-12-20 05:13:29 +08:00
|
|
|
SHLIB=lib$(LIBNAME); \
|
2002-11-16 00:56:36 +08:00
|
|
|
SHLIB_SUFFIX=.dylib; \
|
2002-10-11 15:33:38 +08:00
|
|
|
$(SYMLINK_SO)
|
2004-05-29 06:18:48 +08:00
|
|
|
symlink.hpux:
|
2002-10-11 08:37:11 +08:00
|
|
|
@ $(CALC_VERSIONS); \
|
2002-11-16 00:56:36 +08:00
|
|
|
SHLIB=lib$(LIBNAME).sl; \
|
2004-07-24 22:17:32 +08:00
|
|
|
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
2002-10-11 08:37:11 +08:00
|
|
|
$(SYMLINK_SO)
|
2002-11-16 00:56:36 +08:00
|
|
|
# The following lines means those specific architectures do no symlinks
|
2015-01-12 23:40:00 +08:00
|
|
|
symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
|
2002-10-11 08:37:11 +08:00
|
|
|
|
|
|
|
# Compatibility targets
|
|
|
|
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
|
2015-12-14 17:22:58 +08:00
|
|
|
link_a.bsd-gcc-shared link_a.gnu-shared: link_a.gnu
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
|
2004-08-30 05:36:37 +08: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 08:37:11 +08:00
|
|
|
link_o.darwin-shared: link_o.darwin
|
|
|
|
link_a.darwin-shared: link_a.darwin
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.darwin-shared: link_app.darwin
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.darwin-shared: symlink.darwin
|
|
|
|
link_o.cygwin-shared: link_o.cygwin
|
|
|
|
link_a.cygwin-shared: link_a.cygwin
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.cygwin-shared: link_app.cygwin
|
2002-10-11 08:37:11 +08: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-14 07:52:54 +08:00
|
|
|
link_app.alpha-osf1-shared: link_app.alpha-osf1
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.alpha-osf1-shared: symlink.alpha-osf1
|
|
|
|
link_o.tru64-shared: link_o.tru64
|
|
|
|
link_a.tru64-shared: link_a.tru64
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.tru64-shared: link_app.tru64
|
2002-10-11 08:37:11 +08: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-14 07:52:54 +08:00
|
|
|
link_app.tru64-shared-rpath: link_app.tru64-rpath
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.tru64-shared-rpath: symlink.tru64-rpath
|
|
|
|
link_o.solaris-shared: link_o.solaris
|
|
|
|
link_a.solaris-shared: link_a.solaris
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.solaris-shared: link_app.solaris
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.solaris-shared: symlink.solaris
|
|
|
|
link_o.svr3-shared: link_o.svr3
|
|
|
|
link_a.svr3-shared: link_a.svr3
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.svr3-shared: link_app.svr3
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.svr3-shared: symlink.svr3
|
2003-04-08 17:27:43 +08: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 08:37:11 +08:00
|
|
|
link_o.irix-shared: link_o.irix
|
|
|
|
link_a.irix-shared: link_a.irix
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.irix-shared: link_app.irix
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.irix-shared: symlink.irix
|
2004-05-29 06:18:48 +08: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 08:37:11 +08:00
|
|
|
link_o.aix-shared: link_o.aix
|
|
|
|
link_a.aix-shared: link_a.aix
|
2003-02-14 07:52:54 +08:00
|
|
|
link_app.aix-shared: link_app.aix
|
2002-10-11 08:37:11 +08:00
|
|
|
symlink.aix-shared: symlink.aix
|