Use -O2 -fno-strict-aliasing optimization for FreeBSD
[oweals/cde.git] / cde / config / cf / bsdLib.rules
1 XCOMM $XConsortium: bsdLib.rules /main/3 1996/09/28 16:09:18 rws $
2
3 /*
4  * NetBSD/FreeBSD 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 -DBSDSHLIB
18 #endif
19 #ifndef ShLibIncludeFile
20 #define ShLibIncludeFile <bsdLib.tmpl>
21 #endif
22 #ifndef SharedLibraryLoadFlags
23 #define SharedLibraryLoadFlags -Bshareable
24 #endif
25 #ifndef PositionIndependentCFlags
26 #define PositionIndependentCFlags -fpic
27 #endif
28
29 /*
30  * InstallSharedLibrary - generate rules to install the shared library.
31  */
32 #ifndef InstallSharedLibrary
33 #define InstallSharedLibrary(libname,rev,dest)                          @@\
34 install:: Concat(lib,libname.so.rev)                                    @@\
35         MakeDir($(DESTDIR)dest)                                         @@\
36         $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
37         $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
38
39 #endif /* InstallSharedLibrary */
40
41 /*
42  * SharedLibraryTarget - generate rules to create a shared library;
43  * build it into a different name so that we do not hose people by having
44  * the library gone for long periods.
45  */
46 #ifndef SharedLibraryTarget
47 #define SharedLibraryTarget(libname,rev,solist,down,up)                 @@\
48 AllTarget(Concat(lib,libname.so.rev))                                   @@\
49                                                                         @@\
50 Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)                 @@\
51         $(RM) $@~                                                       @@\
52         (cd down; $(LD) -o up/$@~ -soname $@ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
53         $(RM) $@                                                        @@\
54         $(MV) $@~ $@                                                    @@\
55         $(RM) Concat(lib,libname.so)                                    @@\
56         $(LN) $@ Concat(lib,libname.so)                                 @@\
57         LinkBuildLibrary($@)                                            @@\
58         (cd $(BUILDLIBDIR) && $(RM) Concat(lib,libname.so) && \
59                 $(LN) $@ Concat(lib,libname.so))                        @@\
60                                                                         @@\
61 clean::                                                                 @@\
62         $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
63
64 #endif /* SharedLibraryTarget */
65
66 /*
67  * SharedLibraryDataTarget - generate rules to create shlib data file;
68  */
69 #ifndef SharedLibraryDataTarget
70 #define SharedLibraryDataTarget(libname,rev,salist)
71 #endif /* SharedLibraryDataTarget */
72
73 #ifndef InstallSharedLibraryData
74 #define InstallSharedLibraryData(libname,rev,dest)
75 #endif /* InstallSharedLibraryData */
76
77 /*
78  * SharedLibReferences - variables for shared libraries
79  */
80 #ifndef SharedLibReferences
81 #define SharedLibReferences(varname,libname,libsource,revname,rev)      @@\
82 revname = rev                                                           @@\
83 Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
84 Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname)                @@\
85 LintLibReferences(varname,libname,libsource)
86 #endif
87
88 /*
89  * SharedDSLibReferences - variables for shared libraries
90  */
91 #ifndef SharedDSLibReferences
92 #define SharedDSLibReferences(varname,libname,libsource,revname,rev)    @@\
93 revname = rev                                                           @@\
94 Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
95 Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) Concat3(Shared,libname,Reqs)           @@\
96 LintLibReferences(varname,libname,libsource)
97 #endif