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 -shared
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; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$@ solist $(REQUIREDLIBS)) @@\
55 $(RM) Concat(lib,libname.so) @@\
56 $(LN) $@ Concat(lib,libname.so) @@\
57 LinkBuildLibrary($@) @@\
58 (cd $(BUILDLIBDIR) && $(RM) Concat(lib,libname.so) && \
59 $(LN) $@ Concat(lib,libname.so)) @@\
62 $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
64 #endif /* SharedLibraryTarget */
67 * SharedLibraryDataTarget - generate rules to create shlib data file;
69 #ifndef SharedLibraryDataTarget
70 #define SharedLibraryDataTarget(libname,rev,salist)
71 #endif /* SharedLibraryDataTarget */
73 #ifndef InstallSharedLibraryData
74 #define InstallSharedLibraryData(libname,rev,dest)
75 #endif /* InstallSharedLibraryData */
78 * SharedLibReferences - variables for shared libraries
80 #ifndef SharedLibReferences
81 #define SharedLibReferences(varname,libname,libsource,revname,rev) @@\
83 Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
84 Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
85 LintLibReferences(varname,libname,libsource)
89 * SharedDSLibReferences - variables for shared libraries
91 #ifndef SharedDSLibReferences
92 #define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\
94 Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
95 Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) Concat3(Shared,libname,Reqs) @@\
96 LintLibReferences(varname,libname,libsource)