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" |
47 | 47 | |
48 | 48 | # Are we noisy when running? |
49 | 49 | verbose="no" |
| 50 | |
| 51 | # Do we install what we built? |
| 52 | do_install=true |
50 | 53 | ######################## Parse arguments ########################### |
51 | 54 | |
52 | 55 | usage() |
… |
… |
usage() |
54 | 57 | cat <<EOF |
55 | 58 | do_it [options] |
56 | 59 | -A - build and install all libraries |
| 60 | -a - build all libraries |
57 | 61 | -j - build JPEG support (default=no) |
58 | 62 | -p - build PNG support (default=no) |
59 | 63 | -t - build TIFF support (default=no) |
… |
… |
do_it [options] |
63 | 67 | -x - build Microwindows/Nano-X NXLib support (default=no) |
64 | 68 | -f - build FLTK support (default=no) |
65 | 69 | -c - clean after building (default=no) |
| 70 | -b - build only, do not install libraries (default=no) |
66 | 71 | -s - use sudo for make install (default=no) |
67 | 72 | -v - verbose |
68 | 73 | |
… |
… |
toggle() |
98 | 103 | esac |
99 | 104 | } |
100 | 105 | |
101 | | while getopts Ajpt1Tnxfcsv OPT |
| 106 | while getopts Aajpt1Tnxfbcsv OPT |
102 | 107 | do |
103 | 108 | case "$OPT" in |
104 | 109 | A) do_jpeg="yes" |
… |
… |
do |
107 | 112 | do_t1="yes" |
108 | 113 | do_ttf="yes" |
109 | 114 | 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 |
112 | 127 | ;; |
113 | 128 | j) do_jpeg=`toggle ${do_jpeg}` ;; |
114 | 129 | p) do_png=`toggle ${do_png}` ;; |
… |
… |
do |
118 | 133 | n) do_nanox=`toggle ${do_nanox}` ;; |
119 | 134 | x) do_nxlib=`toggle ${do_nxlib}` ;; |
120 | 135 | f) do_fltk=`toggle ${do_fltk}` ;; |
| 136 | b) do_install=false ;; |
121 | 137 | c) do_clean=`toggle ${do_clean}` ;; |
122 | 138 | s) use_sudo=`toggle ${use_sudo}` ;; |
123 | 139 | v) verbose=`toggle ${verbose}` ;; |
… |
… |
if [ ${verbose} = yes ] ; then |
151 | 167 | echo "FLTK Source : " ${FLTK} |
152 | 168 | echo "" |
153 | 169 | echo "Clean after install : " ${do_clean} |
| 170 | echo "Install : " ${do_install} |
154 | 171 | echo "" |
155 | 172 | fi |
156 | 173 | |
… |
… |
source ./RTEMS_SETTINGS |
212 | 229 | |
213 | 230 | PREFIX=${BSPTOP} |
214 | 231 | |
215 | | if [ ${verbose} = yes ] ; then |
| 232 | if [ ${verbose} = yes ] && $do_install ; then |
216 | 233 | echo "USING ${PREFIX} for install point!!!" |
217 | 234 | fi |
218 | 235 | |
… |
… |
j_jpeg() |
255 | 272 | make |
256 | 273 | check_status $? Could not make ${LIBJPEG} |
257 | 274 | |
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 |
260 | 279 | |
261 | 280 | if [ ${do_clean} = yes ] ; then |
262 | 281 | make distclean |
… |
… |
j_png() |
291 | 310 | make |
292 | 311 | check_status $? Could not make ${LIBPNG} |
293 | 312 | |
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 |
296 | 317 | |
297 | 318 | if [ ${do_clean} = yes ] ; then |
298 | 319 | make distclean |
… |
… |
j_tiff() |
326 | 347 | make |
327 | 348 | check_status $? Could not make ${TIFFLIB} |
328 | 349 | |
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 |
331 | 354 | |
332 | 355 | if [ ${do_clean} = yes ] ; then |
333 | 356 | make distclean |
… |
… |
j_t1() |
365 | 388 | make without_doc |
366 | 389 | check_status $? Could not make ${T1LIB} |
367 | 390 | |
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 |
370 | 395 | |
371 | 396 | if [ ${do_clean} = yes ] ; then |
372 | 397 | make distclean |
… |
… |
j_ttf() |
400 | 425 | make |
401 | 426 | check_status $? Could not make ${FREETYPE} |
402 | 427 | |
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 |
405 | 432 | |
406 | 433 | if [ ${do_clean} = yes ] ; then |
407 | 434 | make distclean |
… |
… |
j_nanox() |
435 | 462 | make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems -k all |
436 | 463 | check_status $? Could not make ${NANOX} |
437 | 464 | |
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 |
440 | 469 | |
441 | 470 | if [ ${do_clean} = yes ] ; then |
442 | 471 | make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems clean |
… |
… |
j_nxlib() |
473 | 502 | make -f Makefile.rtems |
474 | 503 | check_status $? Could not make ${NXLIB} |
475 | 504 | |
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 |
478 | 509 | |
479 | 510 | if [ ${do_clean} = yes ] ; then |
480 | 511 | make -f Makefile.rtems distclean |
… |
… |
j_fltk() |
509 | 540 | make -k |
510 | 541 | check_status $? Could not make ${FLTK} |
511 | 542 | |
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 |
514 | 547 | |
515 | 548 | if [ ${do_clean} = yes ] ; then |
516 | 549 | make distclean |