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
10 # LDFLAGS contains flags to be used when temporary object files (when building
11 # shared libraries) are created, or when an application is linked.
12 # SHARED_LDFLAGS contains flags to be used when the shared library is created.
16 # LIBNAME contains just the name of the library, without prefix ("lib"
17 # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
18 # .dll, ...). This one MUST have a value when using this makefile to
19 # build shared libraries.
20 # For example, to build libfoo.so, you need to do the following:
24 # APPNAME contains just the name of the application, without suffix (""
25 # on Unix, ".exe" on Windows, ...). This one MUST have a value when using
26 # this makefile to build applications.
27 # For example, to build foo, you need to do the following:
31 # OBJECTS contains all the object files to link together into the application.
32 # This must contain at least one object file.
36 # LIBEXTRAS contains extra modules to link together with the library.
37 # For example, if a second library, say libbar.a needs to be linked into
38 # libfoo.so, you need to do the following:
40 # Note that this MUST be used when using the link_o targets, to hold the
41 # names of all object files that go into the target library.
44 # LIBVERSION contains the current version of the library.
45 # For example, to build libfoo.so.1.2, you need to do the following:
49 # LIBCOMPATVERSIONS contains the compatibility versions (a list) of
50 # the library. They MUST be in decreasing order.
51 # For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2
52 # and libfoo.so.1, you need to do the following:
53 #LIBCOMPATVERSIONS=1.2 1
54 # Note that on systems that use sonames, the last number will appear as
56 # It's also possible, for systems that support it (Tru64, for example),
57 # to add extra compatibility info with more precision, by adding a second
58 # list of versions, separated from the first with a semicolon, like this:
59 #LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0
62 # LIBDEPS contains all the flags necessary to cover all necessary
63 # dependencies to other libraries.
66 #------------------------------------------------------------------------------
67 # The rest is private to this makefile.
73 echo "Trying to use this makefile interactively? Don't."
76 SHLIB_COMPAT=; SHLIB_SOVER=; \
77 if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
79 for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
80 SHLIB_SOVER_NODOT=$$v; \
82 if [ -n "$$prev" ]; then \
83 SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
91 LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
92 LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
93 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
94 $$LDCMD $(LDFLAGS) $$LDFLAGS -o $$APPNAME $(OBJECTS) $$LIBDEPS )
98 nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
99 LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
100 LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
101 LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
102 $$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
103 $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
104 $(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
106 if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
107 prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
108 if [ -n "$$SHLIB_COMPAT" ]; then \
109 for x in $$SHLIB_COMPAT; do \
110 ( $(DEBUG); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
111 ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
112 prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
115 if [ -n "$$SHLIB_SOVER" ]; then \
116 ( $(DEBUG); rm -f $$SHLIB$$SHLIB_SUFFIX; \
117 ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
121 LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
122 LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
124 SHOBJECTS=lib$(LIBNAME).o; \
125 ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
127 ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
128 $(LINK_SO) && rm -f $(LIBNAME).o
129 LINK_SO_A_UNPACKED= \
130 UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
131 (cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \
132 ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
133 SHOBJECTS=$$UNPACKDIR/*.o; \
134 $(LINK_SO) && rm -rf $$UNPACKDIR
136 DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
138 DO_GNU_SO=$(CALC_VERSIONS); \
139 SHLIB=lib$(LIBNAME).so; \
141 LIBDEPS="$(LIBDEPS) -lc"; \
142 ALLSYMSFLAGS='-Wl,--whole-archive'; \
143 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
144 SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
146 DO_GNU_APP=LDCMD=$(CC);\
147 LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
148 LIBDEPS="$(LIBDEPS) -lc"; \
151 #This is rather special. It's a special target with which one can link
152 #applications without bothering with any features that have anything to
153 #do with shared libraries, for example when linking against static
154 #libraries. It's mostly here to avoid a lot of conditionals everywhere
159 LIBDEPS="$(LIBDEPS)"; \
160 APPNAME="$(APPNAME)"; \
164 @ $(DO_GNU_SO); $(LINK_SO_O)
166 @ $(DO_GNU_SO); $(LINK_SO_A)
168 @ $(DO_GNU_APP); $(LINK_APP)
170 # For Darwin AKA Mac OS/X (dyld)
172 @ $(CALC_VERSIONS); \
173 SHLIB=lib$(LIBNAME); \
174 SHLIB_SUFFIX=.dylib; \
175 LIBDEPS="$(LIBDEPS) -lc"; \
176 ALLSYMSFLAGS='-all_load'; \
178 SHAREDFLAGS="-dynamiclib"; \
180 if [ -n "$(LIBVERSION)" ]; then \
181 SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
183 if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
184 SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
188 @ $(CALC_VERSIONS); \
189 SHLIB=lib$(LIBNAME); \
190 SHLIB_SUFFIX=.dylib; \
191 LIBDEPS="$(LIBDEPS) -lc"; \
192 ALLSYMSFLAGS='-all_load'; \
194 SHAREDFLAGS="-dynamiclib"; \
196 if [ -n "$(LIBVERSION)" ]; then \
197 SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
199 if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
200 SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
206 LIBDEPS="$(LIBDEPS) -lc"; \
207 APPNAME="$(APPNAME)"; \
211 @ $(CALC_VERSIONS); \
212 INHIBIT_SYMLINKS=yes; \
213 SHLIB=cyg$(LIBNAME); \
215 LIBDEPS="$(LIBDEPS) -lc"; \
216 SHLIB_SOVER=-$(LIBVERSION); \
217 ALLSYMSFLAGS='-Wl,--whole-archive'; \
218 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
219 SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
223 @ $(CALC_VERSIONS); \
224 INHIBIT_SYMLINKS=yes; \
225 SHLIB=cyg$(LIBNAME); \
227 LIBDEPS="$(LIBDEPS) -lc"; \
229 ALLSYMSFLAGS='-Wl,--whole-archive'; \
230 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
231 SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
237 LIBDEPS="$(LIBDEPS) -lc"; \
238 APPNAME="$(APPNAME).exe"
242 @ if ${DETECT_GNU_LD}; then \
245 SHLIB=lib$(LIBNAME).so; \
247 LIBDEPS="$(LIBDEPS) -lc"; \
248 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
249 if [ -n "$$SHLIB_HIST" ]; then \
250 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
252 SHLIB_HIST="$(LIBVERSION)"; \
255 ALLSYMSFLAGS='-all'; \
256 NOALLSYMSFLAGS='-none'; \
257 SHAREDFLAGS="-shared"; \
259 if [ -n "$$SHLIB_HIST" ]; then \
260 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
265 @ if ${DETECT_GNU_LD}; then \
268 SHLIB=lib$(LIBNAME).so; \
270 LIBDEPS="$(LIBDEPS) -lc"; \
271 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
272 if [ -n "$$SHLIB_HIST" ]; then \
273 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
275 SHLIB_HIST="$(LIBVERSION)"; \
278 ALLSYMSFLAGS='-all'; \
279 NOALLSYMSFLAGS='-none'; \
280 SHAREDFLAGS="-shared"; \
282 if [ -n "$$SHLIB_HIST" ]; then \
283 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
288 @ if ${DETECT_GNU_LD}; then \
293 LIBDEPS="$(LIBDEPS) -lc"; \
298 # The difference between alpha-osf1-shared and tru64-shared is the `-msym'
299 # option passed to the linker.
301 @ if ${DETECT_GNU_LD}; then \
304 SHLIB=lib$(LIBNAME).so; \
306 LIBDEPS="$(LIBDEPS) -lc"; \
307 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
308 if [ -n "$$SHLIB_HIST" ]; then \
309 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
311 SHLIB_HIST="$(LIBVERSION)"; \
314 ALLSYMSFLAGS='-all'; \
315 NOALLSYMSFLAGS='-none'; \
316 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
318 if [ -n "$$SHLIB_HIST" ]; then \
319 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
324 @ if ${DETECT_GNU_LD}; then \
327 SHLIB=lib$(LIBNAME).so; \
329 LIBDEPS="$(LIBDEPS) -lc"; \
330 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
331 if [ -n "$$SHLIB_HIST" ]; then \
332 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
334 SHLIB_HIST="$(LIBVERSION)"; \
337 ALLSYMSFLAGS='-all'; \
338 NOALLSYMSFLAGS='-none'; \
339 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
341 if [ -n "$$SHLIB_HIST" ]; then \
342 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
347 @ if ${DETECT_GNU_LD}; then \
351 LDFLAGS="-rpath $(LIBRPATH)"; \
352 LIBDEPS="$(LIBDEPS) -lc"; \
353 APPNAME="$(APPNAME)"; \
357 # The difference between tru64-shared and tru64-shared-rpath is the
358 # -rpath ${LIBRPATH} passed to the linker.
360 @ if ${DETECT_GNU_LD}; then \
363 SHLIB=lib$(LIBNAME).so; \
365 LIBDEPS="$(LIBDEPS) -lc"; \
366 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
367 if [ -n "$$SHLIB_HIST" ]; then \
368 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
370 SHLIB_HIST="$(LIBVERSION)"; \
373 ALLSYMSFLAGS='-all'; \
374 NOALLSYMSFLAGS='-none'; \
375 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
377 if [ -n "$$SHLIB_HIST" ]; then \
378 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
383 @ if ${DETECT_GNU_LD}; then \
386 SHLIB=lib$(LIBNAME).so; \
388 LIBDEPS="$(LIBDEPS) -lc"; \
389 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
390 if [ -n "$$SHLIB_HIST" ]; then \
391 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
393 SHLIB_HIST="$(LIBVERSION)"; \
396 ALLSYMSFLAGS='-all'; \
397 NOALLSYMSFLAGS='-none'; \
398 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
400 if [ -n "$$SHLIB_HIST" ]; then \
401 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
405 link_app.tru64-rpath:
406 @ if ${DETECT_GNU_LD}; then \
410 LDFLAGS="-rpath $(LIBRPATH)"; \
411 LIBDEPS="$(LIBDEPS) -lc"; \
412 APPNAME="$(APPNAME)"; \
417 @ if ${DETECT_GNU_LD}; then \
422 (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
423 SHLIB=lib$(LIBNAME).so; \
425 LIBDEPS="$(LIBDEPS) -lc"; \
426 ALLSYMSFLAGS="$${MINUSZ}allextract"; \
427 NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
428 SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
433 @ if ${DETECT_GNU_LD}; then \
438 (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
439 SHLIB=lib$(LIBNAME).so; \
441 LIBDEPS="$(LIBDEPS) -lc"; \
442 ALLSYMSFLAGS="$${MINUSZ}allextract"; \
443 NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
444 SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
449 @ if ${DETECT_GNU_LD}; then \
453 LDFLAGS="-R $(LIBRPATH)"; \
454 LIBDEPS="$(LIBDEPS) -lc"; \
455 APPNAME="$(APPNAME)"; \
459 # OpenServer 5 native compilers used
461 @ if ${DETECT_GNU_LD}; then \
465 SHLIB=lib$(LIBNAME).so; \
467 LIBDEPS="$(LIBDEPS) -lc"; \
470 SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
475 @ if ${DETECT_GNU_LD}; then \
479 SHLIB=lib$(LIBNAME).so; \
481 LIBDEPS="$(LIBDEPS) -lc"; \
484 SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
487 $(LINK_SO_A_UNPACKED)
489 @ if ${DETECT_GNU_LD}; then \
494 LIBDEPS="$(LIBDEPS) -lc"; \
495 APPNAME="$(APPNAME)"; \
499 # UnixWare 7 and OpenUNIX 8 native compilers used
501 @ if ${DETECT_GNU_LD}; then \
506 (${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
507 SHLIB=lib$(LIBNAME).so; \
509 LIBDEPS="$(LIBDEPS) -lc"; \
512 SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
517 @ if ${DETECT_GNU_LD}; then \
522 (${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
523 SHLIB=lib$(LIBNAME).so; \
525 LIBDEPS="$(LIBDEPS) -lc"; \
528 SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
531 $(LINK_SO_A_UNPACKED)
533 @ if ${DETECT_GNU_LD}; then \
538 LIBDEPS="$(LIBDEPS) -lc"; \
539 APPNAME="$(APPNAME)"; \
544 @ if ${DETECT_GNU_LD}; then \
548 SHLIB=lib$(LIBNAME).so; \
550 LIBDEPS="$(LIBDEPS) -lc"; \
551 ALLSYMSFLAGS='-all'; \
553 SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
558 @ if ${DETECT_GNU_LD}; then \
562 SHLIB=lib$(LIBNAME).so; \
564 LIBDEPS="$(LIBDEPS) -lc"; \
565 ALLSYMSFLAGS='-all'; \
567 SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
572 @ if ${DETECT_GNU_LD}; then \
576 LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
577 LIBDEPS="$(LIBDEPS) -lc"; \
578 APPNAME="$(APPNAME)"; \
582 # HP-UX includes the full pathname of libs we depend on, so we would get
583 # ./libcrypto (with ./ as path information) compiled into libssl, hence
584 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
586 # The object modules are loaded from lib$i.a using the undocumented -Fl
589 # WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
590 # by temporarily specifying "+s"!
593 @ $(CALC_VERSIONS); \
594 SHLIB=lib$(LIBNAME).sl; \
596 LIBDEPS="$(LIBDEPS) -lc"; \
597 ALLSYMSFLAGS='-Fl'; \
599 SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
600 SHAREDCMD='/usr/ccs/bin/ld'; \
601 $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
603 @ $(CALC_VERSIONS); \
604 SHLIB=lib$(LIBNAME).sl; \
606 LIBDEPS="$(LIBDEPS) -lc"; \
607 ALLSYMSFLAGS='-Fl'; \
609 SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
610 SHAREDCMD='/usr/ccs/bin/ld'; \
611 $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
614 LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
615 LIBDEPS="$(LIBDEPS) -lc"; \
619 # HP-UX includes the full pathname of libs we depend on, so we would get
620 # ./libcrypto (with ./ as path information) compiled into libssl, hence
621 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
624 # HP-UX in 64bit mode has "+s" enabled by default; it will search for
625 # shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
628 @ $(CALC_VERSIONS); \
629 SHLIB=lib$(LIBNAME).sl; \
631 LIBDEPS="$(LIBDEPS) -lc"; \
632 ALLSYMSFLAGS='+forceload'; \
634 SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
635 SHAREDCMD='/usr/ccs/bin/ld'; \
636 $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
638 @ $(CALC_VERSIONS); \
639 SHLIB=lib$(LIBNAME).sl; \
641 LIBDEPS="$(LIBDEPS) -lc"; \
642 ALLSYMSFLAGS='+forceload'; \
644 SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
645 SHAREDCMD='/usr/ccs/bin/ld'; \
646 $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
649 LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
650 LIBDEPS="$(LIBDEPS) -lc"; \
655 @ $(CALC_VERSIONS); \
656 SHLIB=lib$(LIBNAME).so; \
658 LIBDEPS="$(LIBDEPS) -lc"; \
659 ALLSYMSFLAGS='-bnogc'; \
661 SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
665 @ $(CALC_VERSIONS); \
666 SHLIB=lib$(LIBNAME).so; \
668 LIBDEPS="$(LIBDEPS) -lc"; \
669 ALLSYMSFLAGS='-bnogc'; \
671 SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
676 LDFLAGS="-blibpath:$(LIBRPATH)"; \
677 LIBDEPS="$(LIBDEPS) -lc"; \
682 @ $(CALC_VERSIONS); \
683 SHLIB=lib$(LIBNAME).so; \
685 LIBDEPS="$(LIBDEPS) -lc"; \
692 @ $(CALC_VERSIONS); \
693 SHLIB=lib$(LIBNAME).so; \
695 LIBDEPS="$(LIBDEPS) -lc"; \
700 $(LINK_SO_A_UNPACKED)
701 link_app.reliantunix:
704 LIBDEPS="$(LIBDEPS) -lc"; \
708 # Targets to build symbolic links when needed
709 symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
710 symlink.aix symlink.reliantunix:
711 @ $(CALC_VERSIONS); \
712 SHLIB=lib$(LIBNAME).so; \
715 @ $(CALC_VERSIONS); \
716 SHLIB=lib$(LIBNAME); \
717 SHLIB_SUFFIX=.dylib; \
719 symlink.hpux32 symlink.hpux64:
720 @ $(CALC_VERSIONS); \
721 SHLIB=lib$(LIBNAME).sl; \
723 # The following lines means those specific architectures do no symlinks
724 symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
726 # Compatibility targets
727 link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
728 link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
729 link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
730 symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
731 link_o.darwin-shared: link_o.darwin
732 link_a.darwin-shared: link_a.darwin
733 link_app.darwin-shared: link_app.darwin
734 symlink.darwin-shared: symlink.darwin
735 link_o.cygwin-shared: link_o.cygwin
736 link_a.cygwin-shared: link_a.cygwin
737 link_app.cygwin-shared: link_app.cygwin
738 symlink.cygwin-shared: symlink.cygwin
739 link_o.alpha-osf1-shared: link_o.alpha-osf1
740 link_a.alpha-osf1-shared: link_a.alpha-osf1
741 link_app.alpha-osf1-shared: link_app.alpha-osf1
742 symlink.alpha-osf1-shared: symlink.alpha-osf1
743 link_o.tru64-shared: link_o.tru64
744 link_a.tru64-shared: link_a.tru64
745 link_app.tru64-shared: link_app.tru64
746 symlink.tru64-shared: symlink.tru64
747 link_o.tru64-shared-rpath: link_o.tru64-rpath
748 link_a.tru64-shared-rpath: link_a.tru64-rpath
749 link_app.tru64-shared-rpath: link_app.tru64-rpath
750 symlink.tru64-shared-rpath: symlink.tru64-rpath
751 link_o.solaris-shared: link_o.solaris
752 link_a.solaris-shared: link_a.solaris
753 link_app.solaris-shared: link_app.solaris
754 symlink.solaris-shared: symlink.solaris
755 link_o.svr3-shared: link_o.svr3
756 link_a.svr3-shared: link_a.svr3
757 link_app.svr3-shared: link_app.svr3
758 symlink.svr3-shared: symlink.svr3
759 link_o.svr5-shared: link_o.svr5
760 link_a.svr5-shared: link_a.svr5
761 link_app.svr5-shared: link_app.svr5
762 symlink.svr5-shared: symlink.svr5
763 link_o.irix-shared: link_o.irix
764 link_a.irix-shared: link_a.irix
765 link_app.irix-shared: link_app.irix
766 symlink.irix-shared: symlink.irix
767 link_o.hpux-shared: link_o.hpux32
768 link_a.hpux-shared: link_a.hpux32
769 link_app.hpux-shared: link_app.hpux32
770 symlink.hpux-shared: symlink.hpux32
771 link_o.hpux64-shared: link_o.hpux64
772 link_a.hpux64-shared: link_a.hpux64
773 link_app.hpux64-shared: link_app.hpux64
774 symlink.hpux64-shared: symlink.hpux64
775 link_o.aix-shared: link_o.aix
776 link_a.aix-shared: link_a.aix
777 link_app.aix-shared: link_app.aix
778 symlink.aix-shared: symlink.aix
779 link_o.reliantunix-shared: link_o.reliantunix
780 link_a.reliantunix-shared: link_a.reliantunix
781 link_app.reliantunix-shared: link_app.reliantunix
782 symlink.reliantunix-shared: symlink.reliantunix