]> git.sesse.net Git - rdpsrv/blob - Xserver/config/cf/ibmLib.rules
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / config / cf / ibmLib.rules
1 XCOMM $XConsortium: ibmLib.rules /main/15 1996/12/30 16:06:05 kaleb $
2
3 /*
4  * AIX shared library rules
5  */
6
7 #ifndef HasSharedLibraries
8 # define HasSharedLibraries YES
9 #endif
10 #ifndef ForceNormalLib
11 # define ForceNormalLib NO
12 #endif
13 #ifndef SharedDataSeparation
14 # define SharedDataSeparation NO
15 #endif
16 #ifndef SharedCodeDef
17 # define SharedCodeDef -DSHAREDCODE
18 #endif
19 #ifndef SharedLibraryDef
20 # define SharedLibraryDef -DAIXSHLIB
21 #endif
22 #ifndef ShLibIncludeFile
23 # define ShLibIncludeFile <ibmLib.tmpl>
24 #endif
25 #ifndef PositionIndependentCFlags
26 # define PositionIndependentCFlags -bM\:SRE
27 #endif
28 #ifndef ExtraLoadFlags
29 # define ExtraLoadFlags -bnodelcsect
30 #endif
31 #if !defined(LdPostLib) && !defined(UseInstalled) && OSMajorVersion > 3
32 # if ThreadedX
33 #  define LdPostLib -blibpath:$(USRLIBDIRPATH):/usr/lib/threads:/usr/lib:/lib
34 # else
35 #  define LdPostLib -blibpath:$(USRLIBDIRPATH):/usr/lib:/lib
36 # endif
37 # define SharedLibPostRef $(LDPOSTLIBS)
38 #endif
39 #ifndef SharedLibPostRef
40 # define SharedLibPostRef $(LDPOSTLIBS)
41 #endif
42 #if ThreadedX
43 # define BaseShLibReqs -lc_r -lm
44 #else
45 # define BaseShLibReqs -lc -lm
46 #endif
47 #ifndef UseExportLists
48 # define UseExportLists YES
49 #endif
50
51 /*
52  * MakeExportList - generate an export list file for linking libraries.
53  */
54 #ifndef MakeExportList
55 # if UseExportLists
56 #  define MakeExportList(libname,result) \
57         @-RemoveFile(result)                                            @@\
58         case ,$(SHR4OBJLIBS), in *,libname,*) shr4obj=shr4.o;; esac &&\ @@\
59                 echo "#! $@ ($${shr4obj:-shr.o})" > result              @@\
60         if [ -f Concat(lib,libname.elist) ]; then \                     @@\
61             $(CPP) $(ALLINCLUDES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES) Concat(lib,libname.elist) | CppSedMagic > $@.list; \  @@\
62             $(EXPORTLISTGEN) $@~ $@.list >> result; \                   @@\
63             RemoveFile($@.list); \                                      @@\
64         else \                                                          @@\
65             dump -g $@~ | sed -n -e 's/^[       ]*[0-9][0-9]*[   ]*\([^  .][^    ]*\)$$/\1/p' >> result; \      @@\
66         fi;
67 # else
68 #  define MakeExportList(libname,result) \
69         @-RemoveFile(result)                                            @@\
70         case ,$(SHR4OBJLIBS), in *,libname,*) shr4obj=shr4.o;; esac &&\ @@\
71                 echo "#! $@ ($${shr4obj:-shr.o})" > result              @@\
72         dump -g $@~ | sed -n -e 's/^[   ]*[0-9][0-9]*[   ]*\([^  .][^    ]*\)$$/\1/p' >> result;
73 # endif
74 #endif /* MakeExportList */
75
76
77 #if !defined(UseInstalled) && !defined(UseInstalledX11) \
78     && !defined(UseImports) && !defined(ImportX11)
79    /* we want this to be defined only when building X */
80
81 # if OSMajorVersion < 4
82 /*
83  * SharedDSLibReferences - variables for shared libraries
84  */
85
86 #  ifndef SharedLibReferences
87 #   define SharedLibReferences(varname,libname,libsource,revname,rev)   @@\
88 Concat3(DEP,varname,LIB) = /**/                                         @@\
89 Concat(varname,LIB) = _Use(Concat(-l,libname),Concat(libsource/lib,libname.a)) @@\
90 LintLibReferences(varname,libname,libsource)
91 #  endif
92
93 # else
94
95 #  ifndef SharedLibReferences
96 #   define SharedLibReferences(varname,libname,libsource,revname,rev)   @@\
97 Concat3(DEP,varname,LIB) = /**/                                         @@\
98 Concat(varname,LIB) = _Use(Concat(-l,libname),Concat($(BUILDLIBDIR),/libname.imp) Concat3($(BUILDLIBDIR),/lib,libname.a)) @@\
99 LintLibReferences(varname,libname,libsource)
100 #  endif
101
102 # endif
103
104 /*
105  * SharedDSLibReferences - variables for shared libraries
106  */
107 # ifndef SharedDSLibReferences
108 #  define SharedDSLibReferences(varname,libname,libsource,revname,rev)  @@\
109 SharedLibReferences(varname,libname,libsource,revname,rev)
110 # endif
111
112 # if OSMajorVersion == 4
113 /*
114  * UnsharedLibReferences - variables for unshared libraries
115  */
116 #  ifndef UnsharedLibReferences
117 #   define UnsharedLibReferences(varname,libname,libsource)             @@\
118 Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/lib,$(BUILDLIBDIR)/lib,libname.a)       @@\
119 Concat(varname,LIB) = _Use(Concat(-l,libname),Concat($(BUILDLIBDIR)/lib,libname.a))     @@\
120 LintLibReferences(varname,libname,libsource)
121 #  endif
122 # endif
123
124 #endif /* !defined(UseInstalled) && !defined(UseInstalledX11) ... */
125
126
127 /*
128  * InstallSharedLibrary - generate rules to install the shared library.
129  */
130 #ifndef InstallSharedLibrary
131 # define InstallSharedLibrary(libname,rev,dest)                         @@\
132 InstallLibrary(libname,dest)
133 #endif /* InstallSharedLibrary */
134
135 /*
136  * InstallSharedLibraryData - generate rules to install the shared library data
137  */
138 #ifndef InstallSharedLibraryData
139 # define InstallSharedLibraryData(libname,rev,dest)
140 #endif /* InstallSharedLibraryData */
141
142 /*
143  * SharedLibraryTarget - generate rules to create a shared library;
144  * build it into a different name so that the we do not hose people by having
145  * the library gone for long periods.
146  *
147  * IBM uses an unusual shared object file name (shr4.o) in some libraries. 
148  * Duplicate this behavior to preserve compatibility with IBM's libraries.
149  */
150 #if OSMajorVersion < 4
151
152 # ifndef SharedLibraryTarget
153 #  define SharedLibraryTarget(libname,rev,solist,down,up)               @@\
154 AllTarget(Concat(lib,libname.a))                                        @@\
155                                                                         @@\
156 Concat(lib,libname.a):  solist $(UNSHAREDOBJS) $(EXTRALIBRARYDEPS)      @@\
157         $(RM) $@~ shr.o shr4.o                                          @@\
158         (cd down; $(AR) up/$@~ solist)                                  @@\
159         dump -g $@~ | sed -n -e 's/^[   ]*[0-9][0-9]*[   ]*\([^  .][^    ]*\)$$/\1/p' > $@.syms @@\
160         $(LD) -o shr.o $@~ -H512 -T512 -bM\:SRE -bE\:$@.syms $(REQUIREDLIBS) BaseShLibReqs SharedLibPostRef     @@\
161         $(LN) shr.o shr4.o                                              @@\
162         $(RM) $@~                                                       @@\
163         case ,$(SHR4OBJLIBS), in *,libname,*) shr4obj=shr4.o;; esac &&\ @@\
164                 $(AR) $@~ $${shr4obj} shr.o $(UNSHAREDOBJS)             @@\
165         $(RM) $@.syms $@ shr.o shr4.o                                   @@\
166         $(MV) $@~ $@                                                    @@\
167         LinkBuildLibrary($@)                                            @@\
168                                                                         @@\
169 clean::                                                                 @@\
170         $(RM) Concat(lib,libname.a)
171 # endif /* SharedLibraryTarget */
172
173 #else /* OSMajorVersion >= 4 */
174
175 # ifndef SharedLibraryTarget
176 #  define SharedLibraryTarget(libname,rev,solist,down,up)               @@\
177 AllTarget(Concat(lib,libname.a))                                        @@\
178                                                                         @@\
179 Concat(lib,libname.a):  solist $(UNSHAREDOBJS) $(EXTRALIBRARYDEPS)      @@\
180         RemoveFiles($@~ shr.o shr4.o)                                   @@\
181         (cd down; $(AR) up/$@~ solist)                                  @@\
182         MakeExportList(libname,libname.imp)                             @@\
183         $(LD) -o shr.o $@~ -H512 -T512 -bM\:SRE -bE\:libname.imp -bnoentry $(REQUIREDLIBS) BaseShLibReqs $(LDPOSTLIBS)  @@\
184         $(LN) shr.o shr4.o                                              @@\
185         RemoveFile($@~)                                                 @@\
186         case ,$(SHR4OBJLIBS), in *,libname,*) shr4obj=shr4.o;; esac &&\ @@\
187                 $(AR) $@~ $${shr4obj} shr.o $(UNSHAREDOBJS)             @@\
188         RemoveFile($@)                                                  @@\
189         $(MV) $@~ $@                                                    @@\
190         LinkBuildLibrary($@)                                            @@\
191         LinkBuildLibrary(libname.imp)                                   @@\
192                                                                         @@\
193 clean::                                                                 @@\
194         $(RM) Concat(lib,libname.a)
195 # endif /* SharedLibraryTarget */
196
197 #endif
198
199 /*
200  * SharedLibraryDataTarget - generate rules to create shlib data file;
201  */
202 #ifndef SharedLibraryDataTarget
203 # define SharedLibraryDataTarget(libname,rev,salist)
204 #endif /* SharedLibraryTarget */