btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / libroot / Jamfile
blobfcb06a927963323e0b9ad2354c7e834ccd6b6070
1 SubDir HAIKU_TOP src system libroot ;
3 UsePrivateHeaders libroot runtime_loader ;
5 local architectureObject ;
6 for architectureObject in [ MultiArchSubDirSetup ] {
7         on $(architectureObject) {
8                 local architecture = $(TARGET_PACKAGING_ARCH) ;
10                 UsePrivateSystemHeaders ;
12                 local libgccAsSingleObject ;
13                 if $(architecture) = x86_gcc2 {
14                         libgccAsSingleObject
15                                 = <$(architecture)>libroot_libgcc_$(TARGET_ARCH).o ;
16                         # One object to link them all...
17                         TARGET_LDFLAGS_$(TARGET_PACKAGING_ARCH) on
18                                 <$(architecture)>libroot_libgcc_$(TARGET_ARCH).o =
19                                 [ on <$(architecture)>libroot_libgcc_$(TARGET_ARCH).o
20                                         return $(TARGET_LDFLAGS_$(TARGET_PACKAGING_ARCH)) ]
21                                 --whole-archive ;
22                         MergeObject $(libgccAsSingleObject) : : [ TargetLibgcc ] ;
23                 }
25                 local librootObjects =
26                         $(libgccAsSingleObject)
28                         os_main.o
29                         os_arch_$(TARGET_ARCH).o
31                         posix_arch_$(TARGET_ARCH).o
32                         posix_crypt.o
33                         posix_locale.o
34                         posix_main.o
35                         posix_pthread.o
36                         posix_signal.o
37                         posix_stdio.o
38                         posix_gnu_arch_$(TARGET_ARCH).o
39                         posix_gnu_ctype.o
40                         posix_gnu_ext.o
41                         posix_gnu_iconv.o
42                         posix_gnu_libio.o
43                         posix_gnu_locale.o
44                         posix_gnu_math.o
45                         posix_gnu_misc.o
46                         posix_gnu_regex.o
47                         posix_gnu_stdio.o
48                         posix_gnu_stdlib.o
49                         posix_gnu_string.o
50                         posix_gnu_wcsmbs.o
51                         posix_stdlib.o
52                         posix_string.o
53                         posix_string_arch_$(TARGET_ARCH).o
54                         posix_sys.o
55                         posix_time.o
56                         posix_unistd.o
57                         posix_wchar.o
58                         ;
59                 librootObjects = $(librootObjects:G=$(architecture)) ;
61                 local librootDebugObjects =
62                         posix_malloc_debug.o
63                         ;
64                 librootDebugObjects = $(librootDebugObjects:G=$(architecture)) ;
66                 local librootNoDebugObjects =
67                         posix_malloc.o
68                         ;
69                 librootNoDebugObjects = $(librootNoDebugObjects:G=$(architecture)) ;
71                 local libroot = [ MultiArchDefaultGristFiles libroot.so ] ;
72                 local librootDebug = $(libroot:B=libroot_debug) ;
74                 DONT_LINK_AGAINST_LIBROOT on $(libroot) = true ;
75                 DONT_LINK_AGAINST_LIBROOT on $(librootDebug) = true ;
77                 SetVersionScript $(libroot) : libroot_versions ;
78                 SetVersionScript $(librootDebug) : libroot_versions ;
80                 SharedLibrary $(libroot)
81                         :
82                         libroot_init.c
83                         :
84                         $(librootObjects)
85                         $(librootNoDebugObjects)
86                         [ TargetStaticLibsupc++ ]
87                         [ TargetLibgcc ]
88                         ;
90                 # Use the standard libroot.so soname, so when the debug version is
91                 # pre-loaded it prevents the standard version to be loaded as well.
92                 HAIKU_SONAME on $(librootDebug) = libroot.so ;
94                 SharedLibrary $(librootDebug)
95                         :
96                         libroot_init.c
97                         :
98                         $(librootObjects)
99                         $(librootDebugObjects)
100                         [ TargetStaticLibsupc++ ]
101                         [ TargetLibgcc ]
102                         ;
104                 StaticLibrary [ MultiArchDefaultGristFiles libm.a ] : empty.c ;
105                 StaticLibrary [ MultiArchDefaultGristFiles libpthread.a ] : empty.c ;
107                 # Copy libroot.so and update the copy's revision section. We link
108                 # everything against the original, but the copy will end up on the disk
109                 # image (this way we avoid unnecessary dependencies). The copy will be
110                 # located in a subdirectory.
111                 if $(TARGET_PLATFORM) = haiku {
112                         local targetDir = [ FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET)
113                                 revisioned ] ;
114                         local revisionedLibroot = [ MultiArchDefaultGristFiles
115                                 libroot.so : revisioned ] ;
116                         local revisionedLibrootDebug
117                                 = $(librootDebug:G=$(revisionedLibroot:G)) ;
119                         MakeLocate $(revisionedLibroot) : $(targetDir) ;
120                         CopySetHaikuRevision $(revisionedLibroot) : $(libroot) ;
122                         MakeLocate $(revisionedLibrootDebug) : $(targetDir) ;
123                         CopySetHaikuRevision $(revisionedLibrootDebug) : $(librootDebug) ;
124                 }
125         }
128 SubInclude HAIKU_TOP src system libroot add-ons ;
129 SubInclude HAIKU_TOP src system libroot os ;
130 SubInclude HAIKU_TOP src system libroot posix ;
131 SubInclude HAIKU_TOP src system libroot stubbed ;