]>
Commit | Line | Data |
---|---|---|
8ba159e4 | 1 | # |
2 | %bcond_with bootstrap # Build only headers | |
3 | # | |
4 | # TODO: | |
ce758fda | 5 | # |
6 | %define kernel_version 2.4.32-uc0 | |
8ba159e4 | 7 | |
8 | Summary: C library optimized for size (m68k version) | |
806a3878 | 9 | Summary(pl.UTF-8): Biblioteka C zoptymalizowana na rozmiar (dla m68k) |
8ba159e4 | 10 | Name: crossm68k-uClibc |
ce758fda | 11 | Version: 0.9.27 |
8ba159e4 | 12 | Release: 1 |
13 | Epoch: 0 | |
14 | License: LGPL | |
15 | Group: Libraries | |
16 | Source0: http://www.uclibc.org/downloads/uClibc-%{version}.tar.bz2 | |
ce758fda | 17 | # Source0-md5: 6250bd6524283bd8e7bc976d43a46ec0 |
18 | Source1: linux-%{kernel_version}.tar.bz2 | |
19 | # Source1-md5: bf6e3843ca122e3ad9ad28b94f4b8ed5 | |
ffea20ed | 20 | Source2: %{name}.config |
ce758fda | 21 | Source3: %{name}-kernel.config |
8ba159e4 | 22 | Patch0: %{name}-clone.patch |
ce758fda | 23 | Patch1: %{name}-uCLinux.patch |
8ba159e4 | 24 | URL: http://www.uclibc.org/ |
94f7c63b | 25 | %{!?with_bootstrap:BuildRequires: crossm68k-gcc} |
8ba159e4 | 26 | BuildRequires: sed >= 4.0 |
27 | BuildRequires: which | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %define target m68k-elf | |
31 | %define arch %{_prefix}/%{target} | |
32 | ||
33 | %define _noautostrip .*%{arch}/lib/.*\\.[ao]$ | |
34 | ||
35 | %description | |
36 | Small libc for building embedded applications. | |
37 | Version compiled for m68k. | |
38 | ||
3c796eea JR |
39 | %description -l pl.UTF-8 |
40 | Mała libc do budowania aplikacji wbudowanych. | |
8ba159e4 | 41 | Wersja dla m68k. |
42 | ||
43 | %prep | |
44 | %setup -q -n uClibc-%{version} -a1 | |
45 | %patch0 -p1 | |
ce758fda | 46 | %patch1 -p1 |
8ba159e4 | 47 | |
ce758fda | 48 | install -m 600 %{SOURCE2} .config |
8ba159e4 | 49 | |
ce758fda | 50 | sed -i "s@^.*KERNEL_SOURCE.*\$@KERNEL_SOURCE=\"$PWD/linux-%{kernel_version}\"@" \ |
8ba159e4 | 51 | .config |
52 | ||
ce758fda | 53 | cd linux-%{kernel_version} |
54 | install -m 600 %{SOURCE3} .config | |
55 | make ARCH=m68knommu oldconfig | |
56 | make ARCH=m68knommu dep | |
57 | cd .. | |
8ba159e4 | 58 | |
59 | %build | |
ce758fda | 60 | rm -rf $RPM_BUILD_ROOT-obj && install -d $RPM_BUILD_ROOT-obj |
61 | ||
8ba159e4 | 62 | %if %{with bootstrap} |
63 | %{__make} headers < /dev/null | |
64 | %else | |
65 | _build () { | |
66 | local MULTILIB_SUBDIR=$1 | |
67 | local PIC_CODE=$2 | |
68 | local COMPILE_FLAGS=$3 | |
ffea20ed | 69 | |
8ba159e4 | 70 | if [ $PIC_CODE -ne 0 ]; then |
71 | sed -i 's/^.*DOPIC.*$/DOPIC=y/' .config | |
8ba159e4 | 72 | else |
73 | sed -i 's/^.*DOPIC.*$/# DOPIC is not set/' .config | |
74 | fi | |
75 | ||
76 | %{__make} clean || exit 1 | |
ce758fda | 77 | %{__make} all \ |
78 | CROSS=m68k-elf- \ | |
79 | ARCH_CFLAGS="$COMPILE_FLAGS" </dev/null || exit 1 | |
ffea20ed | 80 | |
ce758fda | 81 | install -d $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR |
82 | install -m 600 lib/*.[ao] $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR | |
8ba159e4 | 83 | %{target}-strip --strip-debug -R.comment -R.note \ |
ce758fda | 84 | $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR/*.[ao] |
8ba159e4 | 85 | } |
86 | ||
ce758fda | 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" | |
89 | ||
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" | |
92 | ||
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" | |
95 | ||
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" | |
98 | ||
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" | |
ffea20ed | 101 | |
ce758fda | 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" | |
104 | ||
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" | |
107 | ||
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" | |
110 | ||
111 | _build "m68000" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68000 -Wa,-m68000" | |
112 | ||
113 | _build "msoft-float" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -msoft-float" | |
8ba159e4 | 114 | |
8ba159e4 | 115 | %endif |
116 | ||
117 | %install | |
ffea20ed | 118 | rm -rf $RPM_BUILD_ROOT |
ce758fda | 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 | |
122 | ||
123 | install -d $RPM_BUILD_ROOT%{arch}/lib | |
124 | ||
125 | %if %{without bootstrap} | |
126 | cp -R $RPM_BUILD_ROOT-obj/* $RPM_BUILD_ROOT%{arch}/lib | |
127 | %endif | |
8ba159e4 | 128 | |
129 | %clean | |
130 | rm -rf $RPM_BUILD_ROOT | |
ce758fda | 131 | rm -rf $RPM_BUILD_ROOT-obj |
8ba159e4 | 132 | |
133 | %files | |
134 | %defattr(644,root,root,755) | |
ce758fda | 135 | %doc Changelog* DEDICATION.mjn3 README TODO docs/threads.txt |
8ba159e4 | 136 | %{arch}/include |
137 | %{arch}/lib | |
138 | %{arch}/sys-include |