Ticket #2168: 0003-do_it-Add-a-build-only-option.patch

File 0003-do_it-Add-a-build-only-option.patch, 5.5 KB (added by cynt6007, on 01/19/14 at 20:20:47)

Build only aoption with build only the default when not verbose

  • do_it

    From 0a215949870bbc7351a082185ea8a495c46e49ee Mon Sep 17 00:00:00 2001
    From: Chirayu Desai <cdesai@cyanogenmod.org>
    Date: Sat, 28 Dec 2013 21:52:08 +0530
    Subject: [PATCH 3/7] do_it: Add a build-only option
    
    * Allows building the libraries, and skipping installation
    ---
     do_it | 73 ++++++++++++++++++++++++++++++++++++++++++++++++-------------------
     1 file changed, 53 insertions(+), 20 deletions(-)
    
    diff --git a/do_it b/do_it
    index 3c1f060fcd..570b792f0d 100755
    a b use_sudo="no" 
    4747
    4848# Are we noisy when running?
    4949verbose="no"
     50
     51# Do we install what we built?
     52do_install=true
    5053######################## Parse arguments ###########################
    5154
    5255usage()
    usage() 
    5457cat <<EOF
    5558do_it [options]
    5659  -A - build and install all libraries
     60  -a - build all libraries
    5761  -j - build JPEG support (default=no)
    5862  -p - build PNG support (default=no)
    5963  -t - build TIFF support (default=no)
    do_it [options] 
    6367  -x - build Microwindows/Nano-X NXLib support (default=no)
    6468  -f - build FLTK support (default=no)
    6569  -c - clean after building (default=no)
     70  -b - build only, do not install libraries (default=no)
    6671  -s - use sudo for make install (default=no)
    6772  -v - verbose
    6873
    toggle() 
    98103  esac
    99104}
    100105
    101 while getopts Ajpt1Tnxfcsv OPT
     106while getopts Aajpt1Tnxfbcsv OPT
    102107do
    103108    case "$OPT" in
    104109      A) do_jpeg="yes"
    do 
    107112         do_t1="yes"
    108113         do_ttf="yes"
    109114         do_nanox="yes"
    110          do_nxlib="yes"
    111          do_fltk="yes"
     115         do_nxlib="yes"
     116         do_fltk="yes"
     117         ;;
     118      a) do_jpeg="yes"
     119         do_png="yes"
     120         do_tiff="yes"
     121         do_t1="yes"
     122         do_ttf="yes"
     123         do_nanox="yes"
     124         do_nxlib="yes"
     125         do_fltk="yes"
     126         do_install=false
    112127         ;;
    113128      j) do_jpeg=`toggle ${do_jpeg}` ;;
    114129      p) do_png=`toggle ${do_png}` ;;
    do 
    118133      n) do_nanox=`toggle ${do_nanox}` ;;
    119134      x) do_nxlib=`toggle ${do_nxlib}` ;;
    120135      f) do_fltk=`toggle ${do_fltk}` ;;
     136      b) do_install=false ;;
    121137      c) do_clean=`toggle ${do_clean}` ;;
    122138      s) use_sudo=`toggle ${use_sudo}` ;;
    123139      v) verbose=`toggle ${verbose}` ;;
    if [ ${verbose} = yes ] ; then 
    151167  echo "FLTK Source                     : " ${FLTK}
    152168  echo ""
    153169  echo "Clean after install             : " ${do_clean}
     170  echo "Install                         : " ${do_install}
    154171  echo ""
    155172fi
    156173
    source ./RTEMS_SETTINGS 
    212229
    213230PREFIX=${BSPTOP}
    214231
    215 if [ ${verbose} = yes ] ; then
     232if [ ${verbose} = yes ] && $do_install ; then
    216233  echo "USING ${PREFIX} for install point!!!"
    217234fi
    218235
    j_jpeg() 
    255272  make
    256273  check_status $? Could not make ${LIBJPEG}
    257274
    258   ${sudo_cmd}  make install
    259   check_status $? Could not make install ${LIBJPEG}
     275  if ${do_install} ; then
     276    ${sudo_cmd}  make install
     277    check_status $? Could not make install ${LIBJPEG}
     278  fi
    260279
    261280  if [ ${do_clean} = yes ] ; then
    262281    make distclean
    j_png() 
    291310  make
    292311  check_status $? Could not make ${LIBPNG}
    293312
    294   ${sudo_cmd}  make install
    295   check_status $? Could not make install ${LIBPNG}
     313  if ${do_install} ; then
     314    ${sudo_cmd}  make install
     315    check_status $? Could not make install ${LIBPNG}
     316  fi
    296317
    297318  if [ ${do_clean} = yes ] ; then
    298319    make distclean
    j_tiff() 
    326347  make
    327348  check_status $? Could not make ${TIFFLIB}
    328349
    329   ${sudo_cmd}  make install
    330   check_status $? Could not make install ${TIFFLIB}
     350  if ${do_install} ; then
     351    ${sudo_cmd}  make install
     352    check_status $? Could not make install ${TIFFLIB}
     353  fi
    331354
    332355  if [ ${do_clean} = yes ] ; then
    333356    make distclean
    j_t1() 
    365388  make without_doc
    366389  check_status $? Could not make ${T1LIB}
    367390
    368   ${sudo_cmd}  make install
    369   check_status $? Could not make install ${T1LIB}
     391  if ${do_install} ; then
     392    ${sudo_cmd}  make install
     393    check_status $? Could not make install ${T1LIB}
     394  fi
    370395
    371396  if [ ${do_clean} = yes ] ; then
    372397    make distclean
    j_ttf() 
    400425  make
    401426  check_status $? Could not make ${FREETYPE}
    402427
    403   ${sudo_cmd}  make install
    404   check_status $? Could not make install ${FREETYPE}
     428  if ${do_install} ; then
     429    ${sudo_cmd}  make install
     430    check_status $? Could not make install ${FREETYPE}
     431  fi
    405432
    406433  if [ ${do_clean} = yes ] ; then
    407434    make distclean
    j_nanox() 
    435462  make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems -k all
    436463  check_status $? Could not make ${NANOX}
    437464
    438   ${sudo_cmd}  make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems install
    439   check_status $? Could not make install ${NANOX}
     465  if ${do_install} ; then
     466    ${sudo_cmd}  make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems install
     467    check_status $? Could not make install ${NANOX}
     468  fi
    440469
    441470  if [ ${do_clean} = yes ] ; then
    442471    make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems clean
    j_nxlib() 
    473502  make -f Makefile.rtems
    474503  check_status $? Could not make ${NXLIB}
    475504
    476   ${sudo_cmd}  make -f Makefile.rtems install
    477   check_status $? Could not make install ${NXLIB}
     505  if ${do_install} ; then
     506    ${sudo_cmd}  make -f Makefile.rtems install
     507    check_status $? Could not make install ${NXLIB}
     508  fi
    478509
    479510  if [ ${do_clean} = yes ] ; then
    480511    make -f Makefile.rtems distclean
    j_fltk() 
    509540  make -k
    510541  check_status $? Could not make ${FLTK}
    511542
    512   ${sudo_cmd}  make install
    513   check_status $? Could not make install ${FLTK}
     543  if ${do_install} ; then
     544    ${sudo_cmd}  make install
     545    check_status $? Could not make install ${FLTK}
     546  fi
    514547
    515548  if [ ${do_clean} = yes ] ; then
    516549    make distclean