]> git.pld-linux.org Git - packages/crossnacl-newlib.git/blame - crossnacl-newlib.spec
up to git 5feee65
[packages/crossnacl-newlib.git] / crossnacl-newlib.spec
CommitLineData
dced36fb 1%define gitver 5feee65
a6a083c8
ER
2Summary: C library intended for use on embedded systems
3Name: crossnacl-newlib
555495c1 4Version: 1.20.0
dced36fb 5Release: 5.git%{gitver}
a6a083c8
ER
6License: BSD and MIT and LGPL v2+
7Group: Libraries
b26932d5 8Source0: nacl-newlib-%{version}-git%{gitver}.tar.xz
dced36fb
ER
9# Source0-md5: 18a0d0c7058903c35f2ef5f140fd53dc
10Source1: nacl-headers-27.0.1453.93.tar.xz
11# Source1-md5: 1718b8b1fb5f5354002469413352c679
a6a083c8 12Source2: newlib-libc-script
a6a083c8 13Source3: pthread.h
555495c1 14Source4: get-source.sh
a6a083c8
ER
15URL: http://sourceware.org/newlib/
16BuildRequires: crossnacl-binutils
17BuildRequires: crossnacl-gcc
91b4de56 18BuildRequires: fslint
462cb7b4
ER
19BuildRequires: tar >= 1:1.22
20BuildRequires: xz
a6a083c8
ER
21ExclusiveArch: %{ix86} %{x8664}
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%define target x86_64-nacl
25
26%description
27Newlib is a C library intended for use on embedded systems. It is a
28conglomeration of several library parts, all under free software
29licenses that make them easily usable on embedded products.
30
6fc77ad3 31This is the NaCl fork.
a6a083c8
ER
32
33%prep
34%setup -q -n nacl-newlib-%{version}-git%{?gitver}
555495c1 35tar -xvf %{SOURCE1} -C newlib/libc/sys/nacl --strip-components=1
a6a083c8
ER
36cp -p %{SOURCE2} .
37
d6974111
ER
38%{__rm} etc/*.texi
39
a6a083c8
ER
40%build
41export 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
59rm -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 68cp -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
72mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libcrt_common.a
73sed "s/@OBJFORMAT@/elf32-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a
74
75# 64bit (default)
76mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libcrt_common.a
77sed "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
80install -d $RPM_BUILD_ROOT%{_prefix}/%{target}/lib32
81mv $RPM_BUILD_ROOT%{_prefix}/%{target}/{lib/32/*,lib32}
82rmdir $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32
83
91b4de56
ER
84# fix copies to be hardlinks (maybe should symlink in the future)
85findup -m $RPM_BUILD_ROOT
86
a6a083c8
ER
87%clean
88rm -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
This page took 0.162681 seconds and 4 git commands to generate.