[e3aa355] | 1 | # |
---|
| 2 | # RTEMS 4.xx Version 1. |
---|
| 3 | # |
---|
| 4 | # This configuration file configure's, make's and install's RTEMS. |
---|
| 5 | # |
---|
| 6 | |
---|
| 7 | %include %{_configdir}/checks.cfg |
---|
| 8 | |
---|
| 9 | Name: %{_target}-kernel-%{rtems_kernel_version}-%{release} |
---|
| 10 | Summary: RTEMS v%{rtems_kernel_version} for target %{_target} on host %{_host} |
---|
| 11 | Version: %{rtems_kernel_version} |
---|
| 12 | Release: %{release} |
---|
| 13 | URL: http://www..rtems.org/ |
---|
| 14 | BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) |
---|
| 15 | |
---|
| 16 | # |
---|
| 17 | # Source |
---|
| 18 | # |
---|
[9a15c40] | 19 | %source set rtems http://ftp.rtems.org/ftp/pub/rtems/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.bz2 |
---|
[e3aa355] | 20 | |
---|
[3ff992b] | 21 | # |
---|
| 22 | # If C++ defined for the tool set use it to control RTEMS's setting.. |
---|
| 23 | # |
---|
[699a51c5] | 24 | %if %{defined enable_cxx} |
---|
[3ff992b] | 25 | %define rtems_cxx %{enable_cxx} |
---|
| 26 | %endif |
---|
| 27 | |
---|
[e3aa355] | 28 | # |
---|
| 29 | # Default set up. |
---|
| 30 | # |
---|
| 31 | %ifn %{defined rtems_posix} |
---|
| 32 | %define rtems_posix 1 |
---|
| 33 | %endif |
---|
| 34 | %ifn %{defined rtems_networking} |
---|
| 35 | %define rtems_networking 1 |
---|
| 36 | %endif |
---|
| 37 | %ifn %{defined rtems_cxx} |
---|
| 38 | %define rtems_cxx 1 |
---|
| 39 | %endif |
---|
| 40 | %ifn %{defined rtems_tests} |
---|
| 41 | %define rtems_tests samples |
---|
| 42 | %endif |
---|
| 43 | |
---|
[9c150cf] | 44 | %if %{rtems_tests} == disable |
---|
[e3aa355] | 45 | %define rtems_tests_opt --disable-tests |
---|
| 46 | %else |
---|
| 47 | %define rtems_tests_opt --enable-tests=%{rtems_tests} |
---|
| 48 | %endif |
---|
| 49 | |
---|
[c12323f] | 50 | # |
---|
| 51 | # It the rtems_bsps is all undefine it |
---|
| 52 | # |
---|
[cd93d89] | 53 | %if %{defined rtems_bsp} |
---|
| 54 | %if %{rtems_bsps} == all |
---|
| 55 | %undefine rtems_bsps |
---|
| 56 | %endif |
---|
[c12323f] | 57 | %endif |
---|
| 58 | |
---|
[e3aa355] | 59 | # |
---|
| 60 | # Prepare the source code. |
---|
| 61 | # |
---|
| 62 | %prep |
---|
[9a15c40] | 63 | source_dir_rtems="rtems-%{rtems_kernel_version}" |
---|
| 64 | %source setup rtems -q -c -n %{name}-%{version} |
---|
| 65 | cd ${source_dir_rtems} |
---|
| 66 | %patch setup rtems -p1 |
---|
[f077b2b] | 67 | %if %{rtems_bootstrap} |
---|
[ebf8a1f] | 68 | %if %{defined _internal_autotools_path} |
---|
| 69 | export PATH="%{_internal_autotools_path}/bin:${PATH}" |
---|
| 70 | %endif |
---|
[f077b2b] | 71 | ./bootstrap -c |
---|
[3ff992b] | 72 | %{_sbdir}/sb-bootstrap --preinstall |
---|
| 73 | %{_sbdir}/sb-bootstrap |
---|
[f077b2b] | 74 | %endif |
---|
[e3aa355] | 75 | cd .. |
---|
| 76 | |
---|
| 77 | %build |
---|
[f077b2b] | 78 | # Build directory support. |
---|
| 79 | if test "%{_build}" != "%{_host}" ; then |
---|
| 80 | build_dir="build-cxc" |
---|
| 81 | else |
---|
| 82 | build_dir="build" |
---|
| 83 | fi |
---|
| 84 | mkdir -p ${build_dir} |
---|
| 85 | cd ${build_dir} |
---|
| 86 | |
---|
[9a15c40] | 87 | ../${source_dir_rtems}/configure \ |
---|
[e3aa355] | 88 | --build=%{_build} --host=%{_host} \ |
---|
| 89 | --target=%{_target} \ |
---|
| 90 | %{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \ |
---|
| 91 | %{?rtems_networking:--enable-networking}%{!?rtems_networking:--disable-networking} \ |
---|
| 92 | %{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \ |
---|
| 93 | %{rtems_tests_opt} \ |
---|
[f077b2b] | 94 | %{?rtems_bsps:--enable-rtemsbsp=%{rtems_bsps}} \ |
---|
[e3aa355] | 95 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
| 96 | --exec-prefix=%{_exec_prefix} \ |
---|
| 97 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
| 98 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
| 99 | |
---|
| 100 | %{__make} %{?_smp_mflags} all |
---|
| 101 | cd .. |
---|
| 102 | |
---|
| 103 | %install |
---|
[f077b2b] | 104 | %{__rmdir} $SB_BUILD_ROOT |
---|
[e3aa355] | 105 | |
---|
[f077b2b] | 106 | cd ${build_dir} |
---|
[e3aa355] | 107 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
| 108 | |
---|
| 109 | cd .. |
---|
[f077b2b] | 110 | |
---|
| 111 | %testing |
---|