osfLib.rules revision 1c80d5b0
1XCOMM $Xorg: osfLib.rules,v 1.3 2000/08/17 19:41:48 cpqbld Exp $ 2 3/* 4 * OSF/1 shared library rules 5 */ 6 7XCOMM $XFree86: xc/config/cf/osfLib.rules,v 1.2 1999/01/11 05:13:08 dawes Exp $ 8 9#ifndef HasSharedLibraries 10#define HasSharedLibraries YES 11#endif 12#ifndef SeparateSharedCompile 13#define SeparateSharedCompile NO 14#endif 15#ifndef SharedDataSeparation 16#define SharedDataSeparation NO 17#endif 18#ifndef SharedCodeDef 19#define SharedCodeDef /**/ 20#endif 21#ifndef SharedLibraryDef 22#define SharedLibraryDef /**/ 23#endif 24#ifndef ShLibIncludeFile 25#define ShLibIncludeFile <osfLib.tmpl> 26#endif 27#ifndef SharedLibraryLoadFlags 28#define SharedLibraryLoadFlags -shared -no_archive 29#endif 30 31#ifndef PositionIndependentCFlags 32#define PositionIndependentCFlags /**/ 33#endif 34 35/* 36 * InstallSharedLibrary - generate rules to install the shared library. 37 */ 38#ifndef InstallSharedLibrary 39#define InstallSharedLibrary(libname,rev,dest) @@\ 40install:: Concat(lib,libname.so.rev) @@\ 41 MakeDir($(DESTDIR)dest) @@\ 42 $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\ 43 $(RM) Concat($(DESTDIR)dest/lib,libname.so) @@\ 44 cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so) 45 46#endif /* InstallSharedLibrary */ 47 48/* 49 * InstallSharedLibraryData - generate rules to install the shared library data 50 */ 51#ifndef InstallSharedLibraryData 52#define InstallSharedLibraryData(libname,rev,dest) 53#endif /* InstallSharedLibraryData */ 54 55#ifndef PackageName(libname) 56#if ModernOSF1 57#define PackageName(libname) /**/ 58#define Objects(objlist) -all objlist -none 59#else 60#define PackageName(libname) -package libname 61#define Objects(objlist) objlist 62#endif 63#endif 64#if ThreadedX && ModernOSF1 && OSMajorVersion < 4 65#define BaseShLibReqs -lc_r -lc 66#else 67#define BaseShLibReqs -lc 68#endif 69 70/* 71 * SharedLibraryTarget - generate rules to create a shared library; 72 * build it into a different name so that we do not hose people by having 73 * the library gone for long periods. 74 */ 75#ifndef SharedLibraryTarget 76#if SeparateSharedCompile 77#define SharedLibraryTarget(libname,rev,solist,down,up) @@\ 78AllTarget(Concat(lib,libname.so.rev)) @@\ 79 @@\ 80Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\ 81 $(RM) $@~ @@\ 82 (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) PackageName($@) \ @@\ 83 -soname $@ Objects(solist) \ @@\ 84 $(REQUIREDLIBS) BaseShLibReqs) @@\ 85 $(RM) $@ @@\ 86 $(MV) $@~ $@ @@\ 87 $(RM) Concat(lib,libname.so) @@\ 88 $(LN) $@ Concat(lib,libname.so) @@\ 89 LinkBuildLibrary($@) @@\ 90 LinkBuildLibrary(Concat(lib,libname.so)) @@\ 91 @@\ 92clean:: @@\ 93 $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) 94#else 95#define SharedLibraryTarget(libname,rev,solist,down,up) @@\ 96AllTarget(Concat(lib,libname.so.rev)) @@\ 97 @@\ 98Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\ 99 $(RM) $@~ @@\ 100 $(LD) -o $@~ $(SHLIBLDFLAGS) PackageName($@) \ @@\ 101 -soname $@ Objects(solist) \ @@\ 102 $(REQUIREDLIBS) BaseShLibReqs @@\ 103 $(RM) $@ @@\ 104 $(MV) $@~ $@ @@\ 105 $(RM) Concat(lib,libname.so) @@\ 106 $(LN) $@ Concat(lib,libname.so) @@\ 107 LinkBuildLibrary($@) @@\ 108 LinkBuildLibrary(Concat(lib,libname.so)) @@\ 109 @@\ 110clean:: @@\ 111 $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) 112#endif /* SeparateSharedCompile */ 113#endif /* SharedLibraryTarget */ 114 115/* 116 * SharedDepLibraryTarget - generate rules to create a shared library. 117 */ 118#ifndef SharedDepLibraryTarget 119#if SeparateSharedCompile 120#define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up) @@\ 121AllTarget(Concat(lib,libname.so.rev)) @@\ 122 @@\ 123Concat(lib,libname.so.rev): deplist $(EXTRALIBRARYDEPS) @@\ 124 $(RM) $@~ @@\ 125 (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) PackageName($@) \ @@\ 126 -soname $@ Objects(solist) \ @@\ 127 $(REQUIREDLIBS) BaseShLibReqs) @@\ 128 $(RM) $@ @@\ 129 $(MV) $@~ $@ @@\ 130 $(RM) Concat(lib,libname.so) @@\ 131 $(LN) $@ Concat(lib,libname.so) @@\ 132 LinkBuildLibrary($@) @@\ 133 LinkBuildLibrary(Concat(lib,libname.so)) @@\ 134 @@\ 135clean:: @@\ 136 $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) 137#else 138#define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up) @@\ 139AllTarget(Concat(lib,libname.so.rev)) @@\ 140 @@\ 141Concat(lib,libname.so.rev): deplist $(EXTRALIBRARYDEPS) @@\ 142 $(RM) $@~ @@\ 143 $(LD) -o $@~ $(SHLIBLDFLAGS) PackageName($@) \ @@\ 144 -soname $@ Objects(solist) \ @@\ 145 $(REQUIREDLIBS) BaseShLibReqs @@\ 146 $(RM) $@ @@\ 147 $(MV) $@~ $@ @@\ 148 $(RM) Concat(lib,libname.so) @@\ 149 $(LN) $@ Concat(lib,libname.so) @@\ 150 LinkBuildLibrary($@) @@\ 151 LinkBuildLibrary(Concat(lib,libname.so)) @@\ 152 @@\ 153clean:: @@\ 154 $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) 155#endif /* SeparateSharedCompile */ 156#endif /* SharedDepLibraryTarget */ 157 158/* 159 * SharedLibraryDataTarget - generate rules to create shlib data file; 160 */ 161#ifndef SharedLibraryDataTarget 162#define SharedLibraryDataTarget(libname,rev,salist) 163#endif /* SharedLibraryTarget */ 164