[67440a7] | 1 | #! /bin/sh |
---|
[8c14de8] | 2 | # |
---|
| 3 | # Script to help build RTEMS Graphics Toolkit |
---|
[c768d24] | 4 | # |
---|
| 5 | |
---|
[8c14de8] | 6 | BASEDIR=`dirname $0` |
---|
| 7 | |
---|
| 8 | vfile=`dirname $0`/VERSIONS |
---|
| 9 | if [ ! -r ${vfile} ] ; then |
---|
| 10 | echo VERSIONS file not found |
---|
| 11 | exit 1 |
---|
| 12 | fi |
---|
| 13 | |
---|
[67440a7] | 14 | . ./${vfile} |
---|
[8c14de8] | 15 | |
---|
| 16 | if [ X${LIBJPEG} = X ] ; then |
---|
| 17 | echo VERSION FILE NOT CORRECT |
---|
| 18 | exit 1 |
---|
| 19 | fi |
---|
| 20 | |
---|
| 21 | ######################## Set defaults ############################# |
---|
| 22 | # Do we clean after build and install |
---|
| 23 | do_clean="no" |
---|
| 24 | # Do we build jpeg support? |
---|
| 25 | do_jpeg="no" |
---|
| 26 | # Do we build png support? |
---|
| 27 | do_png="no" |
---|
| 28 | # Do we build tiff support? |
---|
| 29 | do_tiff="no" |
---|
| 30 | # Do we build Adobe Type 1 Font support? |
---|
| 31 | do_t1="no" |
---|
| 32 | # Do we build Truetype Font support? |
---|
| 33 | do_ttf="no" |
---|
[ce3c789] | 34 | |
---|
| 35 | # Do we build Microwindows/Nano-X support? |
---|
| 36 | do_nanox="no" |
---|
[f5c9e9c] | 37 | # Do we build Microwindows/Nano-X NXLib support? |
---|
| 38 | do_nxlib="no" |
---|
[06b61aa] | 39 | |
---|
| 40 | # Do we build FLTK support? |
---|
[f5c9e9c] | 41 | do_fltk="no" |
---|
[06b61aa] | 42 | |
---|
[ea5988b] | 43 | # Do we need sudo to install? |
---|
| 44 | use_sudo="no" |
---|
[06b61aa] | 45 | |
---|
[8c14de8] | 46 | # Are we noisy when running? |
---|
| 47 | verbose="no" |
---|
[0b5c029] | 48 | |
---|
| 49 | # Do we install what we built? |
---|
| 50 | do_install=true |
---|
[8c14de8] | 51 | ######################## Parse arguments ########################### |
---|
| 52 | |
---|
| 53 | usage() |
---|
[c768d24] | 54 | { |
---|
[8c14de8] | 55 | cat <<EOF |
---|
[a2cea51] | 56 | do_it [options] |
---|
[8c14de8] | 57 | -A - build and install all libraries |
---|
[0b5c029] | 58 | -a - build all libraries |
---|
[8c14de8] | 59 | -j - build JPEG support (default=no) |
---|
| 60 | -p - build PNG support (default=no) |
---|
| 61 | -t - build TIFF support (default=no) |
---|
| 62 | -1 - build Adobe Type 1 font support (default=no) |
---|
| 63 | -T - build Truetype font support (default=no) |
---|
[ce3c789] | 64 | -n - build Microwindows/Nano-X support (default=no) |
---|
[f5c9e9c] | 65 | -x - build Microwindows/Nano-X NXLib support (default=no) |
---|
[06b61aa] | 66 | -f - build FLTK support (default=no) |
---|
[8c14de8] | 67 | -c - clean after building (default=no) |
---|
[0b5c029] | 68 | -b - build only, do not install libraries (default=no) |
---|
[ea5988b] | 69 | -s - use sudo for make install (default=no) |
---|
[8c14de8] | 70 | -v - verbose |
---|
[c768d24] | 71 | |
---|
[8c14de8] | 72 | NOTES: |
---|
| 73 | + Use of each option toggles the setting. For example, \"-v -v -A -1\" |
---|
[d549f67] | 74 | results in verbose=no and all steps done except Type 1 fonts and build only. |
---|
[2102179] | 75 | + RTEMS_MAKEFILE_PATH must be set. |
---|
| 76 | + By default, nothing is built. |
---|
[8c14de8] | 77 | EOF |
---|
| 78 | } |
---|
[c768d24] | 79 | |
---|
[8c14de8] | 80 | fatal() |
---|
| 81 | { |
---|
| 82 | usage |
---|
| 83 | exit 1 |
---|
| 84 | } |
---|
[c768d24] | 85 | |
---|
| 86 | check_status() |
---|
| 87 | { |
---|
| 88 | if [ $1 -ne 0 ] ; then |
---|
[8c14de8] | 89 | shift |
---|
| 90 | echo "ERROR: $*" >&2 |
---|
[c768d24] | 91 | exit 1 |
---|
| 92 | fi |
---|
| 93 | } |
---|
| 94 | |
---|
[8c14de8] | 95 | toggle() |
---|
| 96 | { |
---|
| 97 | case $1 in |
---|
| 98 | no) echo "yes" ;; |
---|
| 99 | yes) echo "no" ;; |
---|
| 100 | *) fatal "Unknown value to toggle ($1)" ;; |
---|
| 101 | esac |
---|
| 102 | } |
---|
| 103 | |
---|
[0b5c029] | 104 | while getopts Aajpt1Tnxfbcsv OPT |
---|
[8c14de8] | 105 | do |
---|
| 106 | case "$OPT" in |
---|
| 107 | A) do_jpeg="yes" |
---|
| 108 | do_png="yes" |
---|
| 109 | do_tiff="yes" |
---|
| 110 | do_t1="yes" |
---|
| 111 | do_ttf="yes" |
---|
[ce3c789] | 112 | do_nanox="yes" |
---|
[0b5c029] | 113 | do_nxlib="yes" |
---|
| 114 | do_fltk="yes" |
---|
| 115 | ;; |
---|
| 116 | a) do_jpeg="yes" |
---|
| 117 | do_png="yes" |
---|
| 118 | do_tiff="yes" |
---|
| 119 | do_t1="yes" |
---|
| 120 | do_ttf="yes" |
---|
| 121 | do_nanox="yes" |
---|
| 122 | do_nxlib="yes" |
---|
| 123 | do_fltk="yes" |
---|
| 124 | do_install=false |
---|
[8c14de8] | 125 | ;; |
---|
| 126 | j) do_jpeg=`toggle ${do_jpeg}` ;; |
---|
| 127 | p) do_png=`toggle ${do_png}` ;; |
---|
| 128 | t) do_tiff=`toggle ${do_tiff}` ;; |
---|
| 129 | 1) do_t1=`toggle ${do_t1}` ;; |
---|
| 130 | T) do_ttf=`toggle ${do_ttf}` ;; |
---|
[ce3c789] | 131 | n) do_nanox=`toggle ${do_nanox}` ;; |
---|
[f5c9e9c] | 132 | x) do_nxlib=`toggle ${do_nxlib}` ;; |
---|
[06b61aa] | 133 | f) do_fltk=`toggle ${do_fltk}` ;; |
---|
[0b5c029] | 134 | b) do_install=false ;; |
---|
[8c14de8] | 135 | c) do_clean=`toggle ${do_clean}` ;; |
---|
[ea5988b] | 136 | s) use_sudo=`toggle ${use_sudo}` ;; |
---|
[8c14de8] | 137 | v) verbose=`toggle ${verbose}` ;; |
---|
| 138 | *) fatal;; |
---|
| 139 | esac |
---|
| 140 | done |
---|
[c768d24] | 141 | |
---|
[8c14de8] | 142 | shiftcount=`expr $OPTIND - 1` |
---|
| 143 | shift $shiftcount |
---|
| 144 | |
---|
| 145 | if [ ${verbose} = yes ] ; then |
---|
[ce3c789] | 146 | echo "JPEG Library : " ${LIBJPEG} |
---|
| 147 | echo "Build JPEG Library : " ${do_jpeg} |
---|
| 148 | echo "PNG Library : " ${LIBPNG} |
---|
| 149 | echo "Build PNG Library : " ${do_png} |
---|
| 150 | echo "TIFF Library : " ${TIFFLIB} |
---|
| 151 | echo "Build TIFF Library : " ${do_tiff} |
---|
| 152 | echo "" |
---|
| 153 | echo "Build TrueType Font Library : " ${do_ttf} |
---|
| 154 | echo "TrueType Font Library : " ${FREETYPE} |
---|
| 155 | echo "Build Adobe Type 1 Font Library : " ${do_t1} |
---|
| 156 | echo "Adobe Type 1 Font Library : " ${T1LIB} |
---|
[8c14de8] | 157 | echo "" |
---|
[ce3c789] | 158 | echo "Build Microwindows/Nano-X : " ${do_nanox} |
---|
| 159 | echo "Microwindows/Nano-X Source : " ${NANOX} |
---|
[06b61aa] | 160 | echo "" |
---|
[f5c9e9c] | 161 | echo "Build NXLib : " ${do_nxlib} |
---|
| 162 | echo "NXLib Source : " ${NXLIB} |
---|
| 163 | echo "" |
---|
[06b61aa] | 164 | echo "Build FLTK : " ${do_fltk} |
---|
| 165 | echo "FLTK Source : " ${FLTK} |
---|
| 166 | echo "" |
---|
[ce3c789] | 167 | echo "Clean after install : " ${do_clean} |
---|
[0b5c029] | 168 | echo "Install : " ${do_install} |
---|
[06b61aa] | 169 | echo "" |
---|
[c768d24] | 170 | fi |
---|
| 171 | |
---|
[ea5988b] | 172 | |
---|
| 173 | if [ ${use_sudo} = yes ] ; then |
---|
| 174 | sudo_cmd="sudo -E " |
---|
| 175 | else |
---|
| 176 | sudo_cmd="" |
---|
| 177 | fi |
---|
| 178 | |
---|
[35c1f65] | 179 | ######### START OF Consistency checks |
---|
| 180 | |
---|
| 181 | if [ X${RTEMS_MAKEFILE_PATH} = X ] ; then |
---|
| 182 | echo RTEMS_MAKEFILE_PATH not set |
---|
| 183 | exit 1 |
---|
| 184 | fi |
---|
| 185 | |
---|
[b1159fe] | 186 | # Check if enabled before checking if present |
---|
| 187 | if [ ${do_jpeg} = "yes" ] ; then |
---|
| 188 | test -d ${LIBJPEG} |
---|
| 189 | check_status $? "${LIBJPEG} not present" |
---|
| 190 | fi |
---|
| 191 | |
---|
| 192 | if [ ${do_ttf} = "yes" ] ; then |
---|
| 193 | test -d ${FREETYPE} |
---|
| 194 | check_status $? "${FREETYPE} not present" |
---|
| 195 | fi |
---|
| 196 | |
---|
| 197 | if [ ${do_png} = "yes" ] ; then |
---|
| 198 | test -d ${LIBPNG} |
---|
| 199 | check_status $? "${LIBPNG} not present" |
---|
| 200 | fi |
---|
| 201 | |
---|
| 202 | if [ ${do_t1} = "yes" ] ; then |
---|
| 203 | test -d ${T1LIB} |
---|
| 204 | check_status $? "${T1LIB} not present" |
---|
| 205 | fi |
---|
| 206 | |
---|
| 207 | if [ ${do_tiff} = "yes" ] ; then |
---|
| 208 | test -d ${TIFFLIB} |
---|
| 209 | check_status $? "${TIFFLIB} not present" |
---|
| 210 | fi |
---|
| 211 | |
---|
| 212 | if [ ${do_nanox} = "yes" ] ; then |
---|
| 213 | test -d ${NANOX} |
---|
| 214 | check_status $? "${NANOX} not present" |
---|
| 215 | fi |
---|
[8c14de8] | 216 | |
---|
| 217 | test -d ${RTEMS_MAKEFILE_PATH} |
---|
| 218 | check_status $? "${RTEMS_MAKEFILE_PATH} not present" |
---|
| 219 | |
---|
| 220 | ######### END OF Consistency checks |
---|
| 221 | |
---|
[e15c776] | 222 | echo "Generating RTEMS_SETTINGS file..." |
---|
| 223 | make -f Makefile.settings clean all |
---|
[c768d24] | 224 | check_status $? Could not generate RTEMS_SETTINGS |
---|
| 225 | |
---|
[b013cd2] | 226 | . ./RTEMS_SETTINGS |
---|
[c768d24] | 227 | |
---|
[e15c776] | 228 | PREFIX=${BSPTOP} |
---|
[c768d24] | 229 | |
---|
[0b5c029] | 230 | if [ ${verbose} = yes ] && $do_install ; then |
---|
[8c14de8] | 231 | echo "USING ${PREFIX} for install point!!!" |
---|
| 232 | fi |
---|
| 233 | |
---|
[35c1f65] | 234 | case ${BSP} in |
---|
| 235 | pc386) ;; # can be used to turn on detect svgalib supportable on this BSP |
---|
| 236 | *) |
---|
| 237 | esac |
---|
[8c14de8] | 238 | |
---|
| 239 | ######### Log Directory |
---|
| 240 | LOGDIR=${BASEDIR}/log |
---|
| 241 | if [ ! -d ${LOGDIR} ] ; then |
---|
| 242 | mkdir ${LOGDIR} |
---|
| 243 | fi |
---|
[2fcdef5] | 244 | ######### |
---|
| 245 | |
---|
| 246 | ######### Build Directory |
---|
| 247 | BUILDDIR=${BASEDIR}/build |
---|
| 248 | if [ ! -d ${BUILDDIR} ] ; then |
---|
| 249 | mkdir ${BUILDDIR} |
---|
| 250 | fi |
---|
| 251 | ######### |
---|
[c768d24] | 252 | |
---|
[8c14de8] | 253 | ######### Build and install JPEG |
---|
| 254 | j_jpeg() |
---|
[9aa7c17] | 255 | { |
---|
[2fcdef5] | 256 | if [ ! -d ${BUILDDIR}/${LIBJPEG} ] ; then |
---|
| 257 | mkdir ${BUILDDIR}/${LIBJPEG} |
---|
| 258 | fi |
---|
| 259 | cd ${BUILDDIR}/${LIBJPEG} |
---|
| 260 | |
---|
[b0e772a] | 261 | make distclean |
---|
[2fcdef5] | 262 | |
---|
[8c14de8] | 263 | CFLAGS="${CPU_CFLAGS}" \ |
---|
[2fcdef5] | 264 | ../../${LIBJPEG}/configure --host=${TARGET} --prefix=${PREFIX} \ |
---|
[8c14de8] | 265 | --includedir=${PREFIX}/lib/include \ |
---|
| 266 | --disable-shared \ |
---|
| 267 | --disable-programs |
---|
| 268 | check_status $? Could not configure ${LIBJPEG} |
---|
| 269 | |
---|
| 270 | make |
---|
| 271 | check_status $? Could not make ${LIBJPEG} |
---|
| 272 | |
---|
[0b5c029] | 273 | if ${do_install} ; then |
---|
| 274 | ${sudo_cmd} make install |
---|
| 275 | check_status $? Could not make install ${LIBJPEG} |
---|
| 276 | fi |
---|
[8c14de8] | 277 | |
---|
| 278 | if [ ${do_clean} = yes ] ; then |
---|
| 279 | make distclean |
---|
| 280 | check_status $? Could not make distclean ${LIBJPEG} |
---|
| 281 | fi |
---|
| 282 | |
---|
[2fcdef5] | 283 | cd ../.. |
---|
[9aa7c17] | 284 | } |
---|
| 285 | |
---|
[8c14de8] | 286 | if [ ${do_jpeg} = yes ] ; then |
---|
| 287 | echo "Building ${LIBJPEG} ..." |
---|
[b0e772a] | 288 | j_jpeg # >${LOGDIR}/${TARGET}-${LIBJPEG}.log 2>&1 |
---|
[8c14de8] | 289 | fi |
---|
| 290 | |
---|
| 291 | ######### Build and install PNG support |
---|
| 292 | j_png() |
---|
| 293 | { |
---|
[2fcdef5] | 294 | if [ ! -d ${BUILDDIR}/${LIBPNG} ] ; then |
---|
| 295 | mkdir ${BUILDDIR}/${LIBPNG} |
---|
| 296 | fi |
---|
| 297 | cd ${BUILDDIR}/${LIBPNG} |
---|
| 298 | |
---|
[b0e772a] | 299 | make distclean |
---|
[2fcdef5] | 300 | |
---|
[8c14de8] | 301 | CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ |
---|
[2fcdef5] | 302 | ../../${LIBPNG}/configure --host=${TARGET} --prefix=${PREFIX} \ |
---|
[8c14de8] | 303 | --includedir=${PREFIX}/lib/include \ |
---|
[660c951] | 304 | --libdir=${PREFIX}/lib \ |
---|
[8c14de8] | 305 | --disable-shared |
---|
| 306 | check_status $? Could not configure ${LIBPNG} |
---|
| 307 | |
---|
| 308 | make |
---|
| 309 | check_status $? Could not make ${LIBPNG} |
---|
| 310 | |
---|
[0b5c029] | 311 | if ${do_install} ; then |
---|
| 312 | ${sudo_cmd} make install |
---|
| 313 | check_status $? Could not make install ${LIBPNG} |
---|
| 314 | fi |
---|
[8c14de8] | 315 | |
---|
| 316 | if [ ${do_clean} = yes ] ; then |
---|
| 317 | make distclean |
---|
| 318 | check_status $? Could not make distclean ${LIBPNG} |
---|
| 319 | fi |
---|
| 320 | |
---|
[2fcdef5] | 321 | cd ../.. |
---|
[8c14de8] | 322 | } |
---|
| 323 | |
---|
| 324 | if [ ${do_png} = yes ] ; then |
---|
| 325 | echo "Building ${LIBPNG} ..." |
---|
[b0e772a] | 326 | j_png # >${LOGDIR}/${TARGET}-${LIBPNG}.log 2>&1 |
---|
[8c14de8] | 327 | fi |
---|
| 328 | |
---|
| 329 | ######### Build and install TIFF support |
---|
| 330 | j_tiff() |
---|
| 331 | { |
---|
[2fcdef5] | 332 | if [ ! -d ${BUILDDIR}/${TIFFLIB} ] ; then |
---|
| 333 | mkdir ${BUILDDIR}/${TIFFLIB} |
---|
| 334 | fi |
---|
| 335 | cd ${BUILDDIR}/${TIFFLIB} |
---|
| 336 | |
---|
[b0e772a] | 337 | make distclean |
---|
[2fcdef5] | 338 | |
---|
[8c14de8] | 339 | CFLAGS="${CPU_CFLAGS}" \ |
---|
[2fcdef5] | 340 | ../../${TIFFLIB}/configure --host=${TARGET} --prefix=${PREFIX} \ |
---|
[8c14de8] | 341 | --includedir=${PREFIX}/lib/include \ |
---|
| 342 | --disable-shared |
---|
| 343 | check_status $? Could not configure ${TIFFLIB} |
---|
| 344 | |
---|
| 345 | make |
---|
| 346 | check_status $? Could not make ${TIFFLIB} |
---|
| 347 | |
---|
[0b5c029] | 348 | if ${do_install} ; then |
---|
| 349 | ${sudo_cmd} make install |
---|
| 350 | check_status $? Could not make install ${TIFFLIB} |
---|
| 351 | fi |
---|
[8c14de8] | 352 | |
---|
| 353 | if [ ${do_clean} = yes ] ; then |
---|
| 354 | make distclean |
---|
| 355 | check_status $? Could not make distclean ${TIFFLIB} |
---|
| 356 | fi |
---|
| 357 | |
---|
[2fcdef5] | 358 | cd ../.. |
---|
[8c14de8] | 359 | } |
---|
| 360 | |
---|
| 361 | if [ ${do_tiff} = yes ] ; then |
---|
| 362 | echo "Building ${TIFFLIB} ..." |
---|
[b0e772a] | 363 | j_tiff # >${LOGDIR}/${TARGET}-${TIFFLIB}.log 2>&1 |
---|
[8c14de8] | 364 | fi |
---|
| 365 | |
---|
| 366 | ######### Build and install Adobe Type 1 Font support |
---|
| 367 | j_t1() |
---|
| 368 | { |
---|
[50d0849] | 369 | if [ ! -d ${BUILDDIR}/${T1LIB} ] ; then |
---|
| 370 | mkdir ${BUILDDIR}/${T1LIB} |
---|
| 371 | else |
---|
| 372 | rm -r ${BUILDDIR}/${T1LIB} |
---|
| 373 | mkdir ${BUILDDIR}/${T1LIB} |
---|
| 374 | fi |
---|
| 375 | cd ${BUILDDIR}/${T1LIB} |
---|
[2fcdef5] | 376 | |
---|
[50d0849] | 377 | cp -r ../../${T1LIB}/* . |
---|
[8c14de8] | 378 | CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ |
---|
[50d0849] | 379 | ../../${T1LIB}/configure --host=${TARGET} --prefix=${PREFIX} \ |
---|
[8c14de8] | 380 | --includedir=${PREFIX}/lib/include \ |
---|
| 381 | --datadir=${PREFIX}/share \ |
---|
| 382 | --disable-shared \ |
---|
| 383 | --without-athena --without-x |
---|
| 384 | check_status $? Could not configure ${T1LIB} |
---|
| 385 | |
---|
[b0e772a] | 386 | make without_doc |
---|
[8c14de8] | 387 | check_status $? Could not make ${T1LIB} |
---|
| 388 | |
---|
[0b5c029] | 389 | if ${do_install} ; then |
---|
| 390 | ${sudo_cmd} make install |
---|
| 391 | check_status $? Could not make install ${T1LIB} |
---|
| 392 | fi |
---|
[8c14de8] | 393 | |
---|
| 394 | if [ ${do_clean} = yes ] ; then |
---|
| 395 | make distclean |
---|
| 396 | check_status $? Could not make distclean ${T1LIB} |
---|
| 397 | fi |
---|
| 398 | |
---|
[50d0849] | 399 | cd ../.. |
---|
[8c14de8] | 400 | } |
---|
| 401 | |
---|
| 402 | if [ ${do_t1} = yes ] ; then |
---|
| 403 | echo "Building ${T1LIB}..." |
---|
[b0e772a] | 404 | j_t1 # >${LOGDIR}/${TARGET}-${T1LIB}.log 2>&1 |
---|
[8c14de8] | 405 | fi |
---|
| 406 | |
---|
| 407 | ######### Build and install Truetype Font support |
---|
| 408 | j_ttf() |
---|
| 409 | { |
---|
[2fcdef5] | 410 | if [ ! -d ${BUILDDIR}/${FREETYPE} ] ; then |
---|
| 411 | mkdir ${BUILDDIR}/${FREETYPE} |
---|
| 412 | fi |
---|
| 413 | cd ${BUILDDIR}/${FREETYPE} |
---|
| 414 | |
---|
[b0e772a] | 415 | make distclean |
---|
[2fcdef5] | 416 | |
---|
[8c14de8] | 417 | CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ |
---|
[2fcdef5] | 418 | ../../${FREETYPE}/configure --host=${TARGET} --prefix=${PREFIX} \ |
---|
[8c14de8] | 419 | --includedir=${PREFIX}/lib/include \ |
---|
| 420 | --disable-shared |
---|
| 421 | check_status $? Could not configure ${FREETYPE} |
---|
| 422 | |
---|
| 423 | make |
---|
| 424 | check_status $? Could not make ${FREETYPE} |
---|
| 425 | |
---|
[0b5c029] | 426 | if ${do_install} ; then |
---|
| 427 | ${sudo_cmd} make install |
---|
| 428 | check_status $? Could not make install ${FREETYPE} |
---|
| 429 | fi |
---|
[8c14de8] | 430 | |
---|
| 431 | if [ ${do_clean} = yes ] ; then |
---|
| 432 | make distclean |
---|
| 433 | check_status $? Could not make distclean ${FREETYPE} |
---|
| 434 | fi |
---|
| 435 | |
---|
[2fcdef5] | 436 | cd ../.. |
---|
[8c14de8] | 437 | } |
---|
| 438 | |
---|
| 439 | if [ ${do_ttf} = yes ] ; then |
---|
| 440 | echo "Building ${FREETYPE} ..." |
---|
[b0e772a] | 441 | j_ttf # >${LOGDIR}/${TARGET}-${FREETYPE}.log 2>&1 |
---|
[8c14de8] | 442 | fi |
---|
[9aa7c17] | 443 | |
---|
[ce3c789] | 444 | ######### Build and install Nano-X support |
---|
| 445 | j_nanox() |
---|
| 446 | { |
---|
[7590de5] | 447 | if [ ! -d ${BUILDDIR}/${NANOX}/src ] ; then |
---|
[8882c04] | 448 | mkdir -p ${BUILDDIR}/${NANOX}/src |
---|
[50d0849] | 449 | else |
---|
[7590de5] | 450 | rm -r ${BUILDDIR}/${NANOX}/src |
---|
[8882c04] | 451 | mkdir -p ${BUILDDIR}/${NANOX}/src |
---|
[50d0849] | 452 | fi |
---|
[7590de5] | 453 | cd ${BUILDDIR}/${NANOX}/src |
---|
[50d0849] | 454 | |
---|
[7590de5] | 455 | cp -r ../../../${NANOX}/src/* . |
---|
[ce3c789] | 456 | |
---|
| 457 | # RTEMS_MAKEFILE_PATH inherited |
---|
| 458 | export RTEMS_MAKEFILE_PATH |
---|
| 459 | |
---|
[b0e772a] | 460 | make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems -k all |
---|
[ce3c789] | 461 | check_status $? Could not make ${NANOX} |
---|
| 462 | |
---|
[0b5c029] | 463 | if ${do_install} ; then |
---|
| 464 | ${sudo_cmd} make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems install |
---|
| 465 | check_status $? Could not make install ${NANOX} |
---|
| 466 | fi |
---|
[ce3c789] | 467 | |
---|
| 468 | if [ ${do_clean} = yes ] ; then |
---|
| 469 | make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems clean |
---|
| 470 | check_status $? Could not make distclean ${NANOX} |
---|
| 471 | fi |
---|
| 472 | |
---|
[7590de5] | 473 | cd ../../.. |
---|
[ce3c789] | 474 | } |
---|
| 475 | |
---|
| 476 | if [ ${do_nanox} = yes ] ; then |
---|
| 477 | echo "Building ${NANOX} ..." |
---|
[b0e772a] | 478 | j_nanox # >${LOGDIR}/${TARGET}-${NANOX}.log 2>&1 |
---|
[ce3c789] | 479 | fi |
---|
| 480 | |
---|
[f5c9e9c] | 481 | |
---|
| 482 | ######### Build and install NXLIB support |
---|
| 483 | j_nxlib() |
---|
| 484 | { |
---|
[50d0849] | 485 | if [ ! -d ${BUILDDIR}/${NXLIB} ] ; then |
---|
| 486 | mkdir ${BUILDDIR}/${NXLIB} |
---|
| 487 | else |
---|
| 488 | rm -r ${BUILDDIR}/${NXLIB} |
---|
| 489 | mkdir ${BUILDDIR}/${NXLIB} |
---|
| 490 | fi |
---|
| 491 | cd ${BUILDDIR}/${NXLIB} |
---|
| 492 | |
---|
| 493 | cp -r ../../${NXLIB}/* . |
---|
[f5c9e9c] | 494 | |
---|
| 495 | # RTEMS_MAKEFILE_PATH inherited |
---|
| 496 | export RTEMS_MAKEFILE_PATH |
---|
| 497 | |
---|
[b0e772a] | 498 | make -f Makefile.rtems distclean |
---|
| 499 | |
---|
[f5c9e9c] | 500 | make -f Makefile.rtems |
---|
| 501 | check_status $? Could not make ${NXLIB} |
---|
| 502 | |
---|
[0b5c029] | 503 | if ${do_install} ; then |
---|
| 504 | ${sudo_cmd} make -f Makefile.rtems install |
---|
| 505 | check_status $? Could not make install ${NXLIB} |
---|
| 506 | fi |
---|
[f5c9e9c] | 507 | |
---|
| 508 | if [ ${do_clean} = yes ] ; then |
---|
[b0e772a] | 509 | make -f Makefile.rtems distclean |
---|
[f5c9e9c] | 510 | check_status $? Could not make distclean ${NXLIB} |
---|
| 511 | fi |
---|
| 512 | |
---|
[50d0849] | 513 | cd ../.. |
---|
[f5c9e9c] | 514 | } |
---|
| 515 | |
---|
| 516 | if [ ${do_nxlib} = yes ] ; then |
---|
| 517 | echo "Building ${NXLIB} ..." |
---|
[b0e772a] | 518 | j_nxlib # >${LOGDIR}/${TARGET}-${NXLIB}.log 2>&1 |
---|
[f5c9e9c] | 519 | fi |
---|
| 520 | |
---|
| 521 | |
---|
[06b61aa] | 522 | ######### Build and install FLTK support |
---|
| 523 | j_fltk() |
---|
| 524 | { |
---|
[7590de5] | 525 | if [ ! -d ${BUILDDIR}/${FLTK} ] ; then |
---|
| 526 | mkdir ${BUILDDIR}/${FLTK} |
---|
| 527 | else |
---|
| 528 | rm -r ${BUILDDIR}/${FLTK} |
---|
| 529 | mkdir ${BUILDDIR}/${FLTK} |
---|
| 530 | fi |
---|
| 531 | cd ${BUILDDIR}/${FLTK} |
---|
| 532 | |
---|
| 533 | cp -r ../../${FLTK}/* . |
---|
[2fcdef5] | 534 | |
---|
[b0e772a] | 535 | make distclean |
---|
[2fcdef5] | 536 | |
---|
[06b61aa] | 537 | CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ |
---|
[7590de5] | 538 | ../../${FLTK}/configure --host=${TARGET} --prefix=${PREFIX} \ |
---|
[b0e772a] | 539 | --includedir="${BSPTOP}/lib/include" --libdir="${BSPTOP}/lib"\ |
---|
| 540 | --x-includes="${BSPTOP}/lib/include" --x-libraries="${BSPTOP}/lib" \ |
---|
| 541 | --disable-xft --disable-xinerama --disable-xdbe \ |
---|
| 542 | --disable-shared --disable-gl |
---|
| 543 | |
---|
[06b61aa] | 544 | check_status $? Could not configure ${FLTK} |
---|
| 545 | |
---|
[0d32a9c] | 546 | make -k |
---|
[06b61aa] | 547 | check_status $? Could not make ${FLTK} |
---|
| 548 | |
---|
[0b5c029] | 549 | if ${do_install} ; then |
---|
| 550 | ${sudo_cmd} make install |
---|
| 551 | check_status $? Could not make install ${FLTK} |
---|
| 552 | fi |
---|
[06b61aa] | 553 | |
---|
| 554 | if [ ${do_clean} = yes ] ; then |
---|
| 555 | make distclean |
---|
| 556 | check_status $? Could not make distclean ${FLTK} |
---|
| 557 | fi |
---|
| 558 | |
---|
| 559 | cd .. |
---|
| 560 | } |
---|
| 561 | |
---|
| 562 | if [ ${do_fltk} = yes ] ; then |
---|
| 563 | echo "Building ${FLTK} ..." |
---|
[40097d7] | 564 | j_fltk # >${LOGDIR}/${TARGET}-${FLTK}.log 2>&1 |
---|
[06b61aa] | 565 | fi |
---|
| 566 | |
---|
[c768d24] | 567 | exit 0 |
---|