Keep on using ${CC}, since gcc may act in disguise.
[openssl.git] / Makefile.shared
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
10 # LDFLAGS contains flags to be used when the temporary object file is
11 # created.  SHARED_LDFLAGS contains flags to be used when the shared
12 # library is created.
13 LDFLAGS=
14 SHARED_LDFLAGS=
15
16 # LIBNAME contains just the name of thhe 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.
19 # For example, to build libfoo.so, you need to do the following:
20 #LIBNAME=foo
21 LIBNAME=
22
23 # LIBEXTRAS contains extra modules to link together with the library.
24 # For example, if a second library, say libbar.a needs to be linked into
25 # libfoo.so, you need to do the following:
26 #LIBEXTRAS=libbar.a
27 # Note that this MUST be used when using the link_o targets, to hold the
28 # names of all object files that go into the target library.
29 LIBEXTRAS=
30
31 # LIBVERSION contains the current version of the library.
32 # For example, to build libfoo.so.1.2, you need to do the following:
33 #LIBVERSION=1.2
34 LIBVERSION=
35
36 # LIBCOMPATVERSIONS contains the compatibility versions (a list) of
37 # the library.  They MUST be in decreasing order.
38 # For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2
39 # and libfoo.so.1, you need to do the following:
40 #LIBCOMPATVERSIONS=1.2 1
41 # Note that on systems that use sonames, the last number will appear as
42 # part of it.
43 # It's also possible, for systems that support it (Tru64, for example),
44 # to add extra compatibility info with more precision, by adding a second
45 # list of versions, separated from the first with a semicolon, like this:
46 #LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0
47 LIBCOMPATVERSIONS=
48
49 # LIBDEPS contains all the flags necessary to cover all necessary
50 # dependencies to other libraries.
51 LIBDEPS=
52
53 #------------------------------------------------------------------------------
54 # The rest is private to this makefile.
55
56 #DEBUG=:
57 DEBUG=set -x
58
59 top:
60         echo "Trying to use this makefile interactively?  Don't."
61
62 CALC_VERSIONS=  \
63         SHLIB_COMPAT=; SHLIB_SOVER=; \
64         if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
65                 prev=""; \
66                 for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
67                         SHLIB_SOVER_NODOT=$$v \
68                         SHLIB_SOVER=.$$v; \
69                         if [ -n "$$prev" ]; then \
70                                 SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
71                         fi; \
72                         prev=$$v; \
73                 done; \
74         fi
75
76 LINK_SO=        \
77   ( $(DEBUG); \
78     nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
79     $$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
80         $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
81   $(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
82 SYMLINK_SO=     \
83         prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
84         if [ -n "$$SHLIB_COMPAT" ]; then \
85                 for x in $$SHLIB_COMPAT; do \
86                         ( $(DEBUG); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
87                           ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
88                         prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
89                 done; \
90         fi; \
91         if [ -n "$$SHLIB_SOVER" ]; then \
92                 ( $(DEBUG); rm -f $$SHLIB$$SHLIB_SUFFIX; \
93                   ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
94         fi
95
96 LINK_SO_A=      SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
97 LINK_SO_O=      SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
98 LINK_SO_A_VIA_O=        \
99   SHOBJECTS=lib$(LIBNAME).o ALL=$$ALLSYMSFLAGS ALLSYMSFLAGS= NOALLSYMSFLAGS=; \
100   ( $(DEBUG); \
101     ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
102   $(LINK_SO) && rm -f $(LIBNAME).o
103 LINK_SO_A_UNPACKED=     \
104   UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
105   (cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && cp $(LIBEXTRAS) $$UNPACKDIR && \
106   SHOBJECTS=$$UNPACKDIR/*.o; \
107   $(LINK_SO) && rm -rf $$UNPACKDIR
108
109 DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
110         my_ld=`${CC} -print-prog-name=ld 2>&1` && \
111         [ -n "$$my_ld" ] && \
112         $$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
113 DO_GNU=$(CALC_VERSIONS); \
114         SHLIB=lib$(LIBNAME).so \
115         SHLIB_SUFFIX= \
116         LIBDEPS="$(LIBDEPS) -lc" \
117         ALLSYMSFLAGS='-Wl,--whole-archive' \
118         NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
119         SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" \
120         SHAREDCMD='$(CC)'
121
122 link_o.gnu:
123         @ $(DO_GNU); $(LINK_SO_O)
124 link_a.gnu:
125         @ $(DO_GNU); $(LINK_SO_A)
126
127 # For Darwin AKA Mac OS/X (dyld)
128 link_o.darwin:
129         @ $(CALC_VERSIONS); \
130         SHLIB=lib$(LIBNAME) \
131         SHLIB_SUFFIX=.dylib \
132         LIBDEPS="$(LIBDEPS) -lc" \
133         ALLSYMSFLAGS='-all_load' \
134         NOALLSYMSFLAGS='' \
135         SHAREDFLAGS="-dynamiclib" \
136         SHAREDCMD='$(CC)'; \
137         if [ -n "$(LIBVERSION)" ]; then \
138                 SHAREDFLAGS="$SHAREDFLAGS -current_version $(LIBVERSION)"; \
139         fi; \
140         if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
141                 SHAREDFLAGS="$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
142         fi; \
143         $(LINK_SO_O)
144 link_a.darwin:
145         @ $(CALC_VERSIONS); \
146         SHLIB=lib$(LIBNAME) \
147         SHLIB_SUFFIX=.dylib \
148         LIBDEPS="$(LIBDEPS) -lc" \
149         ALLSYMSFLAGS='-all_load' \
150         NOALLSYMSFLAGS='' \
151         SHAREDFLAGS="-dynamiclib" \
152         SHAREDCMD='$(CC)'; \
153         if [ -n "$(LIBVERSION)" ]; then \
154                 SHAREDFLAGS="$SHAREDFLAGS -current_version $(LIBVERSION)"; \
155         fi; \
156         if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
157                 SHAREDFLAGS="$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
158         fi; \
159         $(LINK_SO_A)
160
161 link_o.cygwin:
162         @ SHLIB=cyg$(LIBNAME).dll \
163         SHLIB_SUFFIX= \
164         LIBDEPS="$(LIBDEPS) -lc" \
165         SHLIB_SOVER= \
166         ALLSYMSFLAGS='-Wl,--whole-archive' \
167         NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
168         SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \
169         SHAREDCMD='${CC}'; \
170         $(LINK_SO_O)
171 link_a.cygwin:
172         @ SHLIB=cyg$(LIBNAME).dll \
173         SHLIB_SUFFIX= \
174         LIBDEPS="$(LIBDEPS) -lc" \
175         SHLIB_SOVER= \
176         ALLSYMSFLAGS='-Wl,--whole-archive' \
177         NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
178         SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \
179         SHAREDCMD='${CC}'; \
180         $(LINK_SO_A)
181
182 link_o.alpha-osf1:
183         @ if ${DETECT_GNU_LD}; then \
184                 $(DO_GNU); \
185         else \
186                 SHLIB=lib$(LIBNAME).so \
187                 SHLIB_SUFFIX= \
188                 LIBDEPS="$(LIBDEPS) -lc" \
189                 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
190                 if [ -n "$$SHLIB_HIST" ]; then \
191                         SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
192                 else \
193                         SHLIB_HIST="$(LIBVERSION)"; \
194                 fi
195                 SHLIB_SOVER= \
196                 ALLSYMSFLAGS='-all' \
197                 NOALLSYMSFLAGS='-none' \
198                 SHAREDFLAGS="-shared" \
199                 SHAREDCMD='$(CC)'; \
200                 if [ -n "$$SHLIB_HIST" ]; then \
201                         SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
202                 fi; \
203         fi; \
204         $(LINK_SO_O)
205 link_a.alpha-osf1:
206         @ if ${DETECT_GNU_LD}; then \
207                 $(DO_GNU); \
208         else \
209                 SHLIB=lib$(LIBNAME).so \
210                 SHLIB_SUFFIX= \
211                 LIBDEPS="$(LIBDEPS) -lc" \
212                 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
213                 if [ -n "$$SHLIB_HIST" ]; then \
214                         SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
215                 else \
216                         SHLIB_HIST="$(LIBVERSION)"; \
217                 fi
218                 SHLIB_SOVER= \
219                 ALLSYMSFLAGS='-all' \
220                 NOALLSYMSFLAGS='-none' \
221                 SHAREDFLAGS="-shared" \
222                 SHAREDCMD='$(CC)'; \
223                 if [ -n "$$SHLIB_HIST" ]; then \
224                         SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
225                 fi; \
226         fi; \
227         $(LINK_SO_A)
228
229 # The difference between alpha-osf1-shared and tru64-shared is the `-msym'
230 # option passed to the linker.
231 link_o.tru64:
232         @ if ${DETECT_GNU_LD}; then \
233                 $(DO_GNU); \
234         else \
235                 SHLIB=lib$(LIBNAME).so \
236                 SHLIB_SUFFIX= \
237                 LIBDEPS="$(LIBDEPS) -lc" \
238                 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
239                 if [ -n "$$SHLIB_HIST" ]; then \
240                         SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
241                 else \
242                         SHLIB_HIST="$(LIBVERSION)"; \
243                 fi
244                 SHLIB_SOVER= \
245                 ALLSYMSFLAGS='-all' \
246                 NOALLSYMSFLAGS='-none' \
247                 SHAREDFLAGS="-shared -msym" \
248                 SHAREDCMD='$(CC)'; \
249                 if [ -n "$$SHLIB_HIST" ]; then \
250                         SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
251                 fi; \
252         fi; \
253         $(LINK_SO_O)
254 link_a.tru64:
255         @ if ${DETECT_GNU_LD}; then \
256                 $(DO_GNU); \
257         else \
258                 SHLIB=lib$(LIBNAME).so \
259                 SHLIB_SUFFIX= \
260                 LIBDEPS="$(LIBDEPS) -lc" \
261                 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
262                 if [ -n "$$SHLIB_HIST" ]; then \
263                         SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
264                 else \
265                         SHLIB_HIST="$(LIBVERSION)"; \
266                 fi
267                 SHLIB_SOVER= \
268                 ALLSYMSFLAGS='-all' \
269                 NOALLSYMSFLAGS='-none' \
270                 SHAREDFLAGS="-shared -msym" \
271                 SHAREDCMD='$(CC)'; \
272                 if [ -n "$$SHLIB_HIST" ]; then \
273                         SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
274                 fi; \
275         fi; \
276         $(LINK_SO_A)
277
278 # The difference between tru64-shared and tru64-shared-rpath is the
279 # -rpath ${LIBRPATH} passed to the linker.
280 link_o.tru64-rpath:
281         @ if ${DETECT_GNU_LD}; then \
282                 $(DO_GNU); \
283         else \
284                 SHLIB=lib$(LIBNAME).so \
285                 SHLIB_SUFFIX= \
286                 LIBDEPS="$(LIBDEPS) -lc" \
287                 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
288                 if [ -n "$$SHLIB_HIST" ]; then \
289                         SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
290                 else \
291                         SHLIB_HIST="$(LIBVERSION)"; \
292                 fi
293                 SHLIB_SOVER= \
294                 ALLSYMSFLAGS='-all' \
295                 NOALLSYMSFLAGS='-none' \
296                 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)" \
297                 SHAREDCMD='$(CC)'; \
298                 if [ -n "$$SHLIB_HIST" ]; then \
299                         SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
300                 fi; \
301         fi; \
302         $(LINK_SO_O)
303 link_a.tru64-rpath:
304         @ if ${DETECT_GNU_LD}; then \
305                 $(DO_GNU); \
306         else \
307                 SHLIB=lib$(LIBNAME).so \
308                 SHLIB_SUFFIX= \
309                 LIBDEPS="$(LIBDEPS) -lc" \
310                 SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
311                 if [ -n "$$SHLIB_HIST" ]; then \
312                         SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
313                 else \
314                         SHLIB_HIST="$(LIBVERSION)"; \
315                 fi
316                 SHLIB_SOVER= \
317                 ALLSYMSFLAGS='-all' \
318                 NOALLSYMSFLAGS='-none' \
319                 SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)" \
320                 SHAREDCMD='$(CC)'; \
321                 if [ -n "$$SHLIB_HIST" ]; then \
322                         SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
323                 fi; \
324         fi; \
325         $(LINK_SO_A)
326
327 link_o.solaris:
328         @ if ${DETECT_GNU_LD}; then \
329                 $(DO_GNU); \
330         else \
331                 $(CALC_VERSIONS); \
332                 SHLIB=lib$(LIBNAME).so \
333                 SHLIB_SUFFIX= \
334                 LIBDEPS="$(LIBDEPS) -lc" \
335                 ALLSYMSFLAGS='-z allextract' \
336                 NOALLSYMSFLAGS='' \
337                 SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
338                 SHAREDCMD='$(CC)'; \
339         fi; \
340         $(LINK_SO_O)
341 link_a.solaris:
342         @ if ${DETECT_GNU_LD}; then \
343                 $(DO_GNU); \
344         else \
345                 $(CALC_VERSIONS); \
346                 SHLIB=lib$(LIBNAME).so \
347                 SHLIB_SUFFIX= \
348                 LIBDEPS="$(LIBDEPS) -lc" \
349                 ALLSYMSFLAGS='-z allextract' \
350                 NOALLSYMSFLAGS='' \
351                 SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
352                 SHAREDCMD='$(CC)'; \
353         fi; \
354         $(LINK_SO_A)
355
356 # OpenServer 5 native compilers used
357 # UnixWare 7 and OpenUNIX 8 native compilers used
358 link_o.svr3:
359         @ if ${DETECT_GNU_LD}; then \
360                 $(DO_GNU); \
361         else \
362                 $(CALC_VERSIONS); \
363                 SHLIB=lib$(LIBNAME).so \
364                 SHLIB_SUFFIX= \
365                 LIBDEPS="$(LIBDEPS) -lc" \
366                 ALLSYMSFLAGS='-z allextract' \
367                 NOALLSYMSFLAGS='' \
368                 SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
369                 SHAREDCMD='$(CC)'; \
370         fi; \
371         $(LINK_SO_O)
372 link_a.svr3:
373         @ if ${DETECT_GNU_LD}; then \
374                 $(DO_GNU); \
375         else \
376                 $(CALC_VERSIONS); \
377                 SHLIB=lib$(LIBNAME).so \
378                 SHLIB_SUFFIX= \
379                 LIBDEPS="$(LIBDEPS) -lc" \
380                 ALLSYMSFLAGS='-z allextract' \
381                 NOALLSYMSFLAGS='' \
382                 SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
383                 SHAREDCMD='$(CC)'; \
384         fi; \
385         $(LINK_SO_A_UNPACKED)
386
387 link_o.irix:
388         @ if ${DETECT_GNU_LD}; then \
389                 $(DO_GNU); \
390         else \
391                 $(CALC_VERSIONS); \
392                 SHLIB=lib$(LIBNAME).so \
393                 SHLIB_SUFFIX= \
394                 LIBDEPS="$(LIBDEPS) -lc" \
395                 ALLSYMSFLAGS='-all' \
396                 NOALLSYMSFLAGS='' \
397                 SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
398                 SHAREDCMD='$(CC)'; \
399         fi; \
400         $(LINK_SO_O)
401 link_a.irix:
402         @ if ${DETECT_GNU_LD}; then \
403                 $(DO_GNU); \
404         else \
405                 $(CALC_VERSIONS); \
406                 SHLIB=lib$(LIBNAME).so \
407                 SHLIB_SUFFIX= \
408                 LIBDEPS="$(LIBDEPS) -lc" \
409                 ALLSYMSFLAGS='-all' \
410                 NOALLSYMSFLAGS='' \
411                 SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
412                 SHAREDCMD='$(CC)'; \
413         fi; \
414         $(LINK_SO_A)
415
416 # HP-UX includes the full pathname of libs we depend on, so we would get
417 # ./libcrypto (with ./ as path information) compiled into libssl, hence
418 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
419 # anyway.
420 # The object modules are loaded from lib$i.a using the undocumented -Fl
421 # option.
422 #
423 # WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
424 #          by temporarily specifying "+s"!
425 #
426 link_o.hpux32:
427         @ $(CALC_VERSIONS); \
428         SHLIB=lib$(LIBNAME).sl \
429         SHLIB_SUFFIX= \
430         LIBDEPS="$(LIBDEPS) -lc" \
431         ALLSYMSFLAGS='-Fl' \
432         NOALLSYMSFLAGS='' \
433         SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
434         SHAREDCMD='/usr/ccs/bin/ld'; \
435         $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
436 link_a.hpux32:
437         @ $(CALC_VERSIONS); \
438         SHLIB=lib$(LIBNAME).sl \
439         SHLIB_SUFFIX= \
440         LIBDEPS="$(LIBDEPS) -lc" \
441         ALLSYMSFLAGS='-Fl' \
442         NOALLSYMSFLAGS='' \
443         SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
444         SHAREDCMD='/usr/ccs/bin/ld'; \
445         $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
446
447 # HP-UX includes the full pathname of libs we depend on, so we would get
448 # ./libcrypto (with ./ as path information) compiled into libssl, hence
449 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
450 # anyway.
451 #
452 # HP-UX in 64bit mode has "+s" enabled by default; it will search for
453 # shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
454 #
455 link_o.hpux64:
456         @ $(CALC_VERSIONS); \
457         SHLIB=lib$(LIBNAME).sl \
458         SHLIB_SUFFIX= \
459         LIBDEPS="$(LIBDEPS) -lc" \
460         ALLSYMSFLAGS='+forceload' \
461         NOALLSYMSFLAGS='' \
462         SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
463         SHAREDCMD='/usr/ccs/bin/ld'; \
464         $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
465 link_a.hpux64:
466         @ $(CALC_VERSIONS); \
467         SHLIB=lib$(LIBNAME).sl \
468         SHLIB_SUFFIX= \
469         LIBDEPS="$(LIBDEPS) -lc" \
470         ALLSYMSFLAGS='+forceload' \
471         NOALLSYMSFLAGS='' \
472         SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
473         SHAREDCMD='/usr/ccs/bin/ld'; \
474         $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
475
476 link_o.aix:
477         @ $(CALC_VERSIONS); \
478         SHLIB=lib$(LIBNAME).so \
479         SHLIB_SUFFIX= \
480         LIBDEPS="$(LIBDEPS) -lc" \
481         ALLSYMSFLAGS='-bnogc' \
482         NOALLSYMSFLAGS='' \
483         SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \
484         SHAREDCMD='$(CC)'; \
485         $(LINK_SO_O)
486 link_a.aix:
487         @ $(CALC_VERSIONS); \
488         SHLIB=lib$(LIBNAME).so \
489         SHLIB_SUFFIX= \
490         LIBDEPS="$(LIBDEPS) -lc" \
491         ALLSYMSFLAGS='-bnogc' \
492         NOALLSYMSFLAGS='' \
493         SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \
494         SHAREDCMD='$(CC)'; \
495         $(LINK_SO_A_VIA_O)
496
497 link_o.reliantunix:
498         @ $(CALC_VERSIONS); \
499         SHLIB=lib$(LIBNAME).so \
500         SHLIB_SUFFIX= \
501         LIBDEPS="$(LIBDEPS) -lc" \
502         ALLSYMSFLAGS= \
503         NOALLSYMSFLAGS='' \
504         SHAREDFLAGS='-G' \
505         SHAREDCMD='$(CC)'; \
506         $(LINK_SO_O)
507 link_a.reliantunix:
508         @ $(CALC_VERSIONS); \
509         SHLIB=lib$(LIBNAME).so \
510         SHLIB_SUFFIX= \
511         LIBDEPS="$(LIBDEPS) -lc" \
512         ALLSYMSFLAGS= \
513         NOALLSYMSFLAGS='' \
514         SHAREDFLAGS='-G' \
515         SHAREDCMD='$(CC)'; \
516         $(LINK_SO_A_UNPACKED)
517
518 # Targets to build symbolic links when needed
519 symlink.gnu symlink.solaris symlink.svr3 symlink.irix \
520 symlink.aix symlink.reliantunix:
521         @ $(CALC_VERSIONS); \
522         SHLIB=lib$(LIBNAME).so \
523         $(SYMLINK_SO)
524 symlink.darwin:
525         @ $(CALC_VERSIONS); \
526         SHLIB=lib$(LIBNAME) \
527         SHLIB_SUFFIX=.dylib \
528         $(SYMLINK_SO)
529 symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
530 symlink.hpux32 symlink.hpux64:
531         @ $(CALC_VERSIONS); \
532         SHLIB=lib$(LIBNAME).sl \
533         $(SYMLINK_SO)
534
535 # Compatibility targets
536 link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
537 link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
538 symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
539 link_o.darwin-shared: link_o.darwin
540 link_a.darwin-shared: link_a.darwin
541 symlink.darwin-shared: symlink.darwin
542 link_o.cygwin-shared: link_o.cygwin
543 link_a.cygwin-shared: link_a.cygwin
544 symlink.cygwin-shared: symlink.cygwin
545 link_o.alpha-osf1-shared: link_o.alpha-osf1
546 link_a.alpha-osf1-shared: link_a.alpha-osf1
547 symlink.alpha-osf1-shared: symlink.alpha-osf1
548 link_o.tru64-shared: link_o.tru64
549 link_a.tru64-shared: link_a.tru64
550 symlink.tru64-shared: symlink.tru64
551 link_o.tru64-shared-rpath: link_o.tru64-rpath
552 link_a.tru64-shared-rpath: link_a.tru64-rpath
553 symlink.tru64-shared-rpath: symlink.tru64-rpath
554 link_o.solaris-shared: link_o.solaris
555 link_a.solaris-shared: link_a.solaris
556 symlink.solaris-shared: symlink.solaris
557 link_o.svr3-shared: link_o.svr3
558 link_a.svr3-shared: link_a.svr3
559 symlink.svr3-shared: symlink.svr3
560 link_o.svr5-shared: link_o.svr3
561 link_a.svr5-shared: link_a.svr3
562 symlink.svr5-shared: symlink.svr3
563 link_o.irix-shared: link_o.irix
564 link_a.irix-shared: link_a.irix
565 symlink.irix-shared: symlink.irix
566 link_o.hpux-shared: link_o.hpux32
567 link_a.hpux-shared: link_a.hpux32
568 symlink.hpux-shared: symlink.hpux32
569 link_o.hpux64-shared: link_o.hpux64
570 link_a.hpux64-shared: link_a.hpux64
571 symlink.hpux64-shared: symlink.hpux64
572 link_o.aix-shared: link_o.aix
573 link_a.aix-shared: link_a.aix
574 symlink.aix-shared: symlink.aix
575 link_o.reliantunix-shared: link_o.reliantunix
576 link_a.reliantunix-shared: link_a.reliantunix
577 symlink.reliantunix-shared: symlink.reliantunix