]> git.pld-linux.org Git - packages/crossnacl-newlib.git/blob - crossnacl-newlib.spec
up to git 5feee65
[packages/crossnacl-newlib.git] / crossnacl-newlib.spec
1 %define         gitver 5feee65
2 Summary:        C library intended for use on embedded systems
3 Name:           crossnacl-newlib
4 Version:        1.20.0
5 Release:        5.git%{gitver}
6 License:        BSD and MIT and LGPL v2+
7 Group:          Libraries
8 Source0:        nacl-newlib-%{version}-git%{gitver}.tar.xz
9 # Source0-md5:  18a0d0c7058903c35f2ef5f140fd53dc
10 Source1:        nacl-headers-27.0.1453.93.tar.xz
11 # Source1-md5:  1718b8b1fb5f5354002469413352c679
12 Source2:        newlib-libc-script
13 Source3:        pthread.h
14 Source4:        get-source.sh
15 URL:            http://sourceware.org/newlib/
16 BuildRequires:  crossnacl-binutils
17 BuildRequires:  crossnacl-gcc
18 BuildRequires:  fslint
19 BuildRequires:  tar >= 1:1.22
20 BuildRequires:  xz
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}
35 tar -xvf %{SOURCE1} -C newlib/libc/sys/nacl --strip-components=1
36 cp -p %{SOURCE2} .
37
38 %{__rm} etc/*.texi
39
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" \
53         MAKEINFO=/bin/false \
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
68 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/%{target}/include
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
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
84 # fix copies to be hardlinks (maybe should symlink in the future)
85 findup -m $RPM_BUILD_ROOT
86
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
95 %dir %{_prefix}/%{target}/lib32
96 %{_prefix}/%{target}/lib32/lib*.a
97 %{_prefix}/%{target}/lib32/crt*.o
This page took 0.060465 seconds and 3 git commands to generate.