home *** CD-ROM | disk | FTP | other *** search
- XCOMM $XConsortium: ibmLib.rules /main/12 1995/12/04 11:59:16 kaleb $
-
- /*
- * AIX shared library rules
- */
-
- #ifndef HasSharedLibraries
- #define HasSharedLibraries YES
- #endif
- #ifndef ForceNormalLib
- #define ForceNormalLib NO
- #endif
- #ifndef SharedDataSeparation
- #define SharedDataSeparation NO
- #endif
- #ifndef SharedCodeDef
- #define SharedCodeDef -DSHAREDCODE
- #endif
- #ifndef SharedLibraryDef
- #define SharedLibraryDef -DAIXSHLIB
- #endif
- #ifndef ShLibIncludeFile
- #define ShLibIncludeFile <ibmLib.tmpl>
- #endif
- #ifndef PositionIndependentCFlags
- #define PositionIndependentCFlags -bM\:SRE
- #endif
- #ifndef ExtraLoadFlags
- #define ExtraLoadFlags -bnodelcsect
- #endif
- #if ThreadedX
- #define BaseShLibReqs -lc_r -lm
- #else
- #define BaseShLibReqs -lc -lm
- #endif
-
- /*
- * SharedDSLibReferences - variables for shared libraries
- */
- #if OSMajorVersion < 4
-
- #ifndef SharedLibReferences
- #define SharedLibReferences(varname,libname,libsource,revname,rev) @@\
- Concat3(DEP,varname,LIB) = /**/ @@\
- Concat(varname,LIB) = _Use(Concat(-l,libname),Concat(libsource/lib,libname.a)) @@\
- LintLibReferences(varname,libname,libsource)
- #endif
-
- #else
-
- #ifndef SharedLibReferences
- #define SharedLibReferences(varname,libname,libsource,revname,rev) @@\
- Concat3(DEP,varname,LIB) = /**/ @@\
- Concat(varname,LIB) = _Use(Concat(-l,libname),Concat($(BUILDLIBDIR),/libname.imp) Concat3($(BUILDLIBDIR),/lib,libname.a)) @@\
- LintLibReferences(varname,libname,libsource)
- #endif
-
- #endif
-
- /*
- * SharedDSLibReferences - variables for shared libraries
- */
- #ifndef SharedDSLibReferences
- #define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\
- SharedLibReferences(varname,libname,libsource,revname,rev)
- #endif
-
- #if OSMajorVersion == 4
- /*
- * UnsharedLibReferences - variables for unshared libraries
- */
- #ifndef UnsharedLibReferences
- #define UnsharedLibReferences(varname,libname,libsource) @@\
- Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/lib,$(BUILDLIBDIR)/lib,libname.a) @@\
- Concat(varname,LIB) = _Use(Concat(-l,libname),Concat($(BUILDLIBDIR)/lib,libname.a)) @@\
- LintLibReferences(varname,libname,libsource)
- #endif
- #endif
-
-
- /*
- * InstallSharedLibrary - generate rules to install the shared library.
- */
- #ifndef InstallSharedLibrary
- #define InstallSharedLibrary(libname,rev,dest) @@\
- InstallLibrary(libname,dest)
- #endif /* InstallSharedLibrary */
-
- /*
- * InstallSharedLibraryData - generate rules to install the shared library data
- */
- #ifndef InstallSharedLibraryData
- #define InstallSharedLibraryData(libname,rev,dest)
- #endif /* InstallSharedLibraryData */
-
- /*
- * NormalSharedLibraryTarget - generate rules to create a shared library;
- * build it into a different name so that the we do not hose people by having
- * the library gone for long periods.
- */
- #if OSMajorVersion < 4
-
- #ifndef SharedLibraryTarget
- #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
- AllTarget(Concat(lib,libname.a)) @@\
- @@\
- Concat(lib,libname.a): solist $(UNSHAREDOBJS) @@\
- $(RM) $@~ shr.o @@\
- (cd down; $(AR) up/$@~ solist) @@\
- dump -g $@~ | sed -n -e 's/^[ ]*[0-9][0-9]*[ ]*\([^ .][^ ]*\)$$/\1/p' > $@.syms @@\
- $(LD) -o shr.o $@~ -H512 -T512 -bM\:SRE -bE\:$@.syms $(REQUIREDLIBS) BaseShLibReqs -L$(USRLIBDIR) @@\
- $(RM) $@~ @@\
- $(AR) $@~ shr.o $(UNSHAREDOBJS) @@\
- $(RM) $@.syms $@ shr.o @@\
- $(MV) $@~ $@ @@\
- LinkBuildLibrary($@) @@\
- @@\
- clean:: @@\
- $(RM) Concat(lib,libname.a)
- #endif /* SharedLibraryTarget */
-
- #else /* OSMajorVersion == 4 */
-
- #ifndef SharedLibraryTarget
- #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
- AllTarget(Concat(lib,libname.a)) @@\
- @@\
- Concat(lib,libname.a): solist $(UNSHAREDOBJS) @@\
- $(RM) $@~ shr.o @@\
- (cd down; $(AR) up/$@~ solist) @@\
- echo "#! $@ (shr.o)" > libname.inp @@\
- dump -g $@~ | sed -n -e 's/^[ ]*[0-9][0-9]*[ ]*\([^ .][^ ]*\)$$/\1/p' >> libname.inp @@\
- $(LD) -o shr.o $@~ -H512 -T512 -bM\:SRE -bE\:libname.inp -bnoentry $(REQUIREDLIBS) BaseShLibReqs -L$(USRLIBDIR) @@\
- $(RM) $@~ @@\
- $(AR) $@~ shr.o $(UNSHAREDOBJS) @@\
- $(RM) $@ @@\
- $(MV) $@~ $@ @@\
- LinkBuildLibrary($@) @@\
- RemoveFile($(BUILDLIBDIR)/libname.imp) @@\
- cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/libname.inp libname.imp @@\
- @@\
- clean:: @@\
- $(RM) Concat(lib,libname.a)
- #endif /* SharedLibraryTarget */
-
- #endif
-
- /*
- * SharedLibraryDataTarget - generate rules to create shlib data file;
- */
- #ifndef SharedLibraryDataTarget
- #define SharedLibraryDataTarget(libname,rev,salist)
- #endif /* SharedLibraryTarget */
-