1XCOMM $XConsortium: hpLib.rules /main/16 1996/12/04 11:44:35 swick $ 2 3/* 4 * HP shared library rules 5 */ 6 7#ifndef HasSharedLibraries 8# define HasSharedLibraries YES 9#endif 10#ifndef SharedDataSeparation 11# define SharedDataSeparation NO 12#endif 13#ifndef SharedCodeDef 14# define SharedCodeDef /**/ 15#endif 16#ifndef SharedLibraryDef 17# define SharedLibraryDef /**/ 18#endif 19#ifndef ShLibIncludeFile 20# define ShLibIncludeFile <hpLib.tmpl> 21#endif 22#ifndef SharedLibraryLoadFlags 23# define SharedLibraryLoadFlags -b 24#endif 25#ifndef PositionIndependentCFlags 26# define PositionIndependentCFlags +z 27#endif 28#ifndef LargePositionIndependentCFlags 29# define LargePositionIndependentCFlags +Z 30#endif 31#ifndef InstLibFlags 32# define InstLibFlags -m 0555 33#endif 34#ifndef UseInstalled 35/* assert: LdPostLib pulls in -L$(USRLIBDIR), so it doesn't need to be here */ 36# define ExtraLoadFlags -Wl,+s -Wl,+b$(USRLIBDIRPATH) 37#endif 38#ifndef UseExportLists 39# define UseExportLists YES 40#endif 41 42/* Pre-linking shared libraries is supported in HP/UX 10. */ 43#if OSMajorVersion > 9 44# define HPRequiredLibs $(LDPRELIBS) $(REQUIREDLIBS) +s +b $(USRLIBDIRPATH) 45#else 46# define HPRequiredLibs $(REQUIREDLIBS) 47#endif 48 49#ifndef LinkWithExports 50# if UseExportLists 51# define LinkWithExports(libname,rev,solist,down,up) \ 52 (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) +h $@ solist HPRequiredLibs) @@\ 53 if [ -f Concat(lib,libname.elist) ]; then \ @@\ 54 RemoveFiles($@.exports $@.list); \ @@\ 55 $(CPP) $(ALLINCLUDES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES) Concat(lib,libname.elist) | CppSedMagic >$@.list; \ @@\ 56 $(EXPORTLISTGEN) $@~ $@.list > $@.exports; \ @@\ 57 (cd down; $(LD) -c up/$@.exports -o up/$@~ $(SHLIBLDFLAGS) +h $@ solist HPRequiredLibs); \ @@\ 58 RemoveFiles($@.exports $@.list); \ @@\ 59 fi 60# else 61# define LinkWithExports(libname,rev,solist,down,up) \ 62 (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) +h $@ solist HPRequiredLibs) 63# endif 64#endif 65 66/* 67 * InstallSharedLibrary - generate rules to install the shared library. 68 */ 69#ifndef InstallSharedLibrary 70# define InstallSharedLibrary(libname,rev,dest) @@\ 71install:: Concat(lib,libname.sl.rev) @@\ 72 MakeDir($(DESTDIR)dest) @@\ 73 RMoveToBakFile(Concat($(DESTDIR)dest/lib,libname.sl.rev)) @@\ 74 $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.sl.rev) $(DESTDIR)dest @@\ 75 $(RM) Concat($(DESTDIR)dest/lib,libname.sl) @@\ 76 cd $(DESTDIR)dest; $(LN) Concat(lib,libname.sl.rev) Concat(lib,libname.sl) @@\ 77 -RemoveFile(Concat(lib,libname.sl.rev.bak)) 78 79#endif /* InstallSharedLibrary */ 80 81/* 82 * InstallSharedLibraryData - generate rules to install the shared library data 83 */ 84#ifndef InstallSharedLibraryData 85# define InstallSharedLibraryData(libname,rev,dest) 86#endif /* InstallSharedLibraryData */ 87 88 89/* 90 * SharedLibraryTarget - generate rules to create a shared library; 91 * build it into a different name so that we do not hose people by having 92 * the library gone for long periods. 93 */ 94#ifndef SharedLibraryTarget 95# define SharedLibraryTarget(libname,rev,solist,down,up) @@\ 96AllTarget(Concat(lib,libname.sl.rev)) @@\ 97 @@\ 98Concat(lib,libname.sl.rev): solist $(EXTRALIBRARYDEPS) @@\ 99 $(RM) $@~ @@\ 100 LinkWithExports(libname,rev,solist,down,up) @@\ 101 -RemoveFiles($@ $@.bak) @@\ 102 MoveToBakFile($@) @@\ 103 $(MV) $@~ $@ @@\ 104 $(RM) Concat(lib,libname.sl) @@\ 105 $(LN) $@ Concat(lib,libname.sl) @@\ 106 LinkBuildLibrary($@) @@\ 107 LinkBuildLibrary(Concat(lib,libname.sl)) @@\ 108 @@\ 109clean:: @@\ 110 $(RM) Concat(lib,libname.sl.rev) Concat(lib,libname.sl) 111 112#endif /* SharedLibraryTarget */ 113 114/* 115 * SharedLibraryDataTarget - generate rules to create shlib data file; 116 */ 117#ifndef SharedLibraryDataTarget 118# define SharedLibraryDataTarget(libname,rev,salist) 119#endif /* SharedLibraryTarget */ 120