Changeset 8c14de8 in rtems-graphics-toolkit
- Timestamp:
- 01/08/10 18:53:10 (13 years ago)
- Branches:
- master
- Children:
- 35c1f65
- Parents:
- 504de3c
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r504de3c r8c14de8 1 2010-01-08 Joel Sherrill <joel.sherrill@oarcorp.com> 2 3 * do_it: Complete rewrite. 4 * VERSIONS: New file. 5 1 6 2009-12-27 Joel Sherrill <joel.sherrill@oarcorp.com> 2 7 -
do_it
r504de3c r8c14de8 1 #! /bin/sh 1 #! /bin/sh 2 # 3 # Script to help build RTEMS Graphics Toolkit 2 4 # 3 5 # $Id$ 4 6 # 5 7 6 test_exit() 7 { 8 exit_code=$1 9 exit $exit_code 10 } 11 12 progname=${0##*/} # fast basename hack for ksh, bash 13 14 USAGE=\ 15 "usage: $progname [ -opts ] test [ test ... ] 16 " 17 18 check_status() 19 { 20 if [ $1 -ne 0 ] ; then 21 shift 22 echo "FAILED: " "$*" >&2 23 exit 1 24 fi 25 } 26 8 BASEDIR=`dirname $0` 9 10 vfile=`dirname $0`/VERSIONS 11 if [ ! -r ${vfile} ] ; then 12 echo VERSIONS file not found 13 exit 1 14 fi 27 15 28 16 if [ X${RTEMS_MAKEFILE_PATH} = X ] ; then … … 31 19 fi 32 20 21 source ${vfile} 22 23 if [ X${LIBJPEG} = X ] ; then 24 echo VERSION FILE NOT CORRECT 25 exit 1 26 fi 27 28 ######################## Set defaults ############################# 29 # Do we clean after build and install 30 do_clean="no" 31 # Do we build jpeg support? 32 do_jpeg="no" 33 # Do we build png support? 34 do_png="no" 35 # Do we build tiff support? 36 do_tiff="no" 37 # Do we build Adobe Type 1 Font support? 38 do_t1="no" 39 # Do we build Truetype Font support? 40 do_ttf="no" 41 # Are we noisy when running? 42 verbose="no" 43 ######################## Parse arguments ########################### 44 45 usage() 46 { 47 cat <<EOF 48 do_one [options] CPU BSP 49 -A - build and install all libraries 50 -j - build JPEG support (default=no) 51 -p - build PNG support (default=no) 52 -t - build TIFF support (default=no) 53 -1 - build Adobe Type 1 font support (default=no) 54 -T - build Truetype font support (default=no) 55 -c - clean after building (default=no) 56 -v - verbose 57 58 NOTES: 59 + Use of each option toggles the setting. For example, \"-v -v -A -1\" 60 results in verbose=no and all steps done except Type 1 fonts. 61 EOF 62 } 63 64 fatal() 65 { 66 usage 67 exit 1 68 } 69 70 check_status() 71 { 72 if [ $1 -ne 0 ] ; then 73 shift 74 echo "ERROR: $*" >&2 75 exit 1 76 fi 77 } 78 79 toggle() 80 { 81 case $1 in 82 no) echo "yes" ;; 83 yes) echo "no" ;; 84 *) fatal "Unknown value to toggle ($1)" ;; 85 esac 86 } 87 88 while getopts Ajpt1Tv OPT 89 do 90 case "$OPT" in 91 A) do_jpeg="yes" 92 do_png="yes" 93 do_tiff="yes" 94 do_t1="yes" 95 do_ttf="yes" 96 ;; 97 j) do_jpeg=`toggle ${do_jpeg}` ;; 98 p) do_png=`toggle ${do_png}` ;; 99 t) do_tiff=`toggle ${do_tiff}` ;; 100 1) do_t1=`toggle ${do_t1}` ;; 101 T) do_ttf=`toggle ${do_ttf}` ;; 102 c) do_clean=`toggle ${do_clean}` ;; 103 v) verbose=`toggle ${verbose}` ;; 104 *) fatal;; 105 esac 106 done 107 108 ########################### Grab CPU/BSP ########################### 109 110 shiftcount=`expr $OPTIND - 1` 111 shift $shiftcount 112 113 cpu=${1} 114 bsp=${2} 115 116 case ${cpu} in 117 m32c) 118 do_ada=no 119 do_cxx=no 120 run_acats=no 121 echo M32C does not support C++ or Ada 122 ;; 123 *);; 124 esac 125 126 if [ ${verbose} = yes ] ; then 127 echo "JPEG Library : " ${LIBJPEG} 128 echo "Build JPEG Library : " ${do_jpeg} 129 echo "PNG Library : " ${LIBPNG} 130 echo "Build PNG Library : " ${do_png} 131 echo "TIFF Library : " ${TIFFLIB} 132 echo "Build TIFF Library : " ${do_tiff} 133 echo "" 134 echo "Build TrueType Font Library : " ${do_ttf} 135 echo "TrueType Font Library : " ${FREETYPE} 136 echo "Adobe Type 1 Font Library : " ${T1LIB} 137 echo "JPEG Library : " ${do_t1} 138 echo "Clean after instal : " ${do_clean} 139 fi 140 141 test -d ${LIBJPEG} 142 check_status $? "${LIBJPEG} not present" 143 test -d ${FREETYPE} 144 check_status $? "${FREETYPE} not present" 145 test -d ${LIBPNG} 146 check_status $? "${LIBPNG} not present" 147 test -d ${T1LIB} 148 check_status $? "${T1LIB} not present" 149 test -d ${TIFFLIB} 150 check_status $? "${TIFFLIB} not present" 151 152 test -d ${RTEMS_MAKEFILE_PATH} 153 check_status $? "${RTEMS_MAKEFILE_PATH} not present" 154 155 ######### END OF Consistency checks 156 33 157 echo "Generating RTEMS_SETTINGS file..." 34 158 make -f Makefile.settings clean all … … 39 163 PREFIX=${BSPTOP} 40 164 41 echo WARNING USING ${PREFIX} for install point!!! 42 43 do_step() 44 { 45 case $1 in 46 rmlogs) 47 rm -f */build.log */c.log */clean.log */distclean.log */install.log 48 ;; 49 configure) 50 echo "configuring jpeg-7 ..." 51 cd jpeg-7 52 CFLAGS="${CPU_CFLAGS}" \ 53 ./configure --host=${TARGET} --prefix=${PREFIX} \ 54 --includedir=${PREFIX}/lib/include \ 55 --disable-shared \ 56 --disable-programs \ 57 >c.log 2>&1 58 check_status $? Could not configure jpeg-7 59 60 cd ../tiff-3.9.2 61 check_status $? Could not cd to tiff-3.9.2 62 63 echo "configuring tiff-3.9.2 ..." 64 CFLAGS="${CPU_CFLAGS}" \ 65 ./configure --host=${TARGET} --prefix=${PREFIX} \ 66 --includedir=${PREFIX}/lib/include \ 67 --disable-shared \ 68 >c.log 2>&1 69 check_status $? Could not configure tiff-3.9.2 70 71 cd ../libpng-1.2.41 72 echo "configuring libpng-1.2.41 ..." 73 # include BSP_CFLAGS so it sees libz 74 CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ 75 ./configure --host=${TARGET} --prefix=${PREFIX} \ 76 --includedir=${PREFIX}/lib/include \ 77 --disable-shared \ 78 >c.log 2>&1 79 check_status $? Could not configure libpng-1.2.41 80 81 cd ../freetype-2.3.11 82 echo "configuring freetype-2.3.11 ..." 83 # include BSP_CFLAGS so it sees libz 84 CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ 85 ./configure --host=${TARGET} --prefix=${PREFIX} \ 86 --includedir=${PREFIX}/lib/include \ 87 --disable-shared \ 88 >c.log 2>&1 89 check_status $? Could not configure freetype-2.3.11 90 91 cd ../t1lib-5.1.2 92 echo "configuring t1lib-5.1.2 ..." 93 # include BSP_CFLAGS so it sees libz 94 CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ 95 ./configure --host=${TARGET} --prefix=${PREFIX} \ 96 --includedir=${PREFIX}/lib/include \ 97 --datadir=${PREFIX}/share \ 98 --disable-shared \ 99 --without-athena --without-x \ 100 >c.log 2>&1 101 check_status $? Could not configure t1lib-5.1.2 102 103 cd .. 104 ;; 105 build|clean|distclean|install) 106 action=${1} 107 if [ ${1} = build ] ; then 108 action= 109 fi 110 111 for d in jpeg-7 tiff-3.9.2 libpng-1.2.41 freetype-2.3.11 t1lib-5.1.2 112 do 113 echo "Performing ${1} on ${d} ..." 114 115 cd ${d} 116 check_status $? Could not cd to ${d} 117 make ${action} >${1}.log 2>&1 118 119 if [ ${1} != distclean ] ; then 120 check_status $? Could not ${1} in ${d} 121 fi 122 #if [ ${1} = distclean ] ; then 123 # rm -f build.log c.log clean.log distclean.log 124 #fi 125 cd .. 126 done 127 128 echo "Performing ${1} on rtems-nano-x ..." 129 case $1 in 130 build|clean|install) 131 #cd rtems-nano-x 132 #make -C microwin/src -f Makefile.rtems ${action} 133 #check_status $? Could not ${1} in rtems-nano-x 134 #cd .. 135 ;; 136 *) 137 ;; 138 esac 139 ;; 140 *) 141 check_status 1 Unknown action ${1} 142 ;; 143 esac 144 } 145 146 for a in $* 147 do 148 do_step ${a} 149 done 165 if [ ${verbose} = yes ] ; then 166 echo "USING ${PREFIX} for install point!!!" 167 fi 168 169 170 ######### Log Directory 171 LOGDIR=${BASEDIR}/log 172 if [ ! -d ${LOGDIR} ] ; then 173 mkdir ${LOGDIR} 174 fi 175 ######### 176 177 ######### Build and install JPEG 178 j_jpeg() 179 { 180 cd ${LIBJPEG} 181 CFLAGS="${CPU_CFLAGS}" \ 182 ./configure --host=${TARGET} --prefix=${PREFIX} \ 183 --includedir=${PREFIX}/lib/include \ 184 --disable-shared \ 185 --disable-programs 186 check_status $? Could not configure ${LIBJPEG} 187 188 make 189 check_status $? Could not make ${LIBJPEG} 190 191 make install 192 check_status $? Could not make isntall ${LIBJPEG} 193 194 if [ ${do_clean} = yes ] ; then 195 make distclean 196 check_status $? Could not make distclean ${LIBJPEG} 197 fi 198 199 cd .. 200 } 201 202 if [ ${do_jpeg} = yes ] ; then 203 echo "Building ${LIBJPEG} ..." 204 j_jpeg >${LOGDIR}/${TARGET}-${LIBJPEG}.log 2>&1 205 fi 206 207 ######### Build and install PNG support 208 j_png() 209 { 210 cd ${LIBPNG} 211 CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ 212 ./configure --host=${TARGET} --prefix=${PREFIX} \ 213 --includedir=${PREFIX}/lib/include \ 214 --disable-shared 215 check_status $? Could not configure ${LIBPNG} 216 217 make 218 check_status $? Could not make ${LIBPNG} 219 220 make install 221 check_status $? Could not make isntall ${LIBPNG} 222 223 if [ ${do_clean} = yes ] ; then 224 make distclean 225 check_status $? Could not make distclean ${LIBPNG} 226 fi 227 228 cd .. 229 } 230 231 if [ ${do_png} = yes ] ; then 232 echo "Building ${LIBPNG} ..." 233 j_png >${LOGDIR}/${TARGET}-${LIBPNG}.log 2>&1 234 fi 235 236 ######### Build and install TIFF support 237 j_tiff() 238 { 239 cd ${TIFFLIB} 240 CFLAGS="${CPU_CFLAGS}" \ 241 ./configure --host=${TARGET} --prefix=${PREFIX} \ 242 --includedir=${PREFIX}/lib/include \ 243 --disable-shared 244 check_status $? Could not configure ${TIFFLIB} 245 246 make 247 check_status $? Could not make ${TIFFLIB} 248 249 make install 250 check_status $? Could not make isntall ${TIFFLIB} 251 252 if [ ${do_clean} = yes ] ; then 253 make distclean 254 check_status $? Could not make distclean ${TIFFLIB} 255 fi 256 257 cd .. 258 } 259 260 if [ ${do_tiff} = yes ] ; then 261 echo "Building ${TIFFLIB} ..." 262 j_tiff >${LOGDIR}/${TARGET}-${TIFFLIB}.log 2>&1 263 fi 264 265 ######### Build and install Adobe Type 1 Font support 266 j_t1() 267 { 268 cd ${T1LIB} 269 CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ 270 ./configure --host=${TARGET} --prefix=${PREFIX} \ 271 --includedir=${PREFIX}/lib/include \ 272 --datadir=${PREFIX}/share \ 273 --disable-shared \ 274 --without-athena --without-x 275 check_status $? Could not configure ${T1LIB} 276 277 make 278 check_status $? Could not make ${T1LIB} 279 280 make install 281 check_status $? Could not make isntall ${T1LIB} 282 283 if [ ${do_clean} = yes ] ; then 284 make distclean 285 check_status $? Could not make distclean ${T1LIB} 286 fi 287 288 cd .. 289 } 290 291 if [ ${do_t1} = yes ] ; then 292 echo "Building ${T1LIB}..." 293 j_t1 >${LOGDIR}/${TARGET}-${T1LIB}.log 2>&1 294 fi 295 296 ######### Build and install Truetype Font support 297 j_ttf() 298 { 299 cd ${FREETYPE} 300 CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ 301 ./configure --host=${TARGET} --prefix=${PREFIX} \ 302 --includedir=${PREFIX}/lib/include \ 303 --disable-shared 304 check_status $? Could not configure ${FREETYPE} 305 306 make 307 check_status $? Could not make ${FREETYPE} 308 309 make install 310 check_status $? Could not make isntall ${FREETYPE} 311 312 if [ ${do_clean} = yes ] ; then 313 make distclean 314 check_status $? Could not make distclean ${FREETYPE} 315 fi 316 317 cd .. 318 } 319 320 if [ ${do_ttf} = yes ] ; then 321 echo "Building ${FREETYPE} ..." 322 j_ttf >${LOGDIR}/${TARGET}-${FREETYPE}.log 2>&1 323 fi 150 324 151 325 exit 0
Note: See TracChangeset
for help on using the changeset viewer.