#! /bin/sh # # Script to help build RTEMS Graphics Toolkit # # $Id$ # BASEDIR=`dirname $0` vfile=`dirname $0`/VERSIONS if [ ! -r ${vfile} ] ; then echo VERSIONS file not found exit 1 fi source ${vfile} if [ X${LIBJPEG} = X ] ; then echo VERSION FILE NOT CORRECT exit 1 fi ######################## Set defaults ############################# # Do we clean after build and install do_clean="no" # Do we build jpeg support? do_jpeg="no" # Do we build png support? do_png="no" # Do we build tiff support? do_tiff="no" # Do we build Adobe Type 1 Font support? do_t1="no" # Do we build Truetype Font support? do_ttf="no" # Do we build Microwindows/Nano-X support? do_nanox="no" # Do we build FLTK support? do_fltk="yes" # Are we noisy when running? verbose="no" ######################## Parse arguments ########################### usage() { cat <&2 exit 1 fi } toggle() { case $1 in no) echo "yes" ;; yes) echo "no" ;; *) fatal "Unknown value to toggle ($1)" ;; esac } while getopts Ajpt1Tnfcv OPT do case "$OPT" in A) do_jpeg="yes" do_png="yes" do_tiff="yes" do_t1="yes" do_ttf="yes" do_nanox="yes" ;; j) do_jpeg=`toggle ${do_jpeg}` ;; p) do_png=`toggle ${do_png}` ;; t) do_tiff=`toggle ${do_tiff}` ;; 1) do_t1=`toggle ${do_t1}` ;; T) do_ttf=`toggle ${do_ttf}` ;; n) do_nanox=`toggle ${do_nanox}` ;; f) do_fltk=`toggle ${do_fltk}` ;; c) do_clean=`toggle ${do_clean}` ;; v) verbose=`toggle ${verbose}` ;; *) fatal;; esac done shiftcount=`expr $OPTIND - 1` shift $shiftcount if [ ${verbose} = yes ] ; then echo "JPEG Library : " ${LIBJPEG} echo "Build JPEG Library : " ${do_jpeg} echo "PNG Library : " ${LIBPNG} echo "Build PNG Library : " ${do_png} echo "TIFF Library : " ${TIFFLIB} echo "Build TIFF Library : " ${do_tiff} echo "" echo "Build TrueType Font Library : " ${do_ttf} echo "TrueType Font Library : " ${FREETYPE} echo "Build Adobe Type 1 Font Library : " ${do_t1} echo "Adobe Type 1 Font Library : " ${T1LIB} echo "" echo "Build Microwindows/Nano-X : " ${do_nanox} echo "Microwindows/Nano-X Source : " ${NANOX} echo "" echo "Build FLTK : " ${do_fltk} echo "FLTK Source : " ${FLTK} echo "" echo "Clean after install : " ${do_clean} echo "" fi ######### START OF Consistency checks if [ X${RTEMS_MAKEFILE_PATH} = X ] ; then echo RTEMS_MAKEFILE_PATH not set exit 1 fi # XXX TBD check if enabled before checking if present? test -d ${LIBJPEG} check_status $? "${LIBJPEG} not present" test -d ${FREETYPE} check_status $? "${FREETYPE} not present" test -d ${LIBPNG} check_status $? "${LIBPNG} not present" test -d ${T1LIB} check_status $? "${T1LIB} not present" test -d ${TIFFLIB} check_status $? "${TIFFLIB} not present" test -d ${NANOX} check_status $? "${NANOX} not present" test -d ${RTEMS_MAKEFILE_PATH} check_status $? "${RTEMS_MAKEFILE_PATH} not present" ######### END OF Consistency checks echo "Generating RTEMS_SETTINGS file..." make -f Makefile.settings clean all check_status $? Could not generate RTEMS_SETTINGS source ./RTEMS_SETTINGS PREFIX=${BSPTOP} if [ ${verbose} = yes ] ; then echo "USING ${PREFIX} for install point!!!" fi case ${BSP} in pc386) ;; # can be used to turn on detect svgalib supportable on this BSP *) esac ######### Log Directory LOGDIR=${BASEDIR}/log if [ ! -d ${LOGDIR} ] ; then mkdir ${LOGDIR} fi ######### ######### Build and install JPEG j_jpeg() { cd ${LIBJPEG} CFLAGS="${CPU_CFLAGS}" \ ./configure --host=${TARGET} --prefix=${PREFIX} \ --includedir=${PREFIX}/lib/include \ --disable-shared \ --disable-programs check_status $? Could not configure ${LIBJPEG} make check_status $? Could not make ${LIBJPEG} make install check_status $? Could not make install ${LIBJPEG} if [ ${do_clean} = yes ] ; then make distclean check_status $? Could not make distclean ${LIBJPEG} fi cd .. } if [ ${do_jpeg} = yes ] ; then echo "Building ${LIBJPEG} ..." j_jpeg >${LOGDIR}/${TARGET}-${LIBJPEG}.log 2>&1 fi ######### Build and install PNG support j_png() { cd ${LIBPNG} CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ ./configure --host=${TARGET} --prefix=${PREFIX} \ --includedir=${PREFIX}/lib/include \ --disable-shared check_status $? Could not configure ${LIBPNG} make check_status $? Could not make ${LIBPNG} make install check_status $? Could not make install ${LIBPNG} if [ ${do_clean} = yes ] ; then make distclean check_status $? Could not make distclean ${LIBPNG} fi cd .. } if [ ${do_png} = yes ] ; then echo "Building ${LIBPNG} ..." j_png >${LOGDIR}/${TARGET}-${LIBPNG}.log 2>&1 fi ######### Build and install TIFF support j_tiff() { cd ${TIFFLIB} CFLAGS="${CPU_CFLAGS}" \ ./configure --host=${TARGET} --prefix=${PREFIX} \ --includedir=${PREFIX}/lib/include \ --disable-shared check_status $? Could not configure ${TIFFLIB} make check_status $? Could not make ${TIFFLIB} make install check_status $? Could not make install ${TIFFLIB} if [ ${do_clean} = yes ] ; then make distclean check_status $? Could not make distclean ${TIFFLIB} fi cd .. } if [ ${do_tiff} = yes ] ; then echo "Building ${TIFFLIB} ..." j_tiff >${LOGDIR}/${TARGET}-${TIFFLIB}.log 2>&1 fi ######### Build and install Adobe Type 1 Font support j_t1() { cd ${T1LIB} CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ ./configure --host=${TARGET} --prefix=${PREFIX} \ --includedir=${PREFIX}/lib/include \ --datadir=${PREFIX}/share \ --disable-shared \ --without-athena --without-x check_status $? Could not configure ${T1LIB} make check_status $? Could not make ${T1LIB} make install check_status $? Could not make install ${T1LIB} if [ ${do_clean} = yes ] ; then make distclean check_status $? Could not make distclean ${T1LIB} fi cd .. } if [ ${do_t1} = yes ] ; then echo "Building ${T1LIB}..." j_t1 >${LOGDIR}/${TARGET}-${T1LIB}.log 2>&1 fi ######### Build and install Truetype Font support j_ttf() { cd ${FREETYPE} CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ ./configure --host=${TARGET} --prefix=${PREFIX} \ --includedir=${PREFIX}/lib/include \ --disable-shared check_status $? Could not configure ${FREETYPE} make check_status $? Could not make ${FREETYPE} make install check_status $? Could not make install ${FREETYPE} if [ ${do_clean} = yes ] ; then make distclean check_status $? Could not make distclean ${FREETYPE} fi cd .. } if [ ${do_ttf} = yes ] ; then echo "Building ${FREETYPE} ..." j_ttf >${LOGDIR}/${TARGET}-${FREETYPE}.log 2>&1 fi ######### Build and install Nano-X support j_nanox() { cd ${NANOX}/src # RTEMS_MAKEFILE_PATH inherited export RTEMS_MAKEFILE_PATH make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems check_status $? Could not make ${NANOX} make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems install check_status $? Could not make install ${NANOX} if [ ${do_clean} = yes ] ; then make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems clean check_status $? Could not make distclean ${NANOX} fi cd ../.. } if [ ${do_nanox} = yes ] ; then echo "Building ${NANOX} ..." j_nanox >${LOGDIR}/${TARGET}-${NANOX}.log 2>&1 fi ######### Build and install FLTK support j_fltk() { cd ${FLTK} CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \ ./configure --host=${TARGET} --prefix=${PREFIX} \ --disable-shared check_status $? Could not configure ${FLTK} make check_status $? Could not make ${FLTK} make install check_status $? Could not make install ${FLTK} if [ ${do_clean} = yes ] ; then make distclean check_status $? Could not make distclean ${FLTK} fi cd .. } if [ ${do_fltk} = yes ] ; then echo "Building ${FLTK} ..." echo "SKIPPING ${FLTK} ..." # j_fltk >${LOGDIR}/${TARGET}-${FLTK}.log 2>&1 fi exit 0