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.
|
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 10:47:14 +00:00
|
|
|
LDFLAGS=$(LDFLAG)
|
|
|
|
SHARED_LDFLAGS=$(SHARED_LDFLAG)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
2016-05-16 15:08:13 +00:00
|
|
|
RC=windres
|
2016-02-05 14:17:33 +00:00
|
|
|
# SHARED_RCFLAGS are flags used with windres, i.e. when build for Cygwin
|
|
|
|
# or Mingw.
|
|
|
|
SHARED_RCFLAGS=$(SHARED_RCFLAG)
|
|
|
|
|
2006-10-21 13:38:16 +00:00
|
|
|
NM=nm
|
2017-06-29 15:40:19 +00:00
|
|
|
ECHO=echo
|
2006-10-21 13:38:16 +00:00
|
|
|
|
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=
|
|
|
|
|
2017-07-21 16:04:51 +00:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
|
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=
|
|
|
|
|
2016-01-29 23:03:58 +00:00
|
|
|
# SRCDIR is the top directory of the source tree.
|
|
|
|
SRCDIR=.
|
|
|
|
|
2003-02-13 23:52:54 +00: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 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
|
2016-02-15 17:02:52 +00:00
|
|
|
# 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.
|
2002-10-11 00:37:11 +00:00
|
|
|
LIBEXTRAS=
|
|
|
|
|
|
|
|
# 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=:
|
2010-07-15 13:55:38 +00:00
|
|
|
#SET_X=set -x
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
top:
|
2017-06-29 15:40:19 +00:00
|
|
|
echo "Trying to use this makefile interactively? Don't." ; exit 1
|
2002-10-11 00:37:11 +00:00
|
|
|
|
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)}"; \
|
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 10:47:14 +00:00
|
|
|
LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS) $(LDFLAGS)}"; \
|
2009-01-02 09:02:27 +00:00
|
|
|
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
|
2003-04-08 08:57:23 +00:00
|
|
|
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
2016-02-05 11:20:19 +00:00
|
|
|
$${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS}; \
|
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)}"; \
|
2009-01-02 09:02:27 +00:00
|
|
|
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
|
2003-04-08 08:57:23 +00:00
|
|
|
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
2016-02-05 11:20:19 +00:00
|
|
|
$${SHAREDCMD} $${SHAREDFLAGS} \
|
2017-07-21 16:04:51 +00:00
|
|
|
-o $(SHLIBNAME_FULL) \
|
2016-02-05 11:20:19 +00:00
|
|
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS; \
|
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} \
|
2017-07-21 16:04:51 +00:00
|
|
|
-o $(SHLIBNAME_FULL) \
|
2005-05-15 23:59:04 +00:00
|
|
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
|
2007-07-31 18:24:41 +00:00
|
|
|
) && $(SYMLINK_SO)
|
2005-05-15 23:59:04 +00:00
|
|
|
|
2002-10-11 00:37:11 +00:00
|
|
|
SYMLINK_SO= \
|
2002-11-15 16:56:36 +00:00
|
|
|
if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
|
2017-07-21 16:04:51 +00:00
|
|
|
if [ -n "$(SHLIBNAME_FULL)" -a -n "$(SHLIBNAME)" -a \
|
|
|
|
"$(SHLIBNAME_FULL)" != "$(SHLIBNAME)" ]; then \
|
|
|
|
( $(SET_X); \
|
|
|
|
rm -f $(SHLIBNAME); \
|
|
|
|
ln -s $(SHLIBNAME_FULL) $(SHLIBNAME) ); \
|
2002-11-15 16:56:36 +00:00
|
|
|
fi; \
|
2002-10-11 00:37:11 +00:00
|
|
|
fi
|
2002-10-11 11:14:41 +00:00
|
|
|
|
2017-07-21 16:04:51 +00:00
|
|
|
LINK_SO_SHLIB= SHOBJECTS="$(STLIBNAME) $(LIBEXTRAS)"; $(LINK_SO)
|
2016-02-15 17:02:52 +00:00
|
|
|
LINK_SO_DSO= INHIBIT_SYMLINKS=yes; SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
|
2005-05-15 23:59:04 +00:00
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
LINK_SO_SHLIB_VIA_O= \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHOBJECTS=$(STLIBNAME).o; \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
|
2017-07-21 16:04:51 +00:00
|
|
|
( $(ECHO) ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(STLIBNAME) $(LIBEXTRAS); \
|
|
|
|
ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(STLIBNAME) $(LIBEXTRAS) ); \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(LINK_SO) && ( $(ECHO) rm -f $$SHOBJECTS; rm -f $$SHOBJECTS )
|
2005-05-15 23:59:04 +00:00
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
LINK_SO_SHLIB_UNPACKED= \
|
2002-10-11 00:37:11 +00:00
|
|
|
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
|
2017-07-21 16:04:51 +00:00
|
|
|
(cd $$UNPACKDIR; ar x ../$(STLIBNAME)) && \
|
2003-04-08 08:36:20 +00:00
|
|
|
([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
|
2002-10-11 00:37:11 +00:00
|
|
|
SHOBJECTS=$$UNPACKDIR/*.o; \
|
|
|
|
$(LINK_SO) && rm -rf $$UNPACKDIR
|
|
|
|
|
2008-12-29 16:17:52 +00:00
|
|
|
DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
2002-12-14 20:52:19 +00:00
|
|
|
|
2016-02-22 13:26:40 +00:00
|
|
|
DO_GNU_SO_COMMON=\
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$(SHLIBNAME_FULL)"
|
2016-02-22 11:57:08 +00:00
|
|
|
DO_GNU_DSO=\
|
|
|
|
$(DO_GNU_SO_COMMON)
|
|
|
|
DO_GNU_SO=\
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2016-02-22 11:57:08 +00:00
|
|
|
$(DO_GNU_SO_COMMON)
|
2016-10-12 15:18:11 +00:00
|
|
|
DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS)"
|
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)
|
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.gnu:
|
2016-02-22 11:57:08 +00:00
|
|
|
@ $(DO_GNU_DSO); $(LINK_SO_DSO)
|
2016-02-15 17:02:52 +00:00
|
|
|
link_shlib.gnu:
|
|
|
|
@ $(DO_GNU_SO); $(LINK_SO_SHLIB)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.gnu:
|
|
|
|
@ $(DO_GNU_APP); $(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_shlib.linux-shared:
|
2017-07-24 09:48:02 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
|
2016-02-15 17:19:49 +00:00
|
|
|
$(DO_GNU_SO); \
|
2015-12-14 09:22:58 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \
|
2016-02-15 17:19:49 +00:00
|
|
|
$(LINK_SO_SHLIB)
|
2015-12-14 09:22:58 +00:00
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.bsd:
|
2016-02-22 11:57:08 +00:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_DSO); else \
|
2005-05-15 23:59:04 +00:00
|
|
|
LIBDEPS=" "; \
|
2016-02-22 11:57:08 +00:00
|
|
|
ALLSYMSFLAGS=; \
|
2004-08-29 21:36:37 +00:00
|
|
|
NOALLSYMSFLAGS=; \
|
2005-05-15 23:59:04 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
2016-02-15 17:02:52 +00:00
|
|
|
fi; $(LINK_SO_DSO)
|
|
|
|
link_shlib.bsd:
|
2008-12-29 16:17:52 +00:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
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"; \
|
2016-02-15 17:02:52 +00:00
|
|
|
fi; $(LINK_SO_SHLIB)
|
2004-08-29 21:36:37 +00:00
|
|
|
link_app.bsd:
|
2008-12-29 16:17:52 +00:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
|
2016-10-12 15:18:11 +00:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
|
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)
|
2016-02-15 17:02:52 +00:00
|
|
|
# Originally link_dso.darwin produced .so, because it was hard-coded
|
2010-07-15 13:53:23 +00:00
|
|
|
# in dso_dlfcn module. At later point dso_dlfcn switched to .dylib
|
|
|
|
# extension in order to allow for run-time linking with vendor-
|
2016-02-15 17:02:52 +00:00
|
|
|
# supplied shared libraries such as libz, so that link_dso.darwin had
|
2010-07-15 13:53:23 +00:00
|
|
|
# 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 08:15:28 +00:00
|
|
|
# Alternative to this heuristic approach is to develop specific
|
|
|
|
# MacOS X dso module relying on whichever "native" dyld interface.
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.darwin:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2010-08-21 11:34:46 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.darwin:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ ALLSYMSFLAGS='-all_load'; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -current_version $(SHLIBVERSION) -compatibility_version $(SHLIBVERSION) -install_name $(INSTALLTOP)/$(LIBDIR)/$(SHLIBNAME_FULL)"; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB)
|
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
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.cygwin:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ALLSYMSFLAGS=''; \
|
2016-02-22 11:57:08 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2016-02-15 17:29:09 +00:00
|
|
|
base=-Wl,--enable-auto-image-base; \
|
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic"; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.cygwin:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ INHIBIT_SYMLINKS=yes; \
|
|
|
|
$(ECHO) "$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) |" \
|
2016-05-16 15:08:13 +00:00
|
|
|
"$(RC) $(SHARED_RCFLAGS) -o rc.o"; \
|
2017-07-21 16:04:51 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) | \
|
2016-05-16 15:08:13 +00:00
|
|
|
$(RC) $(SHARED_RCFLAGS) -o rc.o; \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,--enable-auto-image-base -Wl,-Bsymbolic -Wl,--out-implib,$(SHLIBNAME) rc.o"; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB) || exit 1; \
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
rm rc.o
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.cygwin:
|
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
# 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:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ INHIBIT_SYMLINKS=yes; \
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/mkdef.pl 32 $(LIBNAME) \
|
2017-07-21 16:04:51 +00:00
|
|
|
| sed -e 's|^\(LIBRARY *\)$(LIBNAME)32|\1$(SHLIBNAME_FULL)|' \
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
> $(LIBNAME).def; \
|
2017-07-21 16:04:51 +00:00
|
|
|
echo "$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) |" \
|
2016-05-16 15:08:13 +00:00
|
|
|
"$(RC) $(SHARED_RCFLAGS) -o rc.o"; \
|
2017-07-21 16:04:51 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) | \
|
2016-05-16 15:08:13 +00:00
|
|
|
$(RC) $(SHARED_RCFLAGS) -o rc.o; \
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
|
|
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,--out-implib,$(SHLIBNAME) $(LIBNAME).def rc.o"; \
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
$(LINK_SO_SHLIB) || exit 1; \
|
|
|
|
rm $(LIBNAME).def rc.o
|
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.alpha-osf1:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2016-02-22 11:57:08 +00:00
|
|
|
$(DO_GNU_DSO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
2016-02-22 11:57:08 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2007-08-26 14:12:30 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.alpha-osf1:
|
2008-12-29 16:17:52 +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 \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-all'; \
|
|
|
|
NOALLSYMSFLAGS='-none'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic -set_version $(SHLIBVERSION)"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.alpha-osf1:
|
2008-12-29 16:17:52 +00:00
|
|
|
@if $(DETECT_GNU_LD); then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_APP); \
|
|
|
|
else \
|
2016-10-12 15:18:11 +00:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.solaris:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2016-02-22 11:57:08 +00:00
|
|
|
$(DO_GNU_DSO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
2016-02-22 11:57:08 +00:00
|
|
|
ALLSYMSFLAGS=""; \
|
|
|
|
NOALLSYMSFLAGS=""; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $(SHLIBNAME_FULL) -Wl,-Bsymbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.solaris:
|
2008-12-29 16:17:52 +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 \
|
2016-02-15 17:19:49 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
|
|
|
|
ALLSYMSFLAGS="-Wl,-z,allextract,-M,$(LIBNAME).map"; \
|
2016-02-16 13:48:36 +00:00
|
|
|
NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $(SHLIBNAME_FULL) -Wl,-Bsymbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.solaris:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(DO_GNU_APP); \
|
|
|
|
else \
|
2016-10-12 15:18:11 +00:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
fi; \
|
|
|
|
$(LINK_APP)
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
# OpenServer 5 native compilers used
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.svr3:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2016-02-22 11:57:08 +00:00
|
|
|
$(DO_GNU_DSO); \
|
2003-04-08 09:27:43 +00:00
|
|
|
else \
|
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) -G -h $(SHLIBNAME_FULL)"; \
|
2003-04-08 09:27:43 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.svr3:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2003-04-08 09:27:43 +00:00
|
|
|
$(DO_GNU_SO); \
|
|
|
|
else \
|
|
|
|
ALLSYMSFLAGS=''; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) -G -h $(SHLIBNAME_FULL)"; \
|
2003-04-08 09:27:43 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB_UNPACKED)
|
2003-04-08 09:27:43 +00:00
|
|
|
link_app.svr3:
|
2008-12-29 16:17:52 +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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.svr5:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2016-02-22 11:57:08 +00:00
|
|
|
$(DO_GNU_DSO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
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'; \
|
2003-04-08 08:36:20 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $(SHLIBNAME_FULL)"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.svr5:
|
2008-12-29 16:17:52 +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 \
|
2003-04-01 10:59:15 +00:00
|
|
|
SHARE_FLAG='-G'; \
|
2008-12-29 16:17:52 +00:00
|
|
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
2003-04-08 08:36:20 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $(SHLIBNAME_FULL)"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB_UNPACKED)
|
2003-04-08 09:27:43 +00:00
|
|
|
link_app.svr5:
|
2008-12-29 16:17:52 +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
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.irix:
|
2008-12-29 16:17:52 +00:00
|
|
|
@ if $(DETECT_GNU_LD); then \
|
2016-02-22 11:57:08 +00:00
|
|
|
$(DO_GNU_DSO); \
|
2002-10-11 00:37:11 +00:00
|
|
|
else \
|
2016-02-22 11:57:08 +00:00
|
|
|
ALLSYMSFLAGS=""; \
|
|
|
|
NOALLSYMSFLAGS=""; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$(SHLIBNAME_FULL),-B,symbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO)
|
|
|
|
link_shlib.irix:
|
2008-12-29 16:17:52 +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 \
|
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"; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$(SHLIBNAME_FULL),-B,symbolic"; \
|
2002-10-15 12:09:22 +00:00
|
|
|
fi; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.irix:
|
2016-10-12 15:18:11 +00:00
|
|
|
@LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
|
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
|
|
|
#
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.hpux:
|
2016-02-22 11:57:08 +00:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_DSO); else \
|
|
|
|
ALLSYMSFLAGS=''; \
|
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'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$(SHLIBNAME_FULL),+cdp,../:,+cdp,./:"; \
|
2004-05-28 22:38:05 +00:00
|
|
|
fi; \
|
2017-07-21 16:04:51 +00:00
|
|
|
rm -f $(SHLIBNAME_FULL) || :; \
|
|
|
|
$(LINK_SO_DSO) && chmod a=rx $(SHLIBNAME_FULL)
|
2016-02-15 17:02:52 +00:00
|
|
|
link_shlib.hpux:
|
2008-12-29 16:17:52 +00:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
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'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$(SHLIBNAME_FULL),+cdp,../:,+cdp,./:"; \
|
2004-05-28 22:38:05 +00:00
|
|
|
fi; \
|
2017-07-21 16:04:51 +00:00
|
|
|
rm -f $(SHLIBNAME_FULL) || :; \
|
|
|
|
$(LINK_SO_SHLIB) && chmod a=rx $(SHLIBNAME_FULL)
|
2004-05-28 22:18:48 +00:00
|
|
|
link_app.hpux:
|
2008-12-29 16:17:52 +00:00
|
|
|
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
|
2016-10-12 15:18:11 +00:00
|
|
|
LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:"; \
|
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
|
|
|
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.aix:
|
|
|
|
@OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
|
2005-02-06 13:18:40 +00:00
|
|
|
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
2007-03-22 08:46:33 +00:00
|
|
|
ALLSYMSFLAGS=''; \
|
2002-12-19 21:13:29 +00:00
|
|
|
NOALLSYMSFLAGS=''; \
|
2008-09-12 14:45:54 +00:00
|
|
|
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
rm -f $(SHLIBNAME_FULL) 2>&1 > /dev/null ; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_DSO);
|
|
|
|
link_shlib.aix:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \
|
2005-02-06 13:18:40 +00:00
|
|
|
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
2002-12-19 21:13:29 +00:00
|
|
|
ALLSYMSFLAGS='-bnogc'; \
|
|
|
|
NOALLSYMSFLAGS=''; \
|
2008-09-12 14:45:54 +00:00
|
|
|
SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
|
2017-07-21 16:04:51 +00:00
|
|
|
rm -f $(SHLIBNAME_FULL) 2>&1 > /dev/null ; \
|
2016-02-15 17:02:52 +00:00
|
|
|
$(LINK_SO_SHLIB_VIA_O)
|
2003-02-13 23:52:54 +00:00
|
|
|
link_app.aix:
|
2016-10-12 15:18:11 +00:00
|
|
|
LDFLAGS="$(CFLAGS) -Wl,-bsvr4 $(LDFLAGS)"; \
|
2003-02-13 23:52:54 +00:00
|
|
|
$(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 \
|
2014-12-25 21:16:29 +00:00
|
|
|
symlink.aix:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ $(SYMLINK_SO)
|
2002-10-11 07:33:38 +00:00
|
|
|
symlink.darwin:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ $(SYMLINK_SO)
|
2004-05-28 22:18:48 +00:00
|
|
|
symlink.hpux:
|
2017-07-21 16:04:51 +00:00
|
|
|
@ $(SYMLINK_SO)
|
2002-11-15 16:56:36 +00:00
|
|
|
# The following lines means those specific architectures do no symlinks
|
2015-01-12 15:40:00 +00:00
|
|
|
symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
|
2002-10-11 00:37:11 +00:00
|
|
|
|
|
|
|
# Compatibility targets
|
2016-05-20 07:30:06 +00:00
|
|
|
link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared: link_dso.gnu
|
2016-02-27 16:19:34 +00:00
|
|
|
link_shlib.bsd-gcc-shared: link_shlib.linux-shared
|
2016-05-20 07:30:06 +00:00
|
|
|
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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.bsd-shared: link_dso.bsd
|
|
|
|
link_shlib.bsd-shared: link_shlib.bsd
|
2004-08-29 21:36:37 +00:00
|
|
|
link_app.bsd-shared: link_app.bsd
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.darwin-shared: link_dso.darwin
|
|
|
|
link_shlib.darwin-shared: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.cygwin-shared: link_dso.cygwin
|
|
|
|
link_shlib.cygwin-shared: link_shlib.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
|
Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this
libeay32.dll + libeay32.dll.a
ssleay32.dll + ssleay32.dll.a
That naming scheme is antiquated, a reminicense of SSLeay. We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.
There are two factors to remember:
- Windows libraries have no recorded SOvers, which means that the
shared library version must be encoded in the name. According to
some, it's unwise to encode extra periods in a Windows file name,
so we convert version number periods to underscores.
- MingW has multilib ability. However, DLLs need to reside with the
binaries that use them, so to allow both 32-bit and 64-bit DLLs to
reside in the same place, we add '-x64' in the name of the 64-bit
ones.
The resulting name scheme (for SOver 1.1) is this:
on x86:
libcrypto-1_1.dll + libcrypto.dll.a
libssl-1_1.dll + libssl.dll.a
on x86_64:
libcrypto-1_1-x64.dll + libcrypto.dll.a
libssl-1_1-x64.dll + libssl.dll.a
An observation is that the import lib is the same for both
architectures. Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.
As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets. link_shlib.mingw-shared is,
however, a target separated from the cygwin one.
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-16 19:37:28 +00:00
|
|
|
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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.alpha-osf1-shared: link_dso.alpha-osf1
|
|
|
|
link_shlib.alpha-osf1-shared: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.tru64-shared: link_dso.tru64
|
|
|
|
link_shlib.tru64-shared: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.tru64-shared-rpath: link_dso.tru64-rpath
|
|
|
|
link_shlib.tru64-shared-rpath: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.solaris-shared: link_dso.solaris
|
|
|
|
link_shlib.solaris-shared: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.svr3-shared: link_dso.svr3
|
|
|
|
link_shlib.svr3-shared: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.svr5-shared: link_dso.svr5
|
|
|
|
link_shlib.svr5-shared: link_shlib.svr5
|
2003-04-08 09:27:43 +00:00
|
|
|
link_app.svr5-shared: link_app.svr5
|
|
|
|
symlink.svr5-shared: symlink.svr5
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.irix-shared: link_dso.irix
|
|
|
|
link_shlib.irix-shared: link_shlib.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
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.hpux-shared: link_dso.hpux
|
|
|
|
link_shlib.hpux-shared: link_shlib.hpux
|
2004-05-28 22:18:48 +00:00
|
|
|
link_app.hpux-shared: link_app.hpux
|
|
|
|
symlink.hpux-shared: symlink.hpux
|
2016-02-15 17:02:52 +00:00
|
|
|
link_dso.aix-shared: link_dso.aix
|
|
|
|
link_shlib.aix-shared: link_shlib.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
|