linux.cf: with fds_bits fixes, stop using _POSIX_C_SOURCE=199309L and _XOPEN_SOURCE...
[oweals/cde.git] / cde / config / cf / sv4Lib.rules
1 XCOMM $TOG: sv4Lib.rules /main/19 1999/03/22 16:26:02 mgreess $
2
3 /*
4  * SVR4 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 <sv4Lib.tmpl>
21 #endif
22 #ifndef SharedLibraryLoadFlags
23 # define SharedLibraryLoadFlags -G -z text
24 #endif
25 #ifndef PositionIndependentCFlags
26 # if HasGcc2
27 #  define PositionIndependentCFlags -fPIC
28 # else
29 #  define PositionIndependentCFlags -K PIC
30 # endif
31 #endif
32 #ifndef PositionIndependentCplusplusFlags
33 # if HasGcc2ForCplusplus
34 #  define PositionIndependentCplusplusFlags -fpic
35 # else
36 #  define PositionIndependentCplusplusFlags -K PIC
37 # endif
38 #endif
39 #ifndef UseExportLists
40 # define UseExportLists NO
41 #endif
42
43 /*
44  * InstallSharedLibrary - generate rules to install the shared library.
45  */
46 #ifndef InstallSharedLibrary
47 # define InstallSharedLibrary(libname,rev,dest)                         @@\
48 install:: Concat(lib,libname.so.rev)                                    @@\
49         MakeDir($(DESTDIR)dest)                                         @@\
50         $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
51         $(RM) Concat($(DESTDIR)dest/lib,libname.so)                     @@\
52         cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so)
53
54 #endif /* InstallSharedLibrary */
55
56 /*
57  * InstallSharedLibraryData - generate rules to install the shared library data
58  */
59 #ifndef InstallSharedLibraryData
60 # define InstallSharedLibraryData(libname,rev,dest)
61 #endif /* InstallSharedLibraryData */
62
63 #ifndef LinkWithExports
64 # if UseExportLists
65 #  define LinkWithExports(libname,rev,solist,down,up) \
66         (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS))   @@\
67         if [ -f Concat(lib,libname.elist) ]; then \                     @@\
68             $(RM) down/$@.exports $@.list; \                            @@\
69             $(CPP) $(ALLINCLUDES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES) Concat(lib,libname.elist) | CppSedMagic >$@.list; \   @@\
70             $(EXPORTLISTGEN) $@~ $@.list > down/$@.exports; \           @@\
71             (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ ShlibExportListOpt($@.exports) solist $(REQUIREDLIBS)); \     @@\
72             $(RM) down/$@.exports $@.list; \                            @@\
73         fi;
74 # else
75 #  define LinkWithExports(libname,rev,solist,down,up) \
76         (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS))
77 # endif
78 #endif
79
80 /*
81  * SharedLibraryTarget - generate rules to create a shared library;
82  * build it into a different name so that we do not hose people by having
83  * the library gone for long periods.
84  */
85 #ifndef SharedLibraryTarget
86 # define SharedLibraryTarget(libname,rev,solist,down,up)                @@\
87 AllTarget(Concat(lib,libname.so.rev))                                   @@\
88                                                                         @@\
89 Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)                 @@\
90         $(RM) $@~                                                       @@\
91         LinkWithExports(libname,rev,solist,down,up)                     @@\
92         $(RM) $@                                                        @@\
93         $(MV) $@~ $@                                                    @@\
94         $(RM) Concat(lib,libname.so)                                    @@\
95         $(LN) $@ Concat(lib,libname.so)                                 @@\
96         LinkBuildLibrary($@)                                            @@\
97         LinkBuildLibrary(Concat(lib,libname.so))                        @@\
98                                                                         @@\
99 clean::                                                                 @@\
100         $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
101
102 #endif /* SharedLibraryTarget */
103
104 /*
105  * SharedLibraryDataTarget - generate rules to create shlib data file;
106  */
107 #ifndef SharedLibraryDataTarget
108 # define SharedLibraryDataTarget(libname,rev,salist)
109 #endif /* SharedLibraryTarget */