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); \
214 expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \
216 LIBDEPS="$(LIBDEPS)"; \
217 SHLIB_SOVER=-$(LIBVERSION); \
218 ALLSYMSFLAGS='-Wl,--whole-archive'; \
219 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
220 SHAREDFLAGS="-Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
224 @ $(CALC_VERSIONS); \
225 INHIBIT_SYMLINKS=yes; \
226 SHLIB=cyg$(LIBNAME); \
227 expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \
229 LIBDEPS="$(LIBDEPS)"; \
231 ALLSYMSFLAGS='-Wl,--whole-archive'; \
232 NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
233 SHAREDFLAGS="-Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
239 LIBDEPS="$(LIBDEPS)"; \
240 APPNAME="$(APPNAME)"; \
244 @ if ${DETECT_GNU_LD}; then \
247 SHLIB=lib$(LIBNAME).so; \
249 LIBDEPS="$(LIBDEPS) -lc"; \
250 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
251 if [ -n "$$SHLIB_HIST" ]; then \
252 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
254 SHLIB_HIST="$(LIBVERSION)"; \
257 ALLSYMSFLAGS='-all'; \
258 NOALLSYMSFLAGS='-none'; \
259 SHAREDFLAGS="-shared"; \
261 if [ -n "$$SHLIB_HIST" ]; then \
262 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
267 @ if ${DETECT_GNU_LD}; then \
270 SHLIB=lib$(LIBNAME).so; \
272 LIBDEPS="$(LIBDEPS) -lc"; \
273 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
274 if [ -n "$$SHLIB_HIST" ]; then \
275 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
277 SHLIB_HIST="$(LIBVERSION)"; \
280 ALLSYMSFLAGS='-all'; \
281 NOALLSYMSFLAGS='-none'; \
282 SHAREDFLAGS="-shared"; \
284 if [ -n "$$SHLIB_HIST" ]; then \
285 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
290 @ if ${DETECT_GNU_LD}; then \
295 LIBDEPS="$(LIBDEPS) -lc"; \
300 # The difference between alpha-osf1-shared and tru64-shared is the `-msym'
301 # option passed to the linker.
303 @ if ${DETECT_GNU_LD}; then \
306 SHLIB=lib$(LIBNAME).so; \
308 LIBDEPS="$(LIBDEPS) -lc"; \
309 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
310 if [ -n "$$SHLIB_HIST" ]; then \
311 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
313 SHLIB_HIST="$(LIBVERSION)"; \
316 ALLSYMSFLAGS='-all'; \
317 NOALLSYMSFLAGS='-none'; \
318 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
320 if [ -n "$$SHLIB_HIST" ]; then \
321 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
326 @ if ${DETECT_GNU_LD}; then \
329 SHLIB=lib$(LIBNAME).so; \
331 LIBDEPS="$(LIBDEPS) -lc"; \
332 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
333 if [ -n "$$SHLIB_HIST" ]; then \
334 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
336 SHLIB_HIST="$(LIBVERSION)"; \
339 ALLSYMSFLAGS='-all'; \
340 NOALLSYMSFLAGS='-none'; \
341 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
343 if [ -n "$$SHLIB_HIST" ]; then \
344 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
349 @ if ${DETECT_GNU_LD}; then \
353 LDFLAGS="-rpath $(LIBRPATH)"; \
354 LIBDEPS="$(LIBDEPS) -lc"; \
355 APPNAME="$(APPNAME)"; \
359 # The difference between tru64-shared and tru64-shared-rpath is the
360 # -rpath ${LIBRPATH} passed to the linker.
362 @ if ${DETECT_GNU_LD}; then \
365 SHLIB=lib$(LIBNAME).so; \
367 LIBDEPS="$(LIBDEPS) -lc"; \
368 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
369 if [ -n "$$SHLIB_HIST" ]; then \
370 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
372 SHLIB_HIST="$(LIBVERSION)"; \
375 ALLSYMSFLAGS='-all'; \
376 NOALLSYMSFLAGS='-none'; \
377 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
379 if [ -n "$$SHLIB_HIST" ]; then \
380 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
385 @ if ${DETECT_GNU_LD}; then \
388 SHLIB=lib$(LIBNAME).so; \
390 LIBDEPS="$(LIBDEPS) -lc"; \
391 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
392 if [ -n "$$SHLIB_HIST" ]; then \
393 SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
395 SHLIB_HIST="$(LIBVERSION)"; \
398 ALLSYMSFLAGS='-all'; \
399 NOALLSYMSFLAGS='-none'; \
400 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
402 if [ -n "$$SHLIB_HIST" ]; then \
403 SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
407 link_app.tru64-rpath:
408 @ if ${DETECT_GNU_LD}; then \
412 LDFLAGS="-rpath $(LIBRPATH)"; \
413 LIBDEPS="$(LIBDEPS) -lc"; \
414 APPNAME="$(APPNAME)"; \
419 @ if ${DETECT_GNU_LD}; then \
424 (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
425 SHLIB=lib$(LIBNAME).so; \
427 LIBDEPS="$(LIBDEPS) -lc"; \
428 ALLSYMSFLAGS="$${MINUSZ}allextract"; \
429 NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
430 SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
435 @ if ${DETECT_GNU_LD}; then \
440 (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
441 SHLIB=lib$(LIBNAME).so; \
443 LIBDEPS="$(LIBDEPS) -lc"; \
444 ALLSYMSFLAGS="$${MINUSZ}allextract"; \
445 NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
446 SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
451 @ if ${DETECT_GNU_LD}; then \
455 LDFLAGS="-R $(LIBRPATH)"; \
456 LIBDEPS="$(LIBDEPS) -lc"; \
457 APPNAME="$(APPNAME)"; \
461 # OpenServer 5 native compilers used
463 @ if ${DETECT_GNU_LD}; then \
467 SHLIB=lib$(LIBNAME).so; \
469 LIBDEPS="$(LIBDEPS) -lc"; \
472 SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
477 @ if ${DETECT_GNU_LD}; then \
481 SHLIB=lib$(LIBNAME).so; \
483 LIBDEPS="$(LIBDEPS) -lc"; \
486 SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
489 $(LINK_SO_A_UNPACKED)
491 @ if ${DETECT_GNU_LD}; then \
496 LIBDEPS="$(LIBDEPS) -lc"; \
497 APPNAME="$(APPNAME)"; \
501 # UnixWare 7 and OpenUNIX 8 native compilers used
503 @ if ${DETECT_GNU_LD}; then \
508 (${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
509 SHLIB=lib$(LIBNAME).so; \
511 LIBDEPS="$(LIBDEPS) -lc"; \
514 SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
519 @ if ${DETECT_GNU_LD}; then \
524 (${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
525 SHLIB=lib$(LIBNAME).so; \
527 LIBDEPS="$(LIBDEPS) -lc"; \
530 SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
533 $(LINK_SO_A_UNPACKED)
535 @ if ${DETECT_GNU_LD}; then \
540 LIBDEPS="$(LIBDEPS) -lc"; \
541 APPNAME="$(APPNAME)"; \
546 @ if ${DETECT_GNU_LD}; then \
550 SHLIB=lib$(LIBNAME).so; \
552 LIBDEPS="$(LIBDEPS) -lc"; \
554 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
555 ALLSYMSFLAGS="$${MINUSWL}-all"; \
556 NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
557 SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
562 @ if ${DETECT_GNU_LD}; then \
566 SHLIB=lib$(LIBNAME).so; \
568 LIBDEPS="$(LIBDEPS) -lc"; \
570 ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
571 ALLSYMSFLAGS="$${MINUSWL}-all"; \
572 NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
573 SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
578 @ if ${DETECT_GNU_LD}; then \
582 LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
583 LIBDEPS="$(LIBDEPS) -lc"; \
584 APPNAME="$(APPNAME)"; \
588 # 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
589 # we compensate for it with +cdp ../: and +cdp ./:. Yes, these rewrite
590 # rules imply that we can only link one level down in catalog structure,
591 # but that's what takes place for the moment of this writing. +cdp option
592 # was introduced in HP-UX 11.x and applies in 32-bit PA-RISC link
593 # editor context only [it's simply ignored in other cases, which are all
597 @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
599 SHLIB=lib$(LIBNAME).sl; \
600 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
602 LIBDEPS="$(LIBDEPS)"; \
603 ALLSYMSFLAGS='-Wl,-Fl'; \
605 expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
606 SHAREDFLAGS="-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \
609 $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
611 @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
613 SHLIB=lib$(LIBNAME).sl; \
614 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
616 LIBDEPS="$(LIBDEPS)"; \
617 ALLSYMSFLAGS='-Wl,-Fl'; \
619 expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
620 SHAREDFLAGS="-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \
623 $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
625 @if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
627 LDFLAGS="-Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
628 LIBDEPS="$(LIBDEPS)"; \
629 APPNAME="$(APPNAME)"; \
634 @ $(CALC_VERSIONS); \
635 SHLIB=lib$(LIBNAME).so; \
637 LIBDEPS="$(LIBDEPS) -lc"; \
638 ALLSYMSFLAGS='-bnogc'; \
640 SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
644 @ $(CALC_VERSIONS); \
645 SHLIB=lib$(LIBNAME).so; \
647 LIBDEPS="$(LIBDEPS) -lc"; \
648 ALLSYMSFLAGS='-bnogc'; \
650 SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
655 LDFLAGS="-blibpath:$(LIBRPATH)"; \
656 LIBDEPS="$(LIBDEPS) -lc"; \
661 @ $(CALC_VERSIONS); \
662 SHLIB=lib$(LIBNAME).so; \
664 LIBDEPS="$(LIBDEPS) -lc"; \
671 @ $(CALC_VERSIONS); \
672 SHLIB=lib$(LIBNAME).so; \
674 LIBDEPS="$(LIBDEPS) -lc"; \
679 $(LINK_SO_A_UNPACKED)
680 link_app.reliantunix:
683 LIBDEPS="$(LIBDEPS) -lc"; \
687 # Targets to build symbolic links when needed
688 symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
689 symlink.aix symlink.reliantunix:
690 @ $(CALC_VERSIONS); \
691 SHLIB=lib$(LIBNAME).so; \
694 @ $(CALC_VERSIONS); \
695 SHLIB=lib$(LIBNAME); \
696 SHLIB_SUFFIX=.dylib; \
699 @ $(CALC_VERSIONS); \
700 SHLIB=lib$(LIBNAME).sl; \
701 expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
703 # The following lines means those specific architectures do no symlinks
704 symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
706 # Compatibility targets
707 link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
708 link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
709 link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
710 symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
711 link_o.darwin-shared: link_o.darwin
712 link_a.darwin-shared: link_a.darwin
713 link_app.darwin-shared: link_app.darwin
714 symlink.darwin-shared: symlink.darwin
715 link_o.cygwin-shared: link_o.cygwin
716 link_a.cygwin-shared: link_a.cygwin
717 link_app.cygwin-shared: link_app.cygwin
718 symlink.cygwin-shared: symlink.cygwin
719 link_o.alpha-osf1-shared: link_o.alpha-osf1
720 link_a.alpha-osf1-shared: link_a.alpha-osf1
721 link_app.alpha-osf1-shared: link_app.alpha-osf1
722 symlink.alpha-osf1-shared: symlink.alpha-osf1
723 link_o.tru64-shared: link_o.tru64
724 link_a.tru64-shared: link_a.tru64
725 link_app.tru64-shared: link_app.tru64
726 symlink.tru64-shared: symlink.tru64
727 link_o.tru64-shared-rpath: link_o.tru64-rpath
728 link_a.tru64-shared-rpath: link_a.tru64-rpath
729 link_app.tru64-shared-rpath: link_app.tru64-rpath
730 symlink.tru64-shared-rpath: symlink.tru64-rpath
731 link_o.solaris-shared: link_o.solaris
732 link_a.solaris-shared: link_a.solaris
733 link_app.solaris-shared: link_app.solaris
734 symlink.solaris-shared: symlink.solaris
735 link_o.svr3-shared: link_o.svr3
736 link_a.svr3-shared: link_a.svr3
737 link_app.svr3-shared: link_app.svr3
738 symlink.svr3-shared: symlink.svr3
739 link_o.svr5-shared: link_o.svr5
740 link_a.svr5-shared: link_a.svr5
741 link_app.svr5-shared: link_app.svr5
742 symlink.svr5-shared: symlink.svr5
743 link_o.irix-shared: link_o.irix
744 link_a.irix-shared: link_a.irix
745 link_app.irix-shared: link_app.irix
746 symlink.irix-shared: symlink.irix
747 link_o.hpux-shared: link_o.hpux
748 link_a.hpux-shared: link_a.hpux
749 link_app.hpux-shared: link_app.hpux
750 symlink.hpux-shared: symlink.hpux
751 link_o.aix-shared: link_o.aix
752 link_a.aix-shared: link_a.aix
753 link_app.aix-shared: link_app.aix
754 symlink.aix-shared: symlink.aix
755 link_o.reliantunix-shared: link_o.reliantunix
756 link_a.reliantunix-shared: link_a.reliantunix
757 link_app.reliantunix-shared: link_app.reliantunix
758 symlink.reliantunix-shared: symlink.reliantunix