]>
Commit | Line | Data |
---|---|---|
dced36fb | 1 | %define gitver 5feee65 |
a6a083c8 ER |
2 | Summary: C library intended for use on embedded systems |
3 | Name: crossnacl-newlib | |
555495c1 | 4 | Version: 1.20.0 |
dced36fb | 5 | Release: 5.git%{gitver} |
a6a083c8 ER |
6 | License: BSD and MIT and LGPL v2+ |
7 | Group: Libraries | |
b26932d5 | 8 | Source0: nacl-newlib-%{version}-git%{gitver}.tar.xz |
dced36fb ER |
9 | # Source0-md5: 18a0d0c7058903c35f2ef5f140fd53dc |
10 | Source1: nacl-headers-27.0.1453.93.tar.xz | |
11 | # Source1-md5: 1718b8b1fb5f5354002469413352c679 | |
a6a083c8 | 12 | Source2: newlib-libc-script |
a6a083c8 | 13 | Source3: pthread.h |
555495c1 | 14 | Source4: get-source.sh |
a6a083c8 ER |
15 | URL: http://sourceware.org/newlib/ |
16 | BuildRequires: crossnacl-binutils | |
17 | BuildRequires: crossnacl-gcc | |
91b4de56 | 18 | BuildRequires: fslint |
462cb7b4 ER |
19 | BuildRequires: tar >= 1:1.22 |
20 | BuildRequires: xz | |
a6a083c8 ER |
21 | ExclusiveArch: %{ix86} %{x8664} |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %define target x86_64-nacl | |
25 | ||
26 | %description | |
27 | Newlib is a C library intended for use on embedded systems. It is a | |
28 | conglomeration of several library parts, all under free software | |
29 | licenses that make them easily usable on embedded products. | |
30 | ||
6fc77ad3 | 31 | This is the NaCl fork. |
a6a083c8 ER |
32 | |
33 | %prep | |
34 | %setup -q -n nacl-newlib-%{version}-git%{?gitver} | |
555495c1 | 35 | tar -xvf %{SOURCE1} -C newlib/libc/sys/nacl --strip-components=1 |
a6a083c8 ER |
36 | cp -p %{SOURCE2} . |
37 | ||
d6974111 ER |
38 | %{__rm} etc/*.texi |
39 | ||
a6a083c8 ER |
40 | %build |
41 | export NEWLIB_CFLAGS="-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call" | |
42 | %configure \ | |
43 | --disable-libgloss \ | |
44 | --enable-newlib-iconv \ | |
45 | --enable-newlib-io-long-long \ | |
46 | --enable-newlib-io-long-double \ | |
47 | --enable-newlib-io-c99-formats \ | |
48 | --enable-newlib-mb \ | |
49 | libc_cv_initfinit_array=yes \ | |
50 | CFLAGS="-O2" \ | |
51 | CFLAGS_FOR_TARGET="$NEWLIB_CFLAGS" \ | |
52 | CXXFLAGS_FOR_TARGET="$NEWLIB_CFLAGS" \ | |
d6974111 | 53 | MAKEINFO=/bin/false \ |
a6a083c8 ER |
54 | --target=%{target} |
55 | ||
56 | %{__make} | |
57 | ||
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | %{__make} install \ | |
61 | DESTDIR=$RPM_BUILD_ROOT | |
62 | ||
63 | # Conflicts with binutils | |
64 | %{__rm} -r $RPM_BUILD_ROOT%{_infodir} | |
65 | ||
66 | # The default pthread.h doesn't work right? | |
67 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/include/pthread.h | |
6fc77ad3 | 68 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/%{target}/include |
a6a083c8 ER |
69 | |
70 | # We have to hack up libc.a to get things working. | |
71 | # 32bit | |
72 | mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libcrt_common.a | |
73 | sed "s/@OBJFORMAT@/elf32-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a | |
74 | ||
75 | # 64bit (default) | |
76 | mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libcrt_common.a | |
77 | sed "s/@OBJFORMAT@/elf64-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a | |
78 | ||
6fc77ad3 ER |
79 | # move to match -m32 -lm search path gcc uses: /usr/x86_64-nacl/lib32/libm.a |
80 | install -d $RPM_BUILD_ROOT%{_prefix}/%{target}/lib32 | |
81 | mv $RPM_BUILD_ROOT%{_prefix}/%{target}/{lib/32/*,lib32} | |
82 | rmdir $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32 | |
83 | ||
91b4de56 ER |
84 | # fix copies to be hardlinks (maybe should symlink in the future) |
85 | findup -m $RPM_BUILD_ROOT | |
86 | ||
a6a083c8 ER |
87 | %clean |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %files | |
91 | %defattr(644,root,root,755) | |
92 | %{_datadir}/iconv_data | |
93 | %{_prefix}/%{target}/include | |
94 | %{_prefix}/%{target}/lib | |
6fc77ad3 ER |
95 | %dir %{_prefix}/%{target}/lib32 |
96 | %{_prefix}/%{target}/lib32/lib*.a | |
97 | %{_prefix}/%{target}/lib32/crt*.o |