Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 1 | # |
| 2 | # Helper makefile to link shared libraries in a portable way. |
| 3 | # This is much simpler than libtool, and hopefully not too error-prone. |
| 4 | # |
| 5 | # The following variables need to be set on the command line to build |
| 6 | # properly |
| 7 | |
| 8 | # CC contains the current compiler. This one MUST be defined |
| 9 | CC=cc |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 10 | CFLAGS=$(CFLAG) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 11 | # LDFLAGS contains flags to be used when temporary object files (when building |
| 12 | # shared libraries) are created, or when an application is linked. |
| 13 | # SHARED_LDFLAGS contains flags to be used when the shared library is created. |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 14 | LDFLAGS= |
| 15 | SHARED_LDFLAGS= |
| 16 | |
Andy Polyakov | cbfb39d | 2006-10-21 13:38:16 +0000 | [diff] [blame] | 17 | NM=nm |
| 18 | |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 19 | # LIBNAME contains just the name of the library, without prefix ("lib" |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 20 | # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so, |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 21 | # .dll, ...). This one MUST have a value when using this makefile to |
| 22 | # build shared libraries. |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 23 | # For example, to build libfoo.so, you need to do the following: |
| 24 | #LIBNAME=foo |
| 25 | LIBNAME= |
| 26 | |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 27 | # APPNAME contains just the name of the application, without suffix ("" |
| 28 | # on Unix, ".exe" on Windows, ...). This one MUST have a value when using |
| 29 | # this makefile to build applications. |
| 30 | # For example, to build foo, you need to do the following: |
| 31 | #APPNAME=foo |
| 32 | APPNAME= |
| 33 | |
| 34 | # OBJECTS contains all the object files to link together into the application. |
| 35 | # This must contain at least one object file. |
| 36 | #OBJECTS=foo.o |
| 37 | OBJECTS= |
| 38 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 39 | # LIBEXTRAS contains extra modules to link together with the library. |
Richard Levitte | 8d6fc30 | 2002-11-06 23:39:03 +0000 | [diff] [blame] | 40 | # For example, if a second library, say libbar.a needs to be linked into |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 41 | # libfoo.so, you need to do the following: |
| 42 | #LIBEXTRAS=libbar.a |
| 43 | # Note that this MUST be used when using the link_o targets, to hold the |
| 44 | # names of all object files that go into the target library. |
| 45 | LIBEXTRAS= |
| 46 | |
| 47 | # LIBVERSION contains the current version of the library. |
| 48 | # For example, to build libfoo.so.1.2, you need to do the following: |
| 49 | #LIBVERSION=1.2 |
| 50 | LIBVERSION= |
| 51 | |
| 52 | # LIBCOMPATVERSIONS contains the compatibility versions (a list) of |
| 53 | # the library. They MUST be in decreasing order. |
| 54 | # For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2 |
| 55 | # and libfoo.so.1, you need to do the following: |
| 56 | #LIBCOMPATVERSIONS=1.2 1 |
| 57 | # Note that on systems that use sonames, the last number will appear as |
| 58 | # part of it. |
| 59 | # It's also possible, for systems that support it (Tru64, for example), |
| 60 | # to add extra compatibility info with more precision, by adding a second |
| 61 | # list of versions, separated from the first with a semicolon, like this: |
| 62 | #LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0 |
| 63 | LIBCOMPATVERSIONS= |
| 64 | |
| 65 | # LIBDEPS contains all the flags necessary to cover all necessary |
| 66 | # dependencies to other libraries. |
| 67 | LIBDEPS= |
| 68 | |
| 69 | #------------------------------------------------------------------------------ |
| 70 | # The rest is private to this makefile. |
| 71 | |
Andy Polyakov | c4cd925 | 2005-05-16 00:01:49 +0000 | [diff] [blame] | 72 | SET_X=: |
Andy Polyakov | 1dc02bb | 2010-07-15 13:55:38 +0000 | [diff] [blame] | 73 | #SET_X=set -x |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 74 | |
| 75 | top: |
| 76 | echo "Trying to use this makefile interactively? Don't." |
| 77 | |
| 78 | CALC_VERSIONS= \ |
| 79 | SHLIB_COMPAT=; SHLIB_SOVER=; \ |
Richard Levitte | cf3b8b5 | 2002-10-11 11:14:41 +0000 | [diff] [blame] | 80 | if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 81 | prev=""; \ |
| 82 | for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 83 | SHLIB_SOVER_NODOT=$$v; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 84 | SHLIB_SOVER=.$$v; \ |
| 85 | if [ -n "$$prev" ]; then \ |
Richard Levitte | a0bf8f2 | 2002-10-14 09:24:50 +0000 | [diff] [blame] | 86 | SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 87 | fi; \ |
| 88 | prev=$$v; \ |
| 89 | done; \ |
| 90 | fi |
| 91 | |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 92 | LINK_APP= \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 93 | ( $(SET_X); \ |
Andy Polyakov | 7858cc0 | 2005-06-22 23:42:34 +0000 | [diff] [blame] | 94 | LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \ |
| 95 | LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \ |
Andy Polyakov | ab4d689 | 2009-01-02 09:02:27 +0000 | [diff] [blame] | 96 | LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \ |
Richard Levitte | d6fd88f | 2003-04-08 08:57:23 +0000 | [diff] [blame] | 97 | LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ |
Richard Levitte | e96133e | 2003-04-08 08:36:20 +0000 | [diff] [blame] | 98 | LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ |
Andy Polyakov | 7858cc0 | 2005-06-22 23:42:34 +0000 | [diff] [blame] | 99 | $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} ) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 100 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 101 | LINK_SO= \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 102 | ( $(SET_X); \ |
Andy Polyakov | 7858cc0 | 2005-06-22 23:42:34 +0000 | [diff] [blame] | 103 | LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \ |
| 104 | SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \ |
| 105 | SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \ |
Andy Polyakov | ab4d689 | 2009-01-02 09:02:27 +0000 | [diff] [blame] | 106 | LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \ |
Richard Levitte | d6fd88f | 2003-04-08 08:57:23 +0000 | [diff] [blame] | 107 | LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ |
Richard Levitte | e96133e | 2003-04-08 08:36:20 +0000 | [diff] [blame] | 108 | LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ |
Andy Polyakov | 7858cc0 | 2005-06-22 23:42:34 +0000 | [diff] [blame] | 109 | $${SHAREDCMD} $${SHAREDFLAGS} \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 110 | -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \ |
| 111 | $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \ |
Andy Polyakov | d6c7645 | 2007-07-31 18:24:41 +0000 | [diff] [blame] | 112 | ) && $(SYMLINK_SO) |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 113 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 114 | SYMLINK_SO= \ |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 115 | if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \ |
| 116 | prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ |
| 117 | if [ -n "$$SHLIB_COMPAT" ]; then \ |
| 118 | for x in $$SHLIB_COMPAT; do \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 119 | ( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \ |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 120 | ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \ |
| 121 | prev=$$SHLIB$$x$$SHLIB_SUFFIX; \ |
| 122 | done; \ |
| 123 | fi; \ |
| 124 | if [ -n "$$SHLIB_SOVER" ]; then \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 125 | ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \ |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 126 | ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \ |
| 127 | fi; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 128 | fi |
Richard Levitte | cf3b8b5 | 2002-10-11 11:14:41 +0000 | [diff] [blame] | 129 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 130 | LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO) |
| 131 | LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO) |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 132 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 133 | LINK_SO_A_VIA_O= \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 134 | SHOBJECTS=lib$(LIBNAME).o; \ |
| 135 | ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 136 | ( $(SET_X); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 137 | ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \ |
Andy Polyakov | cad6650 | 2010-07-15 13:53:23 +0000 | [diff] [blame] | 138 | $(LINK_SO) && rm -f lib$(LIBNAME).o |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 139 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 140 | LINK_SO_A_UNPACKED= \ |
| 141 | UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \ |
Richard Levitte | e96133e | 2003-04-08 08:36:20 +0000 | [diff] [blame] | 142 | (cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \ |
| 143 | ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 144 | SHOBJECTS=$$UNPACKDIR/*.o; \ |
| 145 | $(LINK_SO) && rm -rf $$UNPACKDIR |
| 146 | |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 147 | DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null |
Andy Polyakov | 4d77d5b | 2002-12-14 20:52:19 +0000 | [diff] [blame] | 148 | |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 149 | DO_GNU_SO=$(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 150 | SHLIB=lib$(LIBNAME).so; \ |
| 151 | SHLIB_SUFFIX=; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 152 | ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
| 153 | NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 154 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" |
| 155 | |
| 156 | DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)" |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 157 | |
Richard Levitte | 132eaa5 | 2003-02-22 14:41:34 +0000 | [diff] [blame] | 158 | #This is rather special. It's a special target with which one can link |
| 159 | #applications without bothering with any features that have anything to |
| 160 | #do with shared libraries, for example when linking against static |
| 161 | #libraries. It's mostly here to avoid a lot of conditionals everywhere |
| 162 | #else... |
| 163 | link_app.: |
Richard Levitte | 132eaa5 | 2003-02-22 14:41:34 +0000 | [diff] [blame] | 164 | $(LINK_APP) |
| 165 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 166 | link_o.gnu: |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 167 | @ $(DO_GNU_SO); $(LINK_SO_O) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 168 | link_a.gnu: |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 169 | @ $(DO_GNU_SO); $(LINK_SO_A) |
| 170 | link_app.gnu: |
| 171 | @ $(DO_GNU_APP); $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 172 | |
Ulf Möller | 4700aea | 2006-04-11 21:34:21 +0000 | [diff] [blame] | 173 | DO_BEOS_SO= SHLIB=lib$(LIBNAME).so; \ |
| 174 | SHLIB_SUFFIX=; \ |
| 175 | ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
| 176 | NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
| 177 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SUFFIX" |
| 178 | |
| 179 | link_o.beos: |
| 180 | @ $(DO_BEOS_SO); $(LINK_SO_O) |
| 181 | link_a.beos: |
| 182 | @ $(DO_BEOS_SO); $(LINK_SO_A) |
| 183 | |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 184 | link_o.bsd: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 185 | @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 186 | $(CALC_VERSIONS); \ |
| 187 | SHLIB=lib$(LIBNAME).so; \ |
| 188 | SHLIB_SUFFIX=; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 189 | LIBDEPS=" "; \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 190 | ALLSYMSFLAGS="-Wl,-Bforcearchive"; \ |
| 191 | NOALLSYMSFLAGS=; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 192 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 193 | fi; $(LINK_SO_O) |
| 194 | link_a.bsd: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 195 | @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 196 | $(CALC_VERSIONS); \ |
| 197 | SHLIB=lib$(LIBNAME).so; \ |
| 198 | SHLIB_SUFFIX=; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 199 | LIBDEPS=" "; \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 200 | ALLSYMSFLAGS="-Wl,-Bforcearchive"; \ |
| 201 | NOALLSYMSFLAGS=; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 202 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 203 | fi; $(LINK_SO_A) |
| 204 | link_app.bsd: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 205 | @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 206 | LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \ |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 207 | fi; $(LINK_APP) |
| 208 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 209 | # For Darwin AKA Mac OS/X (dyld) |
Andy Polyakov | cad6650 | 2010-07-15 13:53:23 +0000 | [diff] [blame] | 210 | # Originally link_o.darwin produced .so, because it was hard-coded |
| 211 | # in dso_dlfcn module. At later point dso_dlfcn switched to .dylib |
| 212 | # extension in order to allow for run-time linking with vendor- |
| 213 | # supplied shared libraries such as libz, so that link_o.darwin had |
| 214 | # to be harmonized with it. This caused minor controversy, because |
| 215 | # it was believed that dlopen can't be used to dynamically load |
| 216 | # .dylib-s, only so called bundle modules (ones linked with -bundle |
| 217 | # flag). The belief seems to be originating from pre-10.4 release, |
| 218 | # where dlfcn functionality was emulated by dlcompat add-on. In |
| 219 | # 10.4 dlopen was rewritten as native part of dyld and is documented |
| 220 | # to be capable of loading both dynamic libraries and bundles. In |
| 221 | # order to provide compatibility with pre-10.4 dlopen, modules are |
| 222 | # linked with -bundle flag, which makes .dylib extension misleading. |
| 223 | # It works, because dlopen is [and always was] extension-agnostic. |
Andy Polyakov | 75db4b2 | 2010-07-16 08:15:28 +0000 | [diff] [blame] | 224 | # Alternative to this heuristic approach is to develop specific |
| 225 | # MacOS X dso module relying on whichever "native" dyld interface. |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 226 | link_o.darwin: |
| 227 | @ $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 228 | SHLIB=lib$(LIBNAME); \ |
Andy Polyakov | cad6650 | 2010-07-15 13:53:23 +0000 | [diff] [blame] | 229 | SHLIB_SUFFIX=.dylib; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 230 | ALLSYMSFLAGS='-all_load'; \ |
| 231 | NOALLSYMSFLAGS=''; \ |
Andy Polyakov | 72f4219 | 2010-08-21 11:34:46 +0000 | [diff] [blame] | 232 | SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 233 | if [ -n "$(LIBVERSION)" ]; then \ |
Andy Polyakov | 62966f3 | 2002-12-16 23:35:17 +0000 | [diff] [blame] | 234 | SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 235 | fi; \ |
| 236 | if [ -n "$$SHLIB_SOVER_NODOT" ]; then \ |
Andy Polyakov | 62966f3 | 2002-12-16 23:35:17 +0000 | [diff] [blame] | 237 | SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 238 | fi; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 239 | $(LINK_SO_O) |
| 240 | link_a.darwin: |
| 241 | @ $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 242 | SHLIB=lib$(LIBNAME); \ |
| 243 | SHLIB_SUFFIX=.dylib; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 244 | ALLSYMSFLAGS='-all_load'; \ |
| 245 | NOALLSYMSFLAGS=''; \ |
Andy Polyakov | ab6cf1b | 2005-06-23 20:44:27 +0000 | [diff] [blame] | 246 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 247 | if [ -n "$(LIBVERSION)" ]; then \ |
Andy Polyakov | 62966f3 | 2002-12-16 23:35:17 +0000 | [diff] [blame] | 248 | SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 249 | fi; \ |
| 250 | if [ -n "$$SHLIB_SOVER_NODOT" ]; then \ |
Andy Polyakov | 62966f3 | 2002-12-16 23:35:17 +0000 | [diff] [blame] | 251 | SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 252 | fi; \ |
Dr. Stephen Henson | 6727565 | 2009-08-10 14:48:40 +0000 | [diff] [blame] | 253 | SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 254 | $(LINK_SO_A) |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 255 | link_app.darwin: # is there run-path on darwin? |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 256 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 257 | |
| 258 | link_o.cygwin: |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 259 | @ $(CALC_VERSIONS); \ |
| 260 | INHIBIT_SYMLINKS=yes; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 261 | SHLIB=cyg$(LIBNAME); \ |
Andy Polyakov | cb1fbf9 | 2007-05-19 19:40:15 +0000 | [diff] [blame] | 262 | base=-Wl,--enable-auto-image-base; \ |
Lutz Jänicke | 4c1a6e0 | 2008-04-17 10:19:16 +0000 | [diff] [blame] | 263 | deffile=; \ |
Andy Polyakov | cb1fbf9 | 2007-05-19 19:40:15 +0000 | [diff] [blame] | 264 | if expr $(PLATFORM) : 'mingw' > /dev/null; then \ |
Lutz Jänicke | 4c1a6e0 | 2008-04-17 10:19:16 +0000 | [diff] [blame] | 265 | SHLIB=$(LIBNAME)eay32; base=; \ |
| 266 | if test -f $(LIBNAME)eay32.def; then \ |
| 267 | deffile=$(LIBNAME)eay32.def; \ |
| 268 | fi; \ |
Andy Polyakov | cb1fbf9 | 2007-05-19 19:40:15 +0000 | [diff] [blame] | 269 | fi; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 270 | SHLIB_SUFFIX=.dll; \ |
Richard Levitte | 447aa49 | 2005-05-21 16:41:34 +0000 | [diff] [blame] | 271 | LIBVERSION="$(LIBVERSION)"; \ |
| 272 | SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 273 | ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
| 274 | NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
Lutz Jänicke | 4c1a6e0 | 2008-04-17 10:19:16 +0000 | [diff] [blame] | 275 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 276 | $(LINK_SO_O) |
Lutz Jänicke | 4c1a6e0 | 2008-04-17 10:19:16 +0000 | [diff] [blame] | 277 | #for mingw target if def-file is in use dll-name should match library-name |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 278 | link_a.cygwin: |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 279 | @ $(CALC_VERSIONS); \ |
| 280 | INHIBIT_SYMLINKS=yes; \ |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 281 | SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \ |
| 282 | dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \ |
Andy Polyakov | cb1fbf9 | 2007-05-19 19:40:15 +0000 | [diff] [blame] | 283 | base=-Wl,--enable-auto-image-base; \ |
Andy Polyakov | 08a6382 | 2006-10-23 07:30:19 +0000 | [diff] [blame] | 284 | if expr $(PLATFORM) : 'mingw' > /dev/null; then \ |
Lutz Jänicke | 4c1a6e0 | 2008-04-17 10:19:16 +0000 | [diff] [blame] | 285 | case $(LIBNAME) in \ |
| 286 | crypto) SHLIB=libeay;; \ |
| 287 | ssl) SHLIB=ssleay;; \ |
| 288 | esac; \ |
| 289 | SHLIB_SOVER=32; \ |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 290 | extras="$(LIBNAME).def"; \ |
Lutz Jänicke | 4c1a6e0 | 2008-04-17 10:19:16 +0000 | [diff] [blame] | 291 | $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \ |
Andy Polyakov | cb1fbf9 | 2007-05-19 19:40:15 +0000 | [diff] [blame] | 292 | base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \ |
Andy Polyakov | 08a6382 | 2006-10-23 07:30:19 +0000 | [diff] [blame] | 293 | fi; \ |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 294 | dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ |
| 295 | $(PERL) util/mkrc.pl $$dll_name | \ |
Dr. Stephen Henson | 3477592 | 2009-10-15 23:43:54 +0000 | [diff] [blame] | 296 | $(CROSS_COMPILE)windres -o rc.o; \ |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 297 | extras="$$extras rc.o"; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 298 | ALLSYMSFLAGS='-Wl,--whole-archive'; \ |
| 299 | NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 300 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ |
| 301 | [ -f apps/$$dll_name ] && rm apps/$$dll_name; \ |
| 302 | [ -f test/$$dll_name ] && rm test/$$dll_name; \ |
Andy Polyakov | 94c1672 | 2005-04-30 23:45:53 +0000 | [diff] [blame] | 303 | $(LINK_SO_A) || exit 1; \ |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 304 | rm $$extras; \ |
| 305 | cp -p $$dll_name apps/; \ |
| 306 | cp -p $$dll_name test/ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 307 | link_app.cygwin: |
Andy Polyakov | 5b50f99 | 2006-10-24 22:14:20 +0000 | [diff] [blame] | 308 | @if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \ |
| 309 | LIBDEPS="$(TOP)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \ |
| 310 | export LIBDEPS; \ |
| 311 | fi; \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 312 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 313 | |
| 314 | link_o.alpha-osf1: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 315 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 316 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 317 | else \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 318 | SHLIB=lib$(LIBNAME).so; \ |
| 319 | SHLIB_SUFFIX=; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 320 | SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \ |
| 321 | if [ -n "$$SHLIB_HIST" ]; then \ |
| 322 | SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \ |
| 323 | else \ |
| 324 | SHLIB_HIST="$(LIBVERSION)"; \ |
Andy Polyakov | 62966f3 | 2002-12-16 23:35:17 +0000 | [diff] [blame] | 325 | fi; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 326 | SHLIB_SOVER=; \ |
| 327 | ALLSYMSFLAGS='-all'; \ |
| 328 | NOALLSYMSFLAGS='-none'; \ |
Andy Polyakov | ae4eb3c | 2007-08-26 14:12:30 +0000 | [diff] [blame] | 329 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 330 | if [ -n "$$SHLIB_HIST" ]; then \ |
Andy Polyakov | 9ab5170 | 2005-12-16 20:51:03 +0000 | [diff] [blame] | 331 | SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 332 | fi; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 333 | fi; \ |
| 334 | $(LINK_SO_O) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 335 | link_a.alpha-osf1: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 336 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 337 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 338 | else \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 339 | SHLIB=lib$(LIBNAME).so; \ |
| 340 | SHLIB_SUFFIX=; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 341 | SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \ |
| 342 | if [ -n "$$SHLIB_HIST" ]; then \ |
| 343 | SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \ |
| 344 | else \ |
| 345 | SHLIB_HIST="$(LIBVERSION)"; \ |
Andy Polyakov | 62966f3 | 2002-12-16 23:35:17 +0000 | [diff] [blame] | 346 | fi; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 347 | SHLIB_SOVER=; \ |
| 348 | ALLSYMSFLAGS='-all'; \ |
| 349 | NOALLSYMSFLAGS='-none'; \ |
Andy Polyakov | ae4eb3c | 2007-08-26 14:12:30 +0000 | [diff] [blame] | 350 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 351 | if [ -n "$$SHLIB_HIST" ]; then \ |
Andy Polyakov | 9ab5170 | 2005-12-16 20:51:03 +0000 | [diff] [blame] | 352 | SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \ |
Richard Levitte | 36757b4 | 2002-10-11 19:56:57 +0000 | [diff] [blame] | 353 | fi; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 354 | fi; \ |
| 355 | $(LINK_SO_A) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 356 | link_app.alpha-osf1: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 357 | @if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 358 | $(DO_GNU_APP); \ |
| 359 | else \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 360 | LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 361 | fi; \ |
| 362 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 363 | |
| 364 | link_o.solaris: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 365 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 366 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 367 | else \ |
| 368 | $(CALC_VERSIONS); \ |
Richard Levitte | c445142 | 2002-12-16 20:33:38 +0000 | [diff] [blame] | 369 | MINUSZ='-z '; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 370 | ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 371 | SHLIB=lib$(LIBNAME).so; \ |
| 372 | SHLIB_SUFFIX=; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 373 | ALLSYMSFLAGS="$${MINUSZ}allextract"; \ |
| 374 | NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 375 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 376 | fi; \ |
| 377 | $(LINK_SO_O) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 378 | link_a.solaris: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 379 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 380 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 381 | else \ |
| 382 | $(CALC_VERSIONS); \ |
Richard Levitte | c445142 | 2002-12-16 20:33:38 +0000 | [diff] [blame] | 383 | MINUSZ='-z '; \ |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 384 | ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 385 | SHLIB=lib$(LIBNAME).so; \ |
| 386 | SHLIB_SUFFIX=;\ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 387 | ALLSYMSFLAGS="$${MINUSZ}allextract"; \ |
| 388 | NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 389 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 390 | fi; \ |
| 391 | $(LINK_SO_A) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 392 | link_app.solaris: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 393 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 394 | $(DO_GNU_APP); \ |
| 395 | else \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 396 | LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 397 | fi; \ |
| 398 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 399 | |
| 400 | # OpenServer 5 native compilers used |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 401 | link_o.svr3: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 402 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 403 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 404 | else \ |
| 405 | $(CALC_VERSIONS); \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 406 | SHLIB=lib$(LIBNAME).so; \ |
| 407 | SHLIB_SUFFIX=; \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 408 | ALLSYMSFLAGS=''; \ |
| 409 | NOALLSYMSFLAGS=''; \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 410 | SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 411 | fi; \ |
| 412 | $(LINK_SO_O) |
| 413 | link_a.svr3: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 414 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 415 | $(DO_GNU_SO); \ |
| 416 | else \ |
| 417 | $(CALC_VERSIONS); \ |
| 418 | SHLIB=lib$(LIBNAME).so; \ |
| 419 | SHLIB_SUFFIX=; \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 420 | ALLSYMSFLAGS=''; \ |
| 421 | NOALLSYMSFLAGS=''; \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 422 | SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 423 | fi; \ |
| 424 | $(LINK_SO_A_UNPACKED) |
| 425 | link_app.svr3: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 426 | @$(DETECT_GNU_LD) && $(DO_GNU_APP); \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 427 | $(LINK_APP) |
| 428 | |
| 429 | # UnixWare 7 and OpenUNIX 8 native compilers used |
| 430 | link_o.svr5: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 431 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 432 | $(DO_GNU_SO); \ |
| 433 | else \ |
| 434 | $(CALC_VERSIONS); \ |
Richard Levitte | 24692fc | 2003-04-01 10:59:15 +0000 | [diff] [blame] | 435 | SHARE_FLAG='-G'; \ |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 436 | ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 437 | SHLIB=lib$(LIBNAME).so; \ |
| 438 | SHLIB_SUFFIX=; \ |
Richard Levitte | e96133e | 2003-04-08 08:36:20 +0000 | [diff] [blame] | 439 | ALLSYMSFLAGS=''; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 440 | NOALLSYMSFLAGS=''; \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 441 | SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 442 | fi; \ |
| 443 | $(LINK_SO_O) |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 444 | link_a.svr5: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 445 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 446 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 447 | else \ |
| 448 | $(CALC_VERSIONS); \ |
Richard Levitte | 24692fc | 2003-04-01 10:59:15 +0000 | [diff] [blame] | 449 | SHARE_FLAG='-G'; \ |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 450 | ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 451 | SHLIB=lib$(LIBNAME).so; \ |
| 452 | SHLIB_SUFFIX=; \ |
Richard Levitte | e96133e | 2003-04-08 08:36:20 +0000 | [diff] [blame] | 453 | ALLSYMSFLAGS=''; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 454 | NOALLSYMSFLAGS=''; \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 455 | SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 456 | fi; \ |
| 457 | $(LINK_SO_A_UNPACKED) |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 458 | link_app.svr5: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 459 | @$(DETECT_GNU_LD) && $(DO_GNU_APP); \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 460 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 461 | |
| 462 | link_o.irix: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 463 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 464 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 465 | else \ |
| 466 | $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 467 | SHLIB=lib$(LIBNAME).so; \ |
| 468 | SHLIB_SUFFIX=; \ |
Andy Polyakov | 30fbcaa | 2004-03-12 21:52:54 +0000 | [diff] [blame] | 469 | MINUSWL=""; \ |
| 470 | ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \ |
| 471 | ALLSYMSFLAGS="$${MINUSWL}-all"; \ |
Andy Polyakov | bd16cd6 | 2004-12-27 14:59:36 +0000 | [diff] [blame] | 472 | NOALLSYMSFLAGS="$${MINUSWL}-none"; \ |
Andy Polyakov | ae4eb3c | 2007-08-26 14:12:30 +0000 | [diff] [blame] | 473 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 474 | fi; \ |
| 475 | $(LINK_SO_O) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 476 | link_a.irix: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 477 | @ if $(DETECT_GNU_LD); then \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 478 | $(DO_GNU_SO); \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 479 | else \ |
| 480 | $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 481 | SHLIB=lib$(LIBNAME).so; \ |
| 482 | SHLIB_SUFFIX=; \ |
Andy Polyakov | 30fbcaa | 2004-03-12 21:52:54 +0000 | [diff] [blame] | 483 | MINUSWL=""; \ |
| 484 | ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \ |
| 485 | ALLSYMSFLAGS="$${MINUSWL}-all"; \ |
Andy Polyakov | bd16cd6 | 2004-12-27 14:59:36 +0000 | [diff] [blame] | 486 | NOALLSYMSFLAGS="$${MINUSWL}-none"; \ |
Andy Polyakov | ae4eb3c | 2007-08-26 14:12:30 +0000 | [diff] [blame] | 487 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \ |
Richard Levitte | 12fd8be | 2002-10-15 12:09:22 +0000 | [diff] [blame] | 488 | fi; \ |
| 489 | $(LINK_SO_A) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 490 | link_app.irix: |
Andy Polyakov | f210eb7 | 2005-05-15 23:59:04 +0000 | [diff] [blame] | 491 | @LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 492 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 493 | |
Andy Polyakov | 393b704 | 2004-05-31 22:29:26 +0000 | [diff] [blame] | 494 | # 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so |
| 495 | # we compensate for it with +cdp ../: and +cdp ./:. Yes, these rewrite |
| 496 | # rules imply that we can only link one level down in catalog structure, |
| 497 | # but that's what takes place for the moment of this writing. +cdp option |
| 498 | # was introduced in HP-UX 11.x and applies in 32-bit PA-RISC link |
| 499 | # editor context only [it's simply ignored in other cases, which are all |
| 500 | # ELFs by the way]. |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 501 | # |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 502 | link_o.hpux: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 503 | @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
Andy Polyakov | 15fd2de | 2004-05-28 22:38:05 +0000 | [diff] [blame] | 504 | $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 505 | SHLIB=lib$(LIBNAME).sl; \ |
Andy Polyakov | 74aa1a4 | 2006-05-20 08:52:34 +0000 | [diff] [blame] | 506 | expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 507 | SHLIB_SUFFIX=; \ |
Andy Polyakov | 2bbc970 | 2004-05-27 22:23:40 +0000 | [diff] [blame] | 508 | ALLSYMSFLAGS='-Wl,-Fl'; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 509 | NOALLSYMSFLAGS=''; \ |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 510 | expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ |
Andy Polyakov | 7df4c86 | 2007-09-16 14:11:00 +0000 | [diff] [blame] | 511 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \ |
Andy Polyakov | 15fd2de | 2004-05-28 22:38:05 +0000 | [diff] [blame] | 512 | fi; \ |
Andy Polyakov | a41b0aa | 2005-06-23 15:36:15 +0000 | [diff] [blame] | 513 | rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \ |
Richard Levitte | 83699c4 | 2002-10-11 07:33:38 +0000 | [diff] [blame] | 514 | $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 515 | link_a.hpux: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 516 | @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ |
Andy Polyakov | 15fd2de | 2004-05-28 22:38:05 +0000 | [diff] [blame] | 517 | $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 518 | SHLIB=lib$(LIBNAME).sl; \ |
Andy Polyakov | 8611934 | 2004-07-24 14:17:32 +0000 | [diff] [blame] | 519 | expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 520 | SHLIB_SUFFIX=; \ |
Andy Polyakov | 2bbc970 | 2004-05-27 22:23:40 +0000 | [diff] [blame] | 521 | ALLSYMSFLAGS='-Wl,-Fl'; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 522 | NOALLSYMSFLAGS=''; \ |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 523 | expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ |
Andy Polyakov | 7df4c86 | 2007-09-16 14:11:00 +0000 | [diff] [blame] | 524 | SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \ |
Andy Polyakov | 15fd2de | 2004-05-28 22:38:05 +0000 | [diff] [blame] | 525 | fi; \ |
Andy Polyakov | a41b0aa | 2005-06-23 15:36:15 +0000 | [diff] [blame] | 526 | rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \ |
Richard Levitte | 83699c4 | 2002-10-11 07:33:38 +0000 | [diff] [blame] | 527 | $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 528 | link_app.hpux: |
Andy Polyakov | a370537 | 2008-12-29 16:17:52 +0000 | [diff] [blame] | 529 | @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 530 | LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \ |
Andy Polyakov | 15fd2de | 2004-05-28 22:38:05 +0000 | [diff] [blame] | 531 | fi; \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 532 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 533 | |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 534 | link_o.aix: |
| 535 | @ $(CALC_VERSIONS); \ |
Andy Polyakov | 492279f | 2008-09-12 14:45:54 +0000 | [diff] [blame] | 536 | OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 537 | OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 538 | SHLIB=lib$(LIBNAME).so; \ |
| 539 | SHLIB_SUFFIX=; \ |
Andy Polyakov | 0d1aa74 | 2007-03-22 08:46:33 +0000 | [diff] [blame] | 540 | ALLSYMSFLAGS=''; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 541 | NOALLSYMSFLAGS=''; \ |
Andy Polyakov | 492279f | 2008-09-12 14:45:54 +0000 | [diff] [blame] | 542 | SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \ |
Andy Polyakov | 0d1aa74 | 2007-03-22 08:46:33 +0000 | [diff] [blame] | 543 | $(LINK_SO_O); |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 544 | link_a.aix: |
| 545 | @ $(CALC_VERSIONS); \ |
Andy Polyakov | 492279f | 2008-09-12 14:45:54 +0000 | [diff] [blame] | 546 | OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \ |
Andy Polyakov | fe28866 | 2005-02-06 13:18:40 +0000 | [diff] [blame] | 547 | OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 548 | SHLIB=lib$(LIBNAME).so; \ |
| 549 | SHLIB_SUFFIX=; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 550 | ALLSYMSFLAGS='-bnogc'; \ |
| 551 | NOALLSYMSFLAGS=''; \ |
Andy Polyakov | 492279f | 2008-09-12 14:45:54 +0000 | [diff] [blame] | 552 | SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 553 | $(LINK_SO_A_VIA_O) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 554 | link_app.aix: |
Andy Polyakov | b506821 | 2007-03-25 15:20:35 +0000 | [diff] [blame] | 555 | LDFLAGS="$(CFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \ |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 556 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 557 | |
| 558 | link_o.reliantunix: |
| 559 | @ $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 560 | SHLIB=lib$(LIBNAME).so; \ |
| 561 | SHLIB_SUFFIX=; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 562 | ALLSYMSFLAGS=; \ |
| 563 | NOALLSYMSFLAGS=''; \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 564 | SHAREDFLAGS='$(CFLAGS) -G'; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 565 | $(LINK_SO_O) |
| 566 | link_a.reliantunix: |
| 567 | @ $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 568 | SHLIB=lib$(LIBNAME).so; \ |
| 569 | SHLIB_SUFFIX=; \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 570 | ALLSYMSFLAGS=; \ |
| 571 | NOALLSYMSFLAGS=''; \ |
Richard Levitte | 4aca929 | 2005-01-26 23:51:20 +0000 | [diff] [blame] | 572 | SHAREDFLAGS='$(CFLAGS) -G'; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 573 | $(LINK_SO_A_UNPACKED) |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 574 | link_app.reliantunix: |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 575 | $(LINK_APP) |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 576 | |
| 577 | # Targets to build symbolic links when needed |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 578 | symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 579 | symlink.aix symlink.reliantunix: |
| 580 | @ $(CALC_VERSIONS); \ |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 581 | SHLIB=lib$(LIBNAME).so; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 582 | $(SYMLINK_SO) |
Richard Levitte | 83699c4 | 2002-10-11 07:33:38 +0000 | [diff] [blame] | 583 | symlink.darwin: |
| 584 | @ $(CALC_VERSIONS); \ |
Richard Levitte | f968059 | 2002-12-19 21:13:29 +0000 | [diff] [blame] | 585 | SHLIB=lib$(LIBNAME); \ |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 586 | SHLIB_SUFFIX=.dylib; \ |
Richard Levitte | 83699c4 | 2002-10-11 07:33:38 +0000 | [diff] [blame] | 587 | $(SYMLINK_SO) |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 588 | symlink.hpux: |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 589 | @ $(CALC_VERSIONS); \ |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 590 | SHLIB=lib$(LIBNAME).sl; \ |
Andy Polyakov | 8611934 | 2004-07-24 14:17:32 +0000 | [diff] [blame] | 591 | expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 592 | $(SYMLINK_SO) |
Richard Levitte | bfa96bc | 2002-11-15 16:56:36 +0000 | [diff] [blame] | 593 | # The following lines means those specific architectures do no symlinks |
Ulf Möller | 4700aea | 2006-04-11 21:34:21 +0000 | [diff] [blame] | 594 | symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos: |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 595 | |
| 596 | # Compatibility targets |
| 597 | link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu |
| 598 | link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 599 | link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu |
Andy Polyakov | 16760a3 | 2004-08-29 21:36:37 +0000 | [diff] [blame] | 600 | symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu |
| 601 | link_o.bsd-shared: link_o.bsd |
| 602 | link_a.bsd-shared: link_a.bsd |
| 603 | link_app.bsd-shared: link_app.bsd |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 604 | link_o.darwin-shared: link_o.darwin |
| 605 | link_a.darwin-shared: link_a.darwin |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 606 | link_app.darwin-shared: link_app.darwin |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 607 | symlink.darwin-shared: symlink.darwin |
| 608 | link_o.cygwin-shared: link_o.cygwin |
| 609 | link_a.cygwin-shared: link_a.cygwin |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 610 | link_app.cygwin-shared: link_app.cygwin |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 611 | symlink.cygwin-shared: symlink.cygwin |
| 612 | link_o.alpha-osf1-shared: link_o.alpha-osf1 |
| 613 | link_a.alpha-osf1-shared: link_a.alpha-osf1 |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 614 | link_app.alpha-osf1-shared: link_app.alpha-osf1 |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 615 | symlink.alpha-osf1-shared: symlink.alpha-osf1 |
| 616 | link_o.tru64-shared: link_o.tru64 |
| 617 | link_a.tru64-shared: link_a.tru64 |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 618 | link_app.tru64-shared: link_app.tru64 |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 619 | symlink.tru64-shared: symlink.tru64 |
| 620 | link_o.tru64-shared-rpath: link_o.tru64-rpath |
| 621 | link_a.tru64-shared-rpath: link_a.tru64-rpath |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 622 | link_app.tru64-shared-rpath: link_app.tru64-rpath |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 623 | symlink.tru64-shared-rpath: symlink.tru64-rpath |
| 624 | link_o.solaris-shared: link_o.solaris |
| 625 | link_a.solaris-shared: link_a.solaris |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 626 | link_app.solaris-shared: link_app.solaris |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 627 | symlink.solaris-shared: symlink.solaris |
| 628 | link_o.svr3-shared: link_o.svr3 |
| 629 | link_a.svr3-shared: link_a.svr3 |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 630 | link_app.svr3-shared: link_app.svr3 |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 631 | symlink.svr3-shared: symlink.svr3 |
Richard Levitte | a109220 | 2003-04-08 09:27:43 +0000 | [diff] [blame] | 632 | link_o.svr5-shared: link_o.svr5 |
| 633 | link_a.svr5-shared: link_a.svr5 |
| 634 | link_app.svr5-shared: link_app.svr5 |
| 635 | symlink.svr5-shared: symlink.svr5 |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 636 | link_o.irix-shared: link_o.irix |
| 637 | link_a.irix-shared: link_a.irix |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 638 | link_app.irix-shared: link_app.irix |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 639 | symlink.irix-shared: symlink.irix |
Andy Polyakov | 1a83c37 | 2004-05-28 22:18:48 +0000 | [diff] [blame] | 640 | link_o.hpux-shared: link_o.hpux |
| 641 | link_a.hpux-shared: link_a.hpux |
| 642 | link_app.hpux-shared: link_app.hpux |
| 643 | symlink.hpux-shared: symlink.hpux |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 644 | link_o.aix-shared: link_o.aix |
| 645 | link_a.aix-shared: link_a.aix |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 646 | link_app.aix-shared: link_app.aix |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 647 | symlink.aix-shared: symlink.aix |
| 648 | link_o.reliantunix-shared: link_o.reliantunix |
| 649 | link_a.reliantunix-shared: link_a.reliantunix |
Richard Levitte | 2d3de72 | 2003-02-13 23:52:54 +0000 | [diff] [blame] | 650 | link_app.reliantunix-shared: link_app.reliantunix |
Richard Levitte | 30afcc0 | 2002-10-11 00:37:11 +0000 | [diff] [blame] | 651 | symlink.reliantunix-shared: symlink.reliantunix |
Ulf Möller | 4700aea | 2006-04-11 21:34:21 +0000 | [diff] [blame] | 652 | link_o.beos-shared: link_o.beos |
| 653 | link_a.beos-shared: link_a.beos |
| 654 | link_app.beos-shared: link_app.gnu |
| 655 | symlink.beos-shared: symlink.beos |