1 XCOMM $XConsortium: sunLib.rules /main/15 1996/09/28 16:13:16 rws $
4 * SunOS shared library rules
7 #ifndef HasSharedLibraries
8 #define HasSharedLibraries YES
10 #ifndef SharedDataSeparation
11 #define SharedDataSeparation YES
14 #define SharedCodeDef -DSHAREDCODE
16 #ifndef SharedLibraryDef
17 #define SharedLibraryDef -DSUNSHLIB
19 #ifndef ShLibIncludeFile
20 #define ShLibIncludeFile <sunLib.tmpl>
22 #ifndef SharedLibraryLoadFlags
23 #define SharedLibraryLoadFlags -assert pure-text
25 #ifndef PositionIndependentCFlags
27 #define PositionIndependentCFlags -fpic
29 #define PositionIndependentCFlags -pic
32 #ifndef PositionIndependentCplusplusFlags
33 #if HasGcc2ForCplusplus
34 #define PositionIndependentCplusplusFlags -fpic
36 #define PositionIndependentCplusplusFlags -pic
41 * SharedDSLibDependencies - shared library dependencies with data separation
43 #ifndef SharedDSLibDependencies
44 #define SharedDSLibDependencies(libname,libsource,revname) _UseCat($(USRLIBDIR)/lib,libsource/lib,libname.sa.$(revname))
48 * InstallSharedLibrary - generate rules to install the shared library.
50 #ifndef InstallSharedLibrary
51 #define InstallSharedLibrary(libname,rev,dest) @@\
52 InstallTarget(install,Concat(lib,libname.so.rev),$(INSTLIBFLAGS),dest)
53 #endif /* InstallSharedLibrary */
56 * InstallSharedLibraryData - generate rules to install the shared library data
58 #ifndef InstallSharedLibraryData
59 #define InstallSharedLibraryData(libname,rev,dest) @@\
60 install:: Concat(lib,libname.sa.rev) @@\
61 MakeDir($(DESTDIR)dest) @@\
62 $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.sa.rev) $(DESTDIR)dest @@\
63 RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.sa.rev))
64 #endif /* InstallSharedLibraryData */
67 #define PureCleanSharedLibrary(libname,rev) @@\
68 clean clean.pure:: @@\
69 $(RM) Concat3(lib,libname,_pure_*.so.rev)
71 #define PureCleanSharedLibrary(libname,rev) /**/
75 * SharedLibraryTarget - generate rules to create a shared library;
76 * build it into a different name so that we do not hose people by having
77 * the library gone for long periods.
79 #ifndef SharedLibraryTarget
80 #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
81 AllTarget(Concat(lib,libname.so.rev)) @@\
83 Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\
85 (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
88 LinkBuildLibrary($@) @@\
91 $(RM) Concat(lib,libname.so.rev) @@\
93 PureCleanSharedLibrary(libname,rev)
94 #endif /* SharedLibraryTarget */
97 * SharedLibraryDataTarget - generate rules to create shlib data file;
99 #ifndef SharedLibraryDataTarget
100 #define SharedLibraryDataTarget(libname,rev,salist) @@\
101 AllTarget(Concat(lib,libname.sa.rev)) @@\
103 Concat(lib,libname.sa.rev): salist @@\
107 LinkBuildLibrary($@) @@\
110 $(RM) Concat(lib,libname.sa.rev)
111 #endif /* SharedLibraryDataTarget */