2 %bcond_with bootstrap # Build only headers
6 %define kernel_version 2.4.32-uc0
8 Summary: C library optimized for size (m68k version)
9 Summary(pl.UTF-8): Biblioteka C zoptymalizowana na rozmiar (dla m68k)
10 Name: crossm68k-uClibc
16 Source0: http://www.uclibc.org/downloads/uClibc-%{version}.tar.bz2
17 # Source0-md5: 6250bd6524283bd8e7bc976d43a46ec0
18 Source1: linux-%{kernel_version}.tar.bz2
19 # Source1-md5: bf6e3843ca122e3ad9ad28b94f4b8ed5
20 Source2: %{name}.config
21 Source3: %{name}-kernel.config
22 Patch0: %{name}-clone.patch
23 Patch1: %{name}-uCLinux.patch
24 URL: http://www.uclibc.org/
25 %{!?with_bootstrap:BuildRequires: crossm68k-gcc}
26 BuildRequires: sed >= 4.0
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define target m68k-elf
31 %define arch %{_prefix}/%{target}
33 %define _noautostrip .*%{arch}/lib/.*\\.[ao]$
36 Small libc for building embedded applications.
37 Version compiled for m68k.
39 %description -l pl.UTF-8
40 Mała libc do budowania aplikacji wbudowanych.
44 %setup -q -n uClibc-%{version} -a1
48 install -m 600 %{SOURCE2} .config
50 sed -i "s@^.*KERNEL_SOURCE.*\$@KERNEL_SOURCE=\"$PWD/linux-%{kernel_version}\"@" \
53 cd linux-%{kernel_version}
54 install -m 600 %{SOURCE3} .config
55 make ARCH=m68knommu oldconfig
56 make ARCH=m68knommu dep
60 rm -rf $RPM_BUILD_ROOT-obj && install -d $RPM_BUILD_ROOT-obj
63 %{__make} headers < /dev/null
66 local MULTILIB_SUBDIR=$1
68 local COMPILE_FLAGS=$3
70 if [ $PIC_CODE -ne 0 ]; then
71 sed -i 's/^.*DOPIC.*$/DOPIC=y/' .config
73 sed -i 's/^.*DOPIC.*$/# DOPIC is not set/' .config
76 %{__make} clean || exit 1
79 ARCH_CFLAGS="$COMPILE_FLAGS" </dev/null || exit 1
81 install -d $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR
82 install -m 600 lib/*.[ao] $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR
83 %{target}-strip --strip-debug -R.comment -R.note \
84 $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR/*.[ao]
87 _build "m5200" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5200 -Wa,-m5200"
88 _build "m5200/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5200 -Wa,-m5200 -msep-data"
90 _build "m5206e" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5206e -Wa,-m5206e"
91 _build "m5206e/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5206e -Wa,-m5206e -msep-data"
93 _build "m528x" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m528x -Wa,-m528x"
94 _build "m528x/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m528x -Wa,-m528x -msep-data"
96 _build "m5307" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5307 -Wa,-m5307"
97 _build "m5307/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5307 -Wa,-m5307 -msep-data"
99 _build "m5407" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5407 -Wa,-m5407"
100 _build "m5407/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5407 -Wa,-m5407 -msep-data"
102 _build "m68040" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68040 -Wa,-m68040"
103 _build "m68040/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68040 -Wa,-m68040 -msep-data"
105 _build "m68060" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68060 -Wa,-m68060"
106 _build "m68060/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68060 -Wa,-m68060 -msep-data"
108 _build "mcpu32" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -mcpu32 -Wa,-mcpu32"
109 _build "mcpu32/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -mcpu32 -Wa,-mcpu32 -msep-data"
111 _build "m68000" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68000 -Wa,-m68000"
113 _build "msoft-float" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -msoft-float"
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT%{arch}/include
120 cp -RL include/* $RPM_BUILD_ROOT%{arch}/include
121 ln -s include $RPM_BUILD_ROOT%{arch}/sys-include
123 install -d $RPM_BUILD_ROOT%{arch}/lib
125 %if %{without bootstrap}
126 cp -R $RPM_BUILD_ROOT-obj/* $RPM_BUILD_ROOT%{arch}/lib
130 rm -rf $RPM_BUILD_ROOT
131 rm -rf $RPM_BUILD_ROOT-obj
134 %defattr(644,root,root,755)
135 %doc Changelog* DEDICATION.mjn3 README TODO docs/threads.txt