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.
15 SHARED_LDFLAGS=$(SHARED_LDFLAG)
17 # SHARED_RCFLAGS are flags used with windres, i.e. when build for Cygwin
19 SHARED_RCFLAGS=$(SHARED_RCFLAG)
23 # LIBNAME contains just the name of the library, without prefix ("lib"
24 # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
25 # .dll, ...). This one MUST have a value when using this makefile to
26 # build shared libraries.
27 # For example, to build libfoo.so, you need to do the following:
31 # APPNAME contains just the name of the application, without suffix (""
32 # on Unix, ".exe" on Windows, ...). This one MUST have a value when using
33 # this makefile to build applications.
34 # For example, to build foo, you need to do the following:
38 # DSTDIR is the directory where the built file should end up in.
41 # SRCDIR is the top directory of the source tree.
44 # OBJECTS contains all the object files to link together into the application.
45 # This must contain at least one object file.
49 # LIBEXTRAS contains extra modules to link together with the library.
50 # For example, if a second library, say libbar.a needs to be linked into
51 # libfoo.so, you need to do the following:
53 # Note that this MUST be used when using the link_dso targets, to hold the
54 # names of all object files that go into the target shared object.
57 # LIBVERSION contains the current version of the library.
58 # For example, to build libfoo.so.1.2, you need to do the following:
62 # LIBCOMPATVERSIONS contains the compatibility versions (a list) of
63 # the library. They MUST be in decreasing order.
64 # For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2
65 # and libfoo.so.1, you need to do the following:
66 #LIBCOMPATVERSIONS=1.2 1
67 # Note that on systems that use sonames, the last number will appear as
69 # It's also possible, for systems that support it (Tru64, for example),
70 # to add extra compatibility info with more precision, by adding a second
71 # list of versions, separated from the first with a semicolon, like this:
72 #LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0
75 # LIBDEPS contains all the flags necessary to cover all necessary
76 # dependencies to other libraries.
79 #------------------------------------------------------------------------------
80 # The rest is private to this makefile.
86 echo "Trying to use this makefile interactively? Don't."
89 SHLIB_COMPAT=; SHLIB_SOVER=; \
90 if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
92 for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
93 SHLIB_SOVER_NODOT=$$v; \
95 if [ -n "$$prev" ]; then \
96 SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
104 LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
105 LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS) $(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 echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
109 $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS}; \
110 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
111 $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
115 LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
116 SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
117 SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
118 LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
119 LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
120 echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
121 $${SHAREDCMD} $${SHAREDFLAGS} \
122 -o $(DSTDIR)/$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
123 $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS; \
124 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
125 $${SHAREDCMD} $${SHAREDFLAGS} \
126 -o $(DSTDIR)/$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
127 $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
131 if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
132 prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
133 if [ -n "$$SHLIB_COMPAT" ]; then \
134 for x in $$SHLIB_COMPAT; do \
135 ( $(SET_X); rm -f $(DSTDIR)/$$SHLIB$$x$$SHLIB_SUFFIX; \
136 ln -s $$prev $(DSTDIR)/$$SHLIB$$x$$SHLIB_SUFFIX ); \
137 prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
140 if [ -n "$$SHLIB_SOVER" ]; then \
141 ( $(SET_X); rm -f $(DSTDIR)/$$SHLIB$$SHLIB_SUFFIX; \
142 ln -s $$prev $(DSTDIR)/$$SHLIB$$SHLIB_SUFFIX ); \
146 LINK_SO_SHLIB= SHOBJECTS="$(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
147 LINK_SO_DSO= INHIBIT_SYMLINKS=yes; SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
149 LINK_SO_SHLIB_VIA_O= \
150 SHOBJECTS=$(DSTDIR)/lib$(LIBNAME).o; \
151 ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
152 ( echo ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \
153 ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL $(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS) ); \
154 $(LINK_SO) && ( echo rm -f $$SHOBJECTS; rm -f $$SHOBJECTS )
156 LINK_SO_SHLIB_UNPACKED= \
157 UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
158 (cd $$UNPACKDIR; ar x ../$(DSTDIR)/lib$(LIBNAME).a) && \
159 ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
160 SHOBJECTS=$$UNPACKDIR/*.o; \
161 $(LINK_SO) && rm -rf $$UNPACKDIR
163 DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
166 SHLIB=lib$(LIBNAME).so; \
168 ALLSYMSFLAGS='-Wl,--whole-archive'; \
169 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
170 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
171 DO_GNU_SO=$(CALC_VERSIONS); $(DO_GNU_SO_NOCALC); SHLIB=lib$$SHLIB
172 DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"
174 #This is rather special. It's a special target with which one can link
175 #applications without bothering with any features that have anything to
176 #do with shared libraries, for example when linking against static
177 #libraries. It's mostly here to avoid a lot of conditionals everywhere
183 @ $(DO_GNU_SO_NOCALC); $(LINK_SO_DSO)
185 @ $(DO_GNU_SO); $(LINK_SO_SHLIB)
187 @ $(DO_GNU_APP); $(LINK_APP)
189 link_shlib.linux-shared:
190 @$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
192 ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \
196 @if $(DETECT_GNU_LD); then $(DO_GNU_SO_NOCALC); 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_SO); else \
207 SHLIB=lib$(LIBNAME).so; \
210 ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
212 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
215 @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
216 LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \
219 # For Darwin AKA Mac OS/X (dyld)
220 # Originally link_dso.darwin produced .so, because it was hard-coded
221 # in dso_dlfcn module. At later point dso_dlfcn switched to .dylib
222 # extension in order to allow for run-time linking with vendor-
223 # supplied shared libraries such as libz, so that link_dso.darwin had
224 # to be harmonized with it. This caused minor controversy, because
225 # it was believed that dlopen can't be used to dynamically load
226 # .dylib-s, only so called bundle modules (ones linked with -bundle
227 # flag). The belief seems to be originating from pre-10.4 release,
228 # where dlfcn functionality was emulated by dlcompat add-on. In
229 # 10.4 dlopen was rewritten as native part of dyld and is documented
230 # to be capable of loading both dynamic libraries and bundles. In
231 # order to provide compatibility with pre-10.4 dlopen, modules are
232 # linked with -bundle flag, which makes .dylib extension misleading.
233 # It works, because dlopen is [and always was] extension-agnostic.
234 # Alternative to this heuristic approach is to develop specific
235 # MacOS X dso module relying on whichever "native" dyld interface.
237 @ SHLIB=lib$(LIBNAME); \
238 SHLIB_SUFFIX=.dylib; \
239 ALLSYMSFLAGS='-all_load'; \
241 SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
244 @ $(CALC_VERSIONS); \
245 SHLIB=lib$(LIBNAME); \
246 SHLIB_SUFFIX=.dylib; \
247 ALLSYMSFLAGS='-all_load'; \
249 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
250 if [ -n "$(LIBVERSION)" ]; then \
251 SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
253 if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
254 SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
256 SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \
258 link_app.darwin: # is there run-path on darwin?
262 INHIBIT_SYMLINKS=yes; \
263 SHLIB=cyg$(LIBNAME); \
264 base=-Wl,--enable-auto-image-base; \
266 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
267 SHLIB=$(LIBNAME)eay32; base=; \
268 if test -f $(LIBNAME)eay32.def; then \
269 deffile=$(LIBNAME)eay32.def; \
273 ALLSYMSFLAGS='-Wl,--whole-archive'; \
274 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
275 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-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) $(SRCDIR)/util/mkdef.pl 32 $$SHLIB > $$extras; \
292 base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
294 dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
295 echo "$(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name |" \
296 "$(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o"; \
297 $(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name | \
298 $(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
299 extras="$$extras rc.o"; \
300 ALLSYMSFLAGS='-Wl,--whole-archive'; \
301 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
302 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
303 $(LINK_SO_SHLIB) || exit 1; \
309 @ if $(DETECT_GNU_LD); then \
310 $(DO_GNU_SO_NOCALC); \
312 SHLIB=lib$(LIBNAME).so; \
314 ALLSYMSFLAGS='-all'; \
315 NOALLSYMSFLAGS='-none'; \
316 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
319 link_shlib.alpha-osf1:
320 @ if $(DETECT_GNU_LD); then \
323 SHLIB=lib$(LIBNAME).so; \
325 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
326 if [ -n "$$SHLIB_HIST" ]; then \
327 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
329 SHLIB_HIST="$(LIBVERSION)"; \
332 ALLSYMSFLAGS='-all'; \
333 NOALLSYMSFLAGS='-none'; \
334 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
335 if [ -n "$$SHLIB_HIST" ]; then \
336 SHAREDFLAGS="$$SHAREDFLAGS -set_version $$SHLIB_HIST"; \
341 @if $(DETECT_GNU_LD); then \
344 LDFLAGS="$(CFLAGS) $(LDFLAGS) -rpath $(LIBRPATH)"; \
349 @ if $(DETECT_GNU_LD); then \
350 $(DO_GNU_SO_NOCALC); \
353 SHLIB=lib$(LIBNAME).so; \
355 ALLSYMSFLAGS="-Wl,-z,allextract"; \
356 NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \
357 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
361 @ if $(DETECT_GNU_LD); then \
365 SHLIB=lib$(LIBNAME).so; \
367 $(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
368 ALLSYMSFLAGS="-Wl,-z,allextract,-M,$(LIBNAME).map"; \
369 NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \
370 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
374 @ if $(DETECT_GNU_LD); then \
377 LDFLAGS="$(CFLAGS) $(LDFLAGS) -R $(LIBRPATH)"; \
381 # OpenServer 5 native compilers used
383 @ if $(DETECT_GNU_LD); then \
384 $(DO_GNU_SO_NOCALC); \
387 SHLIB=lib$(LIBNAME).so; \
391 SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SUFFIX"; \
395 @ if $(DETECT_GNU_LD); then \
399 SHLIB=lib$(LIBNAME).so; \
403 SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
405 $(LINK_SO_SHLIB_UNPACKED)
407 @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
410 # UnixWare 7 and OpenUNIX 8 native compilers used
412 @ if $(DETECT_GNU_LD); then \
413 $(DO_GNU_SO_NOCALC); \
416 ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
417 SHLIB=lib$(LIBNAME).so; \
421 SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SUFFIX"; \
425 @ if $(DETECT_GNU_LD); then \
430 ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
431 SHLIB=lib$(LIBNAME).so; \
435 SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
437 $(LINK_SO_SHLIB_UNPACKED)
439 @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
443 @ if $(DETECT_GNU_LD); then \
444 $(DO_GNU_SO_NOCALC); \
446 SHLIB=lib$(LIBNAME).so; \
449 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
450 ALLSYMSFLAGS="$${MINUSWL}-all"; \
451 NOALLSYMSFLAGS="$${MINUSWL}-none"; \
452 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SUFFIX,-B,symbolic"; \
456 @ if $(DETECT_GNU_LD); then \
460 SHLIB=lib$(LIBNAME).so; \
463 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
464 ALLSYMSFLAGS="$${MINUSWL}-all"; \
465 NOALLSYMSFLAGS="$${MINUSWL}-none"; \
466 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,-B,symbolic"; \
470 @LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
473 # 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
474 # we compensate for it with +cdp ../: and +cdp ./:. Yes, these rewrite
475 # rules imply that we can only link one level down in catalog structure,
476 # but that's what takes place for the moment of this writing. +cdp option
477 # was introduced in HP-UX 11.x and applies in 32-bit PA-RISC link
478 # editor context only [it's simply ignored in other cases, which are all
482 @if $(DETECT_GNU_LD); then $(DO_GNU_SO_NOCALC); else \
483 SHLIB=lib$(LIBNAME).sl; \
484 expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \
486 ALLSYMSFLAGS='-Wl,-Fl'; \
488 expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
489 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
491 rm -f $$SHLIB$$SHLIB_SUFFIX || :; \
492 $(LINK_SO_DSO) && chmod a=rx $$SHLIB$$SHLIB_SUFFIX
494 @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
496 SHLIB=lib$(LIBNAME).sl; \
497 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
499 ALLSYMSFLAGS='-Wl,-Fl'; \
501 expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
502 SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+cdp,../:,+cdp,./:"; \
504 rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
505 $(LINK_SO_SHLIB) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
507 @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
508 LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
513 @OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
514 OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
515 SHLIB=lib$(LIBNAME).so; \
519 SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
522 @ $(CALC_VERSIONS); \
523 OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \
524 OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
525 SHLIB=lib$(LIBNAME).so; \
527 ALLSYMSFLAGS='-bnogc'; \
529 SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
530 $(LINK_SO_SHLIB_VIA_O)
532 LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
536 # Targets to build symbolic links when needed
537 symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
539 @ $(CALC_VERSIONS); \
540 SHLIB=lib$(LIBNAME).so; \
543 @ $(CALC_VERSIONS); \
544 SHLIB=lib$(LIBNAME); \
545 SHLIB_SUFFIX=.dylib; \
548 @ $(CALC_VERSIONS); \
549 SHLIB=lib$(LIBNAME).sl; \
550 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
552 # The following lines means those specific architectures do no symlinks
553 symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
555 # Compatibility targets
556 link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared: link_dso.gnu
557 link_shlib.bsd-gcc-shared link_shlib.gnu-shared: link_shlib.gnu
558 link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
559 symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
560 link_dso.bsd-shared: link_dso.bsd
561 link_shlib.bsd-shared: link_shlib.bsd
562 link_app.bsd-shared: link_app.bsd
563 link_dso.darwin-shared: link_dso.darwin
564 link_shlib.darwin-shared: link_shlib.darwin
565 link_app.darwin-shared: link_app.darwin
566 symlink.darwin-shared: symlink.darwin
567 link_dso.cygwin-shared: link_dso.cygwin
568 link_shlib.cygwin-shared: link_shlib.cygwin
569 link_app.cygwin-shared: link_app.cygwin
570 symlink.cygwin-shared: symlink.cygwin
571 link_dso.alpha-osf1-shared: link_dso.alpha-osf1
572 link_shlib.alpha-osf1-shared: link_shlib.alpha-osf1
573 link_app.alpha-osf1-shared: link_app.alpha-osf1
574 symlink.alpha-osf1-shared: symlink.alpha-osf1
575 link_dso.tru64-shared: link_dso.tru64
576 link_shlib.tru64-shared: link_shlib.tru64
577 link_app.tru64-shared: link_app.tru64
578 symlink.tru64-shared: symlink.tru64
579 link_dso.tru64-shared-rpath: link_dso.tru64-rpath
580 link_shlib.tru64-shared-rpath: link_shlib.tru64-rpath
581 link_app.tru64-shared-rpath: link_app.tru64-rpath
582 symlink.tru64-shared-rpath: symlink.tru64-rpath
583 link_dso.solaris-shared: link_dso.solaris
584 link_shlib.solaris-shared: link_shlib.solaris
585 link_app.solaris-shared: link_app.solaris
586 symlink.solaris-shared: symlink.solaris
587 link_dso.svr3-shared: link_dso.svr3
588 link_shlib.svr3-shared: link_shlib.svr3
589 link_app.svr3-shared: link_app.svr3
590 symlink.svr3-shared: symlink.svr3
591 link_dso.svr5-shared: link_dso.svr5
592 link_shlib.svr5-shared: link_shlib.svr5
593 link_app.svr5-shared: link_app.svr5
594 symlink.svr5-shared: symlink.svr5
595 link_dso.irix-shared: link_dso.irix
596 link_shlib.irix-shared: link_shlib.irix
597 link_app.irix-shared: link_app.irix
598 symlink.irix-shared: symlink.irix
599 link_dso.hpux-shared: link_dso.hpux
600 link_shlib.hpux-shared: link_shlib.hpux
601 link_app.hpux-shared: link_app.hpux
602 symlink.hpux-shared: symlink.hpux
603 link_dso.aix-shared: link_dso.aix
604 link_shlib.aix-shared: link_shlib.aix
605 link_app.aix-shared: link_app.aix
606 symlink.aix-shared: symlink.aix