1
XCOMM $Xorg: sgiLib.rules,v 1.3 2000/08/17 19:41:48 cpqbld Exp $
2
XCOMM $XFree86: xc/config/cf/sgiLib.rules,v 1.4 2001/01/17 16:22:33 dawes Exp $
4
#ifndef HasSharedLibraries
5
#define HasSharedLibraries YES
8
#ifndef SharedDataSeparation
9
#define SharedDataSeparation YES
11
#define SharedCodeDef -DSHAREDCODE
12
#define SharedLibraryDef -DATTSHAREDLIB
13
#define PositionIndependentCFlags -G 0
16
* SharedLibraryTarget - generate rules to create a shared library;
17
* build it into a different name so that we don't hose people by having
18
* the library gone for long periods.
20
#define SharedLibraryTarget(libname,rev,solist,down,up) @@\
21
AllTarget(Concat3(lib,libname,_s)) @@\
23
Concat3(lib,libname,_s): sharedlib.o solist Concat(lib,libname.spec) $(EXTRALIBRARYDEPS) @@\
26
&& mkshlib -s Concat(up/lib,libname.spec) -t up/$@ -h up/$@.a \ @@\
27
&& ar rs up/$@.a sharedlib.o @@\
28
LinkBuildLibrary($@) @@\
29
LinkBuildLibrary($@.a) @@\
32
$(RM) Concat3(lib,libname,_s) Concat3(lib,libname,_s.a)
35
* SharedDepLibraryTarget - generate rules to create a shared library.
37
#define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up) @@\
38
AllTarget(Concat3(lib,libname,_s)) @@\
40
Concat3(lib,libname,_s): deplist sharedlib.o Concat(lib,libname.spec) $(EXTRALIBRARYDEPS) @@\
43
&& mkshlib -s Concat(up/lib,libname.spec) -t up/$@ -h up/$@.a \ @@\
44
&& ar rs up/$@.a sharedlib.o @@\
45
LinkBuildLibrary($@) @@\
46
LinkBuildLibrary($@.a) @@\
49
$(RM) Concat3(lib,libname,_s) Concat3(lib,libname,_s.a)
51
#define SharedLibraryDataTarget(libname,rev,salist)
54
* InstallSharedLibrary - generate rules to install the shared library.
55
* NOTE: file must be executable, hence "INSTBINFLAGS"
57
#define InstallSharedLibrary(libname,rev,dest) @@\
58
install:: Concat3(lib,libname,_s) @@\
59
MakeDir($(DESTDIR)dest) @@\
60
$(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)dest @@\
61
$(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat3(lib,libname,_s) $(DESTDIR)dest
65
* InstallSharedLibraryData - generate rules to install the shared library data
67
#define InstallSharedLibraryData(libname,rev,dest) @@\
68
InstallTarget(install,Concat3(lib,libname,_s.a),$(INSTLIBFLAGS),dest)
70
#else /* OSMajorVersion >= 5 */
72
#ifndef SharedDataSeparation
73
#define SharedDataSeparation NO
76
#define SharedCodeDef /**/
78
#ifndef SharedLibraryDef
79
#define SharedLibraryDef /**/
81
#ifndef ShLibIncludeFile
82
#define ShLibIncludeFile <sgiLib.tmpl>
84
#ifndef SharedLibraryLoadFlags
85
#if OSMajorVersion < 6
86
#define SharedLibraryLoadFlags -shared
88
#ifndef Mips64Architecture
89
#define SharedLibraryLoadFlags -shared
91
#define SharedLibraryLoadFlags -shared -mips3
95
/* -KPIC is redundant, PIC is always used unless you specify -non_shared */
96
#ifndef PositionIndependentCFlags
97
#define PositionIndependentCFlags -KPIC
99
#ifndef PositionIndependentCplusplusFlags
100
#define PositionIndependentCplusplusFlags -KPIC
104
* SGI's cc passes an undocumented flag to ld that causes it to look for
105
* -lX11 and force use of libX11.so.1. And it can't be turned off. Sigh.
106
* So we install one of those, too, in the shared library install target.
110
* InstallSharedLibrary - generate rules to install the shared library.
112
#ifndef InstallSharedLibrary
113
#define InstallSharedLibrary(libname,rev,dest) @@\
114
install:: Concat(lib,libname.so.rev) @@\
115
MakeDir($(DESTDIR)dest) @@\
116
$(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
117
$(RM) Concat($(DESTDIR)dest/lib,libname.so) @@\
118
cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so) @@\
119
if [ "libname" = X11 ]; then \ @@\
120
RemoveFile(Concat($(DESTDIR)dest/lib,libname.so.1)); \ @@\
121
cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so.1);\ @@\
124
#endif /* InstallSharedLibrary */
127
* InstallSharedLibraryData - generate rules to install the shared library data
129
#ifndef InstallSharedLibraryData
130
#define InstallSharedLibraryData(libname,rev,dest)
131
#endif /* InstallSharedLibraryData */
135
* SharedLibraryTarget - generate rules to create a shared library;
136
* build it into a different name so that we do not hose people by having
137
* the library gone for long periods.
141
* SGI's cc passes an undocumented flag to ld that causes it to look for
142
* -lX11 and force use of libX11.so.1. Sigh. So we make one of those, too,
143
* in the shared library build target.
148
#define sgiX11soHack(libname) /**/
150
#define sgiX11soHack(libname) if [ "libname" = X11 ]; then \ @@\
151
RemoveFile($(BUILDLIBDIR)/Concat(lib,libname.so.1)); \ @@\
152
cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/$@ Concat(lib,libname.so.1); \ @@\
155
#endif /* sgiX11soHack */
157
#ifndef SharedLibraryTarget
158
#define SharedLibraryTarget(libname,rev,solist,down,up) @@\
159
AllTarget(Concat(lib,libname.so.rev)) @@\
161
Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\
163
(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -soname $@ solist $(REQUIREDLIBS)) @@\
166
$(RM) Concat(lib,libname.so) @@\
167
$(LN) $@ Concat(lib,libname.so) @@\
168
LinkBuildLibrary($@) @@\
169
LinkBuildLibrary(Concat(lib,libname.so)) @@\
170
sgiX11soHack(libname) @@\
173
$(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) so_locations
175
#endif /* SharedLibraryTarget */
178
* SharedLibraryDataTarget - generate rules to create shlib data file;
180
#ifndef SharedLibraryDataTarget
181
#define SharedLibraryDataTarget(libname,rev,salist)
182
#endif /* SharedLibraryTarget */
184
#ifndef SharedDepLibraryTarget
185
#define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up) @@\
186
AllTarget(Concat(lib,libname.so.rev)) @@\
188
Concat(lib,libname.so.rev): deplist $(EXTRALIBRARYDEPS) @@\
190
(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -soname $@ solist $(REQUIREDLIBS)) @@\
193
$(RM) Concat(lib,libname.so) @@\
194
$(LN) $@ Concat(lib,libname.so) @@\
195
LinkBuildLibrary($@) @@\
196
LinkBuildLibrary(Concat(lib,libname.so)) @@\
197
sgiX11soHack(libname) @@\
200
$(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) so_locations
202
#endif /* SharedDepLibraryTarget */
204
#endif /* OsMajorVersion < 5 else */