2 %bcond_with bootstrap # Build only headers
6 # - add support for flat shared libraries (-mid-shared-library)
9 %define llh_version 2.4.31
11 Summary: C library optimized for size (mipsel version)
12 Summary(pl): Biblioteka C zoptymalizowana na rozmiar (dla mipsel)
13 Name: crossmipsel-uClibc
19 Source0: http://www.uclibc.org/downloads/uClibc-%{version}.tar.bz2
20 # Source0-md5: 1ada58d919a82561061e4741fb6abd29
21 Source1: http://www.uclibc.org/downloads/toolchain/linux-libc-headers-%{llh_version}.tar.bz2
22 # Source1-md5: 997d36627baf6825c712431dee4d79d3
23 Source2: crossmipsel-uClibc.config
24 URL: http://www.uclibc.org/
25 %{?!with_bootstrap:BuildRequires: crossmipsel-gcc}
26 BuildRequires: sed >= 4.0
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define target mipsel-pld-linux
31 %define arch %{_prefix}/%{target}
33 %define _noautostrip .*%{arch}/lib/.*\\.[ao]$
36 Small libc for building embedded applications.
37 Version compiled for mipsel.
40 Ma³a libc do budowania aplikacji wbudowanych.
44 %setup -q -n uClibc-%{version} -a1
46 install %{SOURCE2} .config
48 sed -i "s@^.*KERNEL_SOURCE.*\$@KERNEL_SOURCE=\"$PWD/linux-libc-headers-%{llh_version}\"@" \
51 cd linux-libc-headers-%{llh_version}/include/asm-mips
52 grep '#include[[:space:]]\+<asm-mipsel/.\+\.h>' * | cut -f1 -d: | while read file; do
53 cat "../asm-mipsel/$file" > "$file"
58 %{__make} headers < /dev/null
61 local MULTILIB_SUBDIR=$1
63 local COMPILE_FLAGS=$3
65 cat .config | grep -v "HAVE_SHARED" > .config.tmp
66 cat .config.tmp | grep -v "BUILD_UCLIBC_LDSO" > .config
68 if [ $PIC_CODE -ne 0 ]; then
69 sed -i 's/^.*DOPIC.*$/DOPIC=y/' .config
70 echo "HAVE_SHARED=n" >> .config
72 sed -i 's/^.*DOPIC.*$/# DOPIC is not set/' .config
75 %{__make} clean || exit 1
76 %{__make} all ARCH_CFLAGS="$COMPILE_FLAGS" </dev/null || exit 1
78 install -d $RPM_BUILD_ROOT%{arch}/lib/$MULTILIB_SUBDIR
79 install lib/*.[ao] $RPM_BUILD_ROOT%{arch}/lib/$MULTILIB_SUBDIR
80 %{target}-strip --strip-debug -R.comment -R.note \
81 $RPM_BUILD_ROOT%{arch}/lib/$MULTILIB_SUBDIR/*.[ao]
84 rm -rf $RPM_BUILD_ROOT
86 _build "mipsel" 0 "-Wall -march=mips32 -mtune=mips32 -nostdinc -mno-split-addresses"
87 _build "mipsel" 1 "-Wall -march=mips32 -mtune=mips32 -nostdinc -mno-split-addresses"
92 install -d $RPM_BUILD_ROOT%{arch}/include
93 cp -RL include/* $RPM_BUILD_ROOT%{arch}/include
94 ln -s include $RPM_BUILD_ROOT%{arch}/sys-include
97 rm -rf $RPM_BUILD_ROOT
100 %defattr(644,root,root,755)
101 %doc Changelog* DEDICATION.mjn3 MAINTAINERS README TODO docs/threads.txt