]>
Commit | Line | Data |
---|---|---|
78a56c9e | 1 | %define gitver 67e3510 |
a6a083c8 ER |
2 | Summary: C library intended for use on embedded systems |
3 | Name: crossnacl-newlib | |
555495c1 | 4 | Version: 1.20.0 |
78a56c9e | 5 | Release: 1.git%{gitver} |
a6a083c8 ER |
6 | License: BSD and MIT and LGPL v2+ |
7 | Group: Libraries | |
8 | Source0: nacl-newlib-%{version}-git%{gitver}.tar.bz2 | |
78a56c9e ER |
9 | # Source0-md5: 62471478377d5f99a2ce88213731e500 |
10 | Source1: nacl-headers-21.0.1180.57.tar.bz2 | |
11 | # Source1-md5: 8e76cde640c1f268e14dbd67568a4bee | |
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 | ||
31 | This is the nacl fork. | |
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 | ||
38 | %build | |
39 | export NEWLIB_CFLAGS="-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call" | |
40 | %configure \ | |
41 | --disable-libgloss \ | |
42 | --enable-newlib-iconv \ | |
43 | --enable-newlib-io-long-long \ | |
44 | --enable-newlib-io-long-double \ | |
45 | --enable-newlib-io-c99-formats \ | |
46 | --enable-newlib-mb \ | |
47 | libc_cv_initfinit_array=yes \ | |
48 | CFLAGS="-O2" \ | |
49 | CFLAGS_FOR_TARGET="$NEWLIB_CFLAGS" \ | |
50 | CXXFLAGS_FOR_TARGET="$NEWLIB_CFLAGS" \ | |
51 | --target=%{target} | |
52 | ||
53 | %{__make} | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | %{__make} install \ | |
58 | DESTDIR=$RPM_BUILD_ROOT | |
59 | ||
60 | # Conflicts with binutils | |
61 | %{__rm} -r $RPM_BUILD_ROOT%{_infodir} | |
62 | ||
63 | # The default pthread.h doesn't work right? | |
64 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/include/pthread.h | |
65 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/%{target}/include/ | |
66 | ||
67 | # We have to hack up libc.a to get things working. | |
68 | # 32bit | |
69 | mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libcrt_common.a | |
70 | sed "s/@OBJFORMAT@/elf32-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a | |
71 | ||
72 | # 64bit (default) | |
73 | mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libcrt_common.a | |
74 | sed "s/@OBJFORMAT@/elf64-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a | |
75 | ||
91b4de56 ER |
76 | # fix copies to be hardlinks (maybe should symlink in the future) |
77 | findup -m $RPM_BUILD_ROOT | |
78 | ||
a6a083c8 ER |
79 | %clean |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %files | |
83 | %defattr(644,root,root,755) | |
84 | %{_datadir}/iconv_data | |
85 | %{_prefix}/%{target}/include | |
86 | %{_prefix}/%{target}/lib |