]> git.pld-linux.org Git - packages/crossnacl-newlib.git/blame - crossnacl-newlib.spec
avoid building .info from .text, as we are removing the result files
[packages/crossnacl-newlib.git] / crossnacl-newlib.spec
CommitLineData
b26932d5 1%define gitver 51a8366
a6a083c8
ER
2Summary: C library intended for use on embedded systems
3Name: crossnacl-newlib
555495c1 4Version: 1.20.0
b26932d5 5Release: 2.git%{gitver}
a6a083c8
ER
6License: BSD and MIT and LGPL v2+
7Group: Libraries
b26932d5
ER
8Source0: nacl-newlib-%{version}-git%{gitver}.tar.xz
9# Source0-md5: e3bfa762283d0ecda5fc198781c92c37
10Source1: nacl-headers-23.0.1271.64.tar.xz
11# Source1-md5: ab7b7b3dfd91f3f98969e5312941d6d2
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
31This is the nacl fork.
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
68cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/%{target}/include/
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
91b4de56
ER
79# fix copies to be hardlinks (maybe should symlink in the future)
80findup -m $RPM_BUILD_ROOT
81
a6a083c8
ER
82%clean
83rm -rf $RPM_BUILD_ROOT
84
85%files
86%defattr(644,root,root,755)
87%{_datadir}/iconv_data
88%{_prefix}/%{target}/include
89%{_prefix}/%{target}/lib
This page took 0.162516 seconds and 4 git commands to generate.