2 # Helper makefile to link shared libraries in a portable way.
3 # This is much simpler than libtool, and hopefully not too error-prone.
5 # The following variables need to be set on the command line to build
8 # CC contains the current compiler. This one MUST be defined
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.
19 # LIBNAME contains just the name of the library, without prefix ("lib"
20 # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
21 # .dll, ...). This one MUST have a value when using this makefile to
22 # build shared libraries.
23 # For example, to build libfoo.so, you need to do the following:
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:
34 # OBJECTS contains all the object files to link together into the application.
35 # This must contain at least one object file.
39 # LIBEXTRAS contains extra modules to link together with the library.
40 # For example, if a second library, say libbar.a needs to be linked into
41 # libfoo.so, you need to do the following:
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.
47 # LIBVERSION contains the current version of the library.
48 # For example, to build libfoo.so.1.2, you need to do the following:
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
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
65 # LIBDEPS contains all the flags necessary to cover all necessary
66 # dependencies to other libraries.
69 #------------------------------------------------------------------------------
70 # The rest is private to this makefile.
76 echo "Trying to use this makefile interactively? Don't."
79 SHLIB_COMPAT=; SHLIB_SOVER=; \
80 if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
82 for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
83 SHLIB_SOVER_NODOT=$$v; \
85 if [ -n "$$prev" ]; then \
86 SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
94 LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
95 LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
96 LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
97 LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
98 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
99 $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
103 LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
104 SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
105 SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
106 LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
107 LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
108 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
109 $${SHAREDCMD} $${SHAREDFLAGS} \
110 -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
111 $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
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 \
119 ( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
120 ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
121 prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
124 if [ -n "$$SHLIB_SOVER" ]; then \
125 ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
126 ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
130 LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
131 LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
134 SHOBJECTS=lib$(LIBNAME).o; \
135 ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
137 ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
138 $(LINK_SO) && rm -f lib$(LIBNAME).o
140 LINK_SO_A_UNPACKED= \
141 UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
142 (cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \
143 ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
144 SHOBJECTS=$$UNPACKDIR/*.o; \
145 $(LINK_SO) && rm -rf $$UNPACKDIR
147 DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
149 DO_GNU_SO=$(CALC_VERSIONS); \
150 SHLIB=lib$(LIBNAME).so; \
152 ALLSYMSFLAGS='-Wl,--whole-archive'; \
153 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
154 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
156 DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
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
167 @ $(DO_GNU_SO); $(LINK_SO_O)
169 @ $(DO_GNU_SO); $(LINK_SO_A)
171 @ $(DO_GNU_APP); $(LINK_APP)
173 DO_BEOS_SO= SHLIB=lib$(LIBNAME).so; \
175 ALLSYMSFLAGS='-Wl,--whole-archive'; \
176 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
177 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SUFFIX"
180 @ $(DO_BEOS_SO); $(LINK_SO_O)
182 @ $(DO_BEOS_SO); $(LINK_SO_A)
185 @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
187 SHLIB=lib$(LIBNAME).so; \
190 ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
192 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
195 @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
197 SHLIB=lib$(LIBNAME).so; \
200 ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
202 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
205 @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
206 LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
209 # For Darwin AKA Mac OS/X (dyld)
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.
224 # Alternative to this heuristic approach is to develop specific
225 # MacOS X dso module relying on whichever "native" dyld interface.
227 @ $(CALC_VERSIONS); \
228 SHLIB=lib$(LIBNAME); \
229 SHLIB_SUFFIX=.dylib; \
230 ALLSYMSFLAGS='-all_load'; \
232 SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
233 if [ -n "$(LIBVERSION)" ]; then \
234 SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
236 if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
237 SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
241 @ $(CALC_VERSIONS); \
242 SHLIB=lib$(LIBNAME); \
243 SHLIB_SUFFIX=.dylib; \
244 ALLSYMSFLAGS='-all_load'; \
246 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
247 if [ -n "$(LIBVERSION)" ]; then \
248 SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
250 if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
251 SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
253 SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \
255 link_app.darwin: # is there run-path on darwin?
259 @ $(CALC_VERSIONS); \
260 INHIBIT_SYMLINKS=yes; \
261 SHLIB=cyg$(LIBNAME); \
262 base=-Wl,--enable-auto-image-base; \
264 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
265 SHLIB=$(LIBNAME)eay32; base=; \
266 if test -f $(LIBNAME)eay32.def; then \
267 deffile=$(LIBNAME)eay32.def; \
271 LIBVERSION="$(LIBVERSION)"; \
272 SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
273 ALLSYMSFLAGS='-Wl,--whole-archive'; \
274 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
275 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \
277 #for mingw target if def-file is in use dll-name should match library-name
279 @ $(CALC_VERSIONS); \
280 INHIBIT_SYMLINKS=yes; \
281 SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
282 dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
283 base=-Wl,--enable-auto-image-base; \
284 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
286 crypto) SHLIB=libeay;; \
287 ssl) SHLIB=ssleay;; \
290 extras="$(LIBNAME).def"; \
291 $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \
292 base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
294 dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
295 $(PERL) util/mkrc.pl $$dll_name | \
296 $(CROSS_COMPILE)windres -o rc.o; \
297 extras="$$extras rc.o"; \
298 ALLSYMSFLAGS='-Wl,--whole-archive'; \
299 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
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; \
303 $(LINK_SO_A) || exit 1; \
305 cp -p $$dll_name apps/; \
306 cp -p $$dll_name test/
308 @if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \
309 LIBDEPS="$(TOP)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \
315 @ if $(DETECT_GNU_LD); then \
318 SHLIB=lib$(LIBNAME).so; \
320 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
321 if [ -n "$$SHLIB_HIST" ]; then \
322 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
324 SHLIB_HIST="$(LIBVERSION)"; \
327 ALLSYMSFLAGS='-all'; \
328 NOALLSYMSFLAGS='-none'; \
329 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
330 if [ -n "$$SHLIB_HIST" ]; then \
331 SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
336 @ if $(DETECT_GNU_LD); then \
339 SHLIB=lib$(LIBNAME).so; \
341 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
342 if [ -n "$$SHLIB_HIST" ]; then \
343 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
345 SHLIB_HIST="$(LIBVERSION)"; \
348 ALLSYMSFLAGS='-all'; \
349 NOALLSYMSFLAGS='-none'; \
350 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
351 if [ -n "$$SHLIB_HIST" ]; then \
352 SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
357 @if $(DETECT_GNU_LD); then \
360 LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
365 @ if $(DETECT_GNU_LD); then \
370 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
371 SHLIB=lib$(LIBNAME).so; \
373 ALLSYMSFLAGS="$${MINUSZ}allextract"; \
374 NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
375 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
379 @ if $(DETECT_GNU_LD); then \
384 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
385 SHLIB=lib$(LIBNAME).so; \
387 ALLSYMSFLAGS="$${MINUSZ}allextract"; \
388 NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
389 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
393 @ if $(DETECT_GNU_LD); then \
396 LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
400 # OpenServer 5 native compilers used
402 @ if $(DETECT_GNU_LD); then \
406 SHLIB=lib$(LIBNAME).so; \
410 SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
414 @ if $(DETECT_GNU_LD); then \
418 SHLIB=lib$(LIBNAME).so; \
422 SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
424 $(LINK_SO_A_UNPACKED)
426 @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
429 # UnixWare 7 and OpenUNIX 8 native compilers used
431 @ if $(DETECT_GNU_LD); then \
436 ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
437 SHLIB=lib$(LIBNAME).so; \
441 SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
445 @ if $(DETECT_GNU_LD); then \
450 ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
451 SHLIB=lib$(LIBNAME).so; \
455 SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
457 $(LINK_SO_A_UNPACKED)
459 @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
463 @ if $(DETECT_GNU_LD); then \
467 SHLIB=lib$(LIBNAME).so; \
470 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
471 ALLSYMSFLAGS="$${MINUSWL}-all"; \
472 NOALLSYMSFLAGS="$${MINUSWL}-none"; \
473 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \
477 @ if $(DETECT_GNU_LD); then \
481 SHLIB=lib$(LIBNAME).so; \
484 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
485 ALLSYMSFLAGS="$${MINUSWL}-all"; \
486 NOALLSYMSFLAGS="$${MINUSWL}-none"; \
487 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \
491 @LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
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
503 @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
505 SHLIB=lib$(LIBNAME).sl; \
506 expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \
508 ALLSYMSFLAGS='-Wl,-Fl'; \
510 expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
511 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
513 rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
514 $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
516 @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
518 SHLIB=lib$(LIBNAME).sl; \
519 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
521 ALLSYMSFLAGS='-Wl,-Fl'; \
523 expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
524 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
526 rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
527 $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
529 @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
530 LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
535 @ $(CALC_VERSIONS); \
536 OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
537 OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
538 SHLIB=lib$(LIBNAME).so; \
542 SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
545 @ $(CALC_VERSIONS); \
546 OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \
547 OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
548 SHLIB=lib$(LIBNAME).so; \
550 ALLSYMSFLAGS='-bnogc'; \
552 SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
555 LDFLAGS="$(CFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
559 @ $(CALC_VERSIONS); \
560 SHLIB=lib$(LIBNAME).so; \
564 SHAREDFLAGS='$(CFLAGS) -G'; \
567 @ $(CALC_VERSIONS); \
568 SHLIB=lib$(LIBNAME).so; \
572 SHAREDFLAGS='$(CFLAGS) -G'; \
573 $(LINK_SO_A_UNPACKED)
574 link_app.reliantunix:
577 # Targets to build symbolic links when needed
578 symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
579 symlink.aix symlink.reliantunix:
580 @ $(CALC_VERSIONS); \
581 SHLIB=lib$(LIBNAME).so; \
584 @ $(CALC_VERSIONS); \
585 SHLIB=lib$(LIBNAME); \
586 SHLIB_SUFFIX=.dylib; \
589 @ $(CALC_VERSIONS); \
590 SHLIB=lib$(LIBNAME).sl; \
591 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
593 # The following lines means those specific architectures do no symlinks
594 symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos:
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
599 link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
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
604 link_o.darwin-shared: link_o.darwin
605 link_a.darwin-shared: link_a.darwin
606 link_app.darwin-shared: link_app.darwin
607 symlink.darwin-shared: symlink.darwin
608 link_o.cygwin-shared: link_o.cygwin
609 link_a.cygwin-shared: link_a.cygwin
610 link_app.cygwin-shared: link_app.cygwin
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
614 link_app.alpha-osf1-shared: link_app.alpha-osf1
615 symlink.alpha-osf1-shared: symlink.alpha-osf1
616 link_o.tru64-shared: link_o.tru64
617 link_a.tru64-shared: link_a.tru64
618 link_app.tru64-shared: link_app.tru64
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
622 link_app.tru64-shared-rpath: link_app.tru64-rpath
623 symlink.tru64-shared-rpath: symlink.tru64-rpath
624 link_o.solaris-shared: link_o.solaris
625 link_a.solaris-shared: link_a.solaris
626 link_app.solaris-shared: link_app.solaris
627 symlink.solaris-shared: symlink.solaris
628 link_o.svr3-shared: link_o.svr3
629 link_a.svr3-shared: link_a.svr3
630 link_app.svr3-shared: link_app.svr3
631 symlink.svr3-shared: symlink.svr3
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
636 link_o.irix-shared: link_o.irix
637 link_a.irix-shared: link_a.irix
638 link_app.irix-shared: link_app.irix
639 symlink.irix-shared: symlink.irix
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
644 link_o.aix-shared: link_o.aix
645 link_a.aix-shared: link_a.aix
646 link_app.aix-shared: link_app.aix
647 symlink.aix-shared: symlink.aix
648 link_o.reliantunix-shared: link_o.reliantunix
649 link_a.reliantunix-shared: link_a.reliantunix
650 link_app.reliantunix-shared: link_app.reliantunix
651 symlink.reliantunix-shared: symlink.reliantunix
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