1 | #! /bin/sh |
---|
2 | # |
---|
3 | # RTEMS Tools Project (http://www.rtems.org/) |
---|
4 | # Copyright 2015-2016 Chris Johns (chrisj@rtems.org) |
---|
5 | # All rights reserved. |
---|
6 | # |
---|
7 | # This file is part of the RTEMS Tools package in 'rtems-tools'. |
---|
8 | # |
---|
9 | # Redistribution and use in source and binary forms, with or without |
---|
10 | # modification, are permitted provided that the following conditions are met: |
---|
11 | # |
---|
12 | # 1. Redistributions of source code must retain the above copyright notice, |
---|
13 | # this list of conditions and the following disclaimer. |
---|
14 | # |
---|
15 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
---|
16 | # this list of conditions and the following disclaimer in the documentation |
---|
17 | # and/or other materials provided with the distribution. |
---|
18 | # |
---|
19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
---|
23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
29 | # POSSIBILITY OF SUCH DAMAGE. |
---|
30 | # |
---|
31 | |
---|
32 | # |
---|
33 | # This worker script bootstraps the RTEMS kernel. |
---|
34 | # |
---|
35 | echo "RTEMS Release RTEMS Kernel, v0.1" |
---|
36 | |
---|
37 | # |
---|
38 | # Defaults. |
---|
39 | # |
---|
40 | . ${release_top}/rtems-release-defaults |
---|
41 | |
---|
42 | # |
---|
43 | # The package, version and revision. |
---|
44 | # |
---|
45 | if [ $# -ne 4 ]; then |
---|
46 | echo "error: must be arguments, the package, version," \ |
---|
47 | "release and the top directory." |
---|
48 | exit 1 |
---|
49 | fi |
---|
50 | package=$1 |
---|
51 | version=$2 |
---|
52 | revision=$3 |
---|
53 | toptop=$4 |
---|
54 | |
---|
55 | release=${version}.${revision} |
---|
56 | prefix=${package}-${release} |
---|
57 | |
---|
58 | echo "Package: ${package}" |
---|
59 | echo "Release: ${release}" |
---|
60 | |
---|
61 | # |
---|
62 | # Unpack the released RSB. |
---|
63 | # |
---|
64 | rsb=rtems-source-builder-${release} |
---|
65 | echo "tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}" |
---|
66 | tar ${comp_tar}xf ../${rsb}.tar.${comp_ext} |
---|
67 | |
---|
68 | # |
---|
69 | # Build autoconf and automake. |
---|
70 | # |
---|
71 | cd ${rsb}/rtems |
---|
72 | ../source-builder/sb-set-builder --without-release-url \ |
---|
73 | --prefix=${top}/at ${version}/rtems-autotools |
---|
74 | cd ../.. |
---|
75 | |
---|
76 | # |
---|
77 | # Set the path to the autotools. |
---|
78 | # |
---|
79 | export XPATH=$PATH |
---|
80 | export PATH=${top}/at/bin:$PATH |
---|
81 | |
---|
82 | # |
---|
83 | # Bootstrap RTEMS. |
---|
84 | # |
---|
85 | cd ${prefix} |
---|
86 | echo "Set the version in the build system.." |
---|
87 | for f in $(find . -name version.m4) |
---|
88 | do |
---|
89 | echo " Generating ${f}" |
---|
90 | cat <<EOF > ${f} |
---|
91 | dnl Autogenerated for RTEMS release: ${release} |
---|
92 | AC_DEFUN([RTEMS_VERSIONING], |
---|
93 | m4_define([_RTEMS_VERSION],[${release}])) |
---|
94 | dnl RTEMS API Version |
---|
95 | m4_define([_RTEMS_API],[${version}]) |
---|
96 | EOF |
---|
97 | done |
---|
98 | echo "Bootstrapping RTEMS" |
---|
99 | ./bootstrap -c |
---|
100 | ./bootstrap -p |
---|
101 | ${top}/${rsb}/source-builder/sb-bootstrap |
---|
102 | echo "Cleaning autom4te.cache" |
---|
103 | rm -rf $(find . -name autom4te.cache) |
---|
104 | echo "Generate ARCH-BSP.txt" |
---|
105 | ./rtems-bsps > ARCH-BSP.txt |
---|
106 | cp ARCH-BSP.txt ${toptop} |
---|
107 | cd .. |
---|
108 | |
---|
109 | # |
---|
110 | # Clean up. |
---|
111 | # |
---|
112 | rm -rf ${rsb} ${at} |
---|
113 | |
---|
114 | echo "Bootstrap complete." |
---|
115 | |
---|
116 | # |
---|
117 | # Only build doxygen output if present on the system. |
---|
118 | # |
---|
119 | if [ "`command -v doxygen`"no = no ]; then |
---|
120 | echo "warning: doxygen not built: doxygen not found" |
---|
121 | exit 0 |
---|
122 | fi |
---|
123 | |
---|
124 | # |
---|
125 | # Doxygen |
---|
126 | # |
---|
127 | echo "Creating: Doxyfile" |
---|
128 | top_srcdir=$(echo ${prefix}/cpukit | sed -e 's/\//\\\//g') |
---|
129 | perl=$(which perl | sed -e 's/\//\\\//g') |
---|
130 | cat ${prefix}/cpukit/Doxyfile.in | \ |
---|
131 | sed -e "s/@PACKAGE_VERSION@/${release}/g" \ |
---|
132 | -e "s/@top_srcdir@/${top_srcdir}/g" \ |
---|
133 | -e "s/@PERL@/${perl}/g" \ |
---|
134 | -e "s/^INPUT[[:space:]].*=.*$/INPUT = ${top_srcdir}/g" \ |
---|
135 | -e "s/^HAVE_DOT[[:blank:]]/DOT_NUM_THREADS = 1\\ |
---|
136 | HAVE_DOT /g"> Doxyfile |
---|
137 | doxygen Doxyfile |
---|
138 | |
---|
139 | echo "Creating: rtems-doxygen-${release}.tar.${comp_ext}" |
---|
140 | mv cpukit_doxy/html rtems-doxygen-${release} |
---|
141 | tar cf - rtems-doxygen-${release} | \ |
---|
142 | ${comp} > ../rtems-doxygen-${release}.tar.${comp_ext} |
---|
143 | |
---|
144 | exit 0 |
---|