1 XCOMM $XConsortium: bsdLib.rules /main/3 1996/09/28 16:09:18 rws $
4 * NetBSD/FreeBSD shared library rules
7 #ifndef HasSharedLibraries
8 #define HasSharedLibraries YES
10 #ifndef SharedDataSeparation
11 #define SharedDataSeparation NO
16 #ifndef SharedLibraryDef
17 #define SharedLibraryDef -DBSDSHLIB
19 #ifndef ShLibIncludeFile
20 #define ShLibIncludeFile <bsdLib.tmpl>
22 #ifndef SharedLibraryLoadFlags
23 #define SharedLibraryLoadFlags -Bshareable
25 #ifndef PositionIndependentCFlags
26 #define PositionIndependentCFlags -fpic
30 * InstallSharedLibrary - generate rules to install the shared library.
32 #ifndef InstallSharedLibrary
33 #define InstallSharedLibrary(libname,rev,dest) @@\
34 install:: Concat(lib,libname.so.rev) @@\
35 MakeDir($(DESTDIR)dest) @@\
36 $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
37 $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
39 #endif /* InstallSharedLibrary */
42 * SharedLibraryTarget - generate rules to create a shared library;
43 * build it into a different name so that we do not hose people by having
44 * the library gone for long periods.
46 #ifndef SharedLibraryTarget
47 #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
48 AllTarget(Concat(lib,libname.so.rev)) @@\
50 Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\
52 (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
55 $(RM) Concat(lib,libname.so) @@\
56 $(LN) $@ Concat(lib,libname.so) @@\
57 LinkBuildLibrary($@) @@\
58 LinkBuildLibrary(Concat(lib,libname.so)) @@\
61 $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
63 #endif /* SharedLibraryTarget */
66 * SharedLibraryDataTarget - generate rules to create shlib data file;
68 #ifndef SharedLibraryDataTarget
69 #define SharedLibraryDataTarget(libname,rev,salist)
70 #endif /* SharedLibraryDataTarget */
72 #ifndef InstallSharedLibraryData
73 #define InstallSharedLibraryData(libname,rev,dest)
74 #endif /* InstallSharedLibraryData */
77 * SharedLibReferences - variables for shared libraries
79 #ifndef SharedLibReferences
80 #define SharedLibReferences(varname,libname,libsource,revname,rev) @@\
82 Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
83 Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
84 LintLibReferences(varname,libname,libsource)
88 * SharedDSLibReferences - variables for shared libraries
90 #ifndef SharedDSLibReferences
91 #define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\
93 Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
94 Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) Concat3(Shared,libname,Reqs) @@\
95 LintLibReferences(varname,libname,libsource)