source: rtems-graphics-toolkit/do_it @ 06b61aa

Last change on this file since 06b61aa was 06b61aa, checked in by Joel Sherrill <joel.sherrill@…>, on 01/11/10 at 04:10:30

2010-01-10 Joel Sherrill <joel.sherrill@…>

  • TODO, VERSIONS, do_it: Add initial FLTK configure support.
  • Property mode set to 100755
File size: 8.7 KB
Line 
1#! /bin/sh
2#
3#  Script to help build RTEMS Graphics Toolkit
4#
5#  $Id$
6#
7
8BASEDIR=`dirname $0`
9
10vfile=`dirname $0`/VERSIONS
11if [ ! -r ${vfile} ] ; then
12  echo VERSIONS file not found
13  exit 1
14fi
15
16source ${vfile}
17
18if [ X${LIBJPEG} = X ] ; then
19  echo VERSION FILE NOT CORRECT
20  exit 1
21fi
22
23######################## Set defaults #############################
24# Do we clean after build and install
25do_clean="no"
26# Do we build jpeg support?
27do_jpeg="no"
28# Do we build png support?
29do_png="no"
30# Do we build tiff support?
31do_tiff="no"
32# Do we build Adobe Type 1 Font support?
33do_t1="no"
34# Do we build Truetype Font support?
35do_ttf="no"
36
37# Do we build Microwindows/Nano-X support?
38do_nanox="no"
39
40# Do we build FLTK support?
41do_fltk="yes"
42
43# Are we noisy when running?
44verbose="no"
45######################## Parse arguments ###########################
46
47usage()
48{
49cat <<EOF
50do_it [options]
51  -A - build and install all libraries
52  -j - build JPEG support (default=no)
53  -p - build PNG support (default=no)
54  -t - build TIFF support (default=no)
55  -1 - build Adobe Type 1 font support (default=no)
56  -T - build Truetype font support (default=no)
57  -n - build Microwindows/Nano-X support (default=no)
58  -f - build FLTK support (default=no)
59  -c - clean after building (default=no)
60  -v - verbose
61
62NOTES:
63  + Use of each option toggles the setting.  For example, \"-v -v -A -1\"
64    results in verbose=no and all steps done except Type 1 fonts.
65  + RTEMS_MAKEFILE_PATH must be set.
66  + By default, nothing is built.
67EOF
68}
69
70fatal()
71{
72  usage
73  exit 1
74}
75
76check_status()
77{
78  if [ $1 -ne 0 ] ; then
79    shift
80    echo "ERROR: $*" >&2
81    exit 1
82  fi
83}
84
85toggle()
86{
87  case $1 in
88    no)  echo "yes" ;;
89    yes) echo "no" ;;
90    *)   fatal "Unknown value to toggle ($1)" ;;
91  esac
92}
93
94while getopts Ajpt1Tnfcv OPT
95do
96    case "$OPT" in
97      A) do_jpeg="yes"
98         do_png="yes"
99         do_tiff="yes"
100         do_t1="yes"
101         do_ttf="yes"
102         do_nanox="yes"
103         ;;
104      j) do_jpeg=`toggle ${do_jpeg}` ;;
105      p) do_png=`toggle ${do_png}` ;;
106      t) do_tiff=`toggle ${do_tiff}` ;;
107      1) do_t1=`toggle ${do_t1}` ;;
108      T) do_ttf=`toggle ${do_ttf}` ;;
109      n) do_nanox=`toggle ${do_nanox}` ;;
110      f) do_fltk=`toggle ${do_fltk}` ;;
111      c) do_clean=`toggle ${do_clean}` ;;
112      v) verbose=`toggle ${verbose}` ;;
113      *) fatal;;
114    esac
115done
116
117shiftcount=`expr $OPTIND - 1`
118shift $shiftcount
119
120if [ ${verbose} = yes ] ; then
121  echo "JPEG Library                    : " ${LIBJPEG}
122  echo "Build JPEG Library              : " ${do_jpeg}
123  echo "PNG Library                     : " ${LIBPNG}
124  echo "Build PNG Library               : " ${do_png}
125  echo "TIFF Library                    : " ${TIFFLIB}
126  echo "Build TIFF Library              : " ${do_tiff}
127  echo ""
128  echo "Build TrueType Font Library     : " ${do_ttf}
129  echo "TrueType Font Library           : " ${FREETYPE}
130  echo "Build Adobe Type 1 Font Library : " ${do_t1}
131  echo "Adobe Type 1 Font Library       : " ${T1LIB}
132  echo ""
133  echo "Build Microwindows/Nano-X       : " ${do_nanox}
134  echo "Microwindows/Nano-X Source      : " ${NANOX}
135  echo ""
136  echo "Build FLTK                      : " ${do_fltk}
137  echo "FLTK Source                     : " ${FLTK}
138  echo ""
139  echo "Clean after install             : " ${do_clean}
140  echo ""
141fi
142
143######### START OF Consistency checks
144
145if [ X${RTEMS_MAKEFILE_PATH} = X ] ; then
146  echo RTEMS_MAKEFILE_PATH not set
147  exit 1
148fi
149
150# XXX TBD check if enabled before checking if present?
151test -d ${LIBJPEG}
152check_status $? "${LIBJPEG} not present"
153test -d ${FREETYPE}
154check_status $? "${FREETYPE} not present"
155test -d ${LIBPNG}
156check_status $? "${LIBPNG} not present"
157test -d ${T1LIB}
158check_status $? "${T1LIB} not present"
159test -d ${TIFFLIB}
160check_status $? "${TIFFLIB} not present"
161test -d ${NANOX}
162check_status $? "${NANOX} not present"
163
164test -d ${RTEMS_MAKEFILE_PATH}
165check_status $? "${RTEMS_MAKEFILE_PATH} not present"
166
167######### END OF Consistency checks
168
169echo "Generating RTEMS_SETTINGS file..."
170make -f Makefile.settings clean all
171check_status $? Could not generate RTEMS_SETTINGS
172
173source ./RTEMS_SETTINGS
174
175PREFIX=${BSPTOP}
176
177if [ ${verbose} = yes ] ; then
178  echo "USING ${PREFIX} for install point!!!"
179fi
180
181case ${BSP} in
182  pc386) ;; # can be used to turn on detect svgalib supportable on this BSP
183  *)
184esac
185
186######### Log Directory
187LOGDIR=${BASEDIR}/log
188if [ ! -d ${LOGDIR} ] ; then
189  mkdir ${LOGDIR}
190fi
191#########
192
193######### Build and install JPEG
194j_jpeg()
195{
196  cd ${LIBJPEG}
197  CFLAGS="${CPU_CFLAGS}" \
198     ./configure --host=${TARGET} --prefix=${PREFIX} \
199     --includedir=${PREFIX}/lib/include \
200     --disable-shared \
201     --disable-programs
202  check_status $? Could not configure ${LIBJPEG}
203
204  make
205  check_status $? Could not make ${LIBJPEG}
206
207  make install
208  check_status $? Could not make install ${LIBJPEG}
209
210  if [ ${do_clean} = yes ] ; then
211    make distclean
212    check_status $? Could not make distclean ${LIBJPEG}
213  fi
214
215  cd ..
216}
217
218if [ ${do_jpeg} = yes ] ; then
219  echo "Building ${LIBJPEG} ..."
220  j_jpeg >${LOGDIR}/${TARGET}-${LIBJPEG}.log 2>&1
221fi
222
223######### Build and install PNG support
224j_png()
225{
226  cd ${LIBPNG}
227  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
228     ./configure --host=${TARGET} --prefix=${PREFIX} \
229     --includedir=${PREFIX}/lib/include \
230     --disable-shared
231  check_status $? Could not configure ${LIBPNG}
232
233  make
234  check_status $? Could not make ${LIBPNG}
235
236  make install
237  check_status $? Could not make install ${LIBPNG}
238
239  if [ ${do_clean} = yes ] ; then
240    make distclean
241    check_status $? Could not make distclean ${LIBPNG}
242  fi
243
244  cd ..
245}
246
247if [ ${do_png} = yes ] ; then
248  echo "Building ${LIBPNG} ..."
249  j_png >${LOGDIR}/${TARGET}-${LIBPNG}.log 2>&1
250fi
251
252######### Build and install TIFF support
253j_tiff()
254{
255  cd ${TIFFLIB}
256  CFLAGS="${CPU_CFLAGS}" \
257     ./configure --host=${TARGET} --prefix=${PREFIX} \
258     --includedir=${PREFIX}/lib/include \
259     --disable-shared
260  check_status $? Could not configure ${TIFFLIB}
261
262  make
263  check_status $? Could not make ${TIFFLIB}
264
265  make install
266  check_status $? Could not make install ${TIFFLIB}
267
268  if [ ${do_clean} = yes ] ; then
269    make distclean
270    check_status $? Could not make distclean ${TIFFLIB}
271  fi
272
273  cd ..
274}
275
276if [ ${do_tiff} = yes ] ; then
277  echo "Building ${TIFFLIB} ..."
278  j_tiff >${LOGDIR}/${TARGET}-${TIFFLIB}.log 2>&1
279fi
280
281######### Build and install Adobe Type 1 Font support
282j_t1()
283{
284  cd ${T1LIB}
285  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
286     ./configure --host=${TARGET} --prefix=${PREFIX} \
287     --includedir=${PREFIX}/lib/include \
288     --datadir=${PREFIX}/share \
289     --disable-shared \
290     --without-athena --without-x
291  check_status $? Could not configure ${T1LIB}
292
293  make
294  check_status $? Could not make ${T1LIB}
295
296  make install
297  check_status $? Could not make install ${T1LIB}
298
299  if [ ${do_clean} = yes ] ; then
300    make distclean
301    check_status $? Could not make distclean ${T1LIB}
302  fi
303
304  cd ..
305}
306
307if [ ${do_t1} = yes ] ; then
308  echo "Building ${T1LIB}..."
309  j_t1 >${LOGDIR}/${TARGET}-${T1LIB}.log 2>&1
310fi
311
312######### Build and install Truetype Font support
313j_ttf()
314{
315  cd ${FREETYPE}
316  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
317     ./configure --host=${TARGET} --prefix=${PREFIX} \
318     --includedir=${PREFIX}/lib/include \
319     --disable-shared
320  check_status $? Could not configure ${FREETYPE}
321
322  make
323  check_status $? Could not make ${FREETYPE}
324
325  make install
326  check_status $? Could not make install ${FREETYPE}
327
328  if [ ${do_clean} = yes ] ; then
329    make distclean
330    check_status $? Could not make distclean ${FREETYPE}
331  fi
332
333  cd ..
334}
335
336if [ ${do_ttf} = yes ] ; then
337  echo "Building ${FREETYPE} ..."
338  j_ttf >${LOGDIR}/${TARGET}-${FREETYPE}.log 2>&1
339fi
340
341######### Build and install Nano-X support
342j_nanox()
343{
344  cd ${NANOX}/src
345
346  # RTEMS_MAKEFILE_PATH inherited
347  export RTEMS_MAKEFILE_PATH
348
349  make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems
350  check_status $? Could not make ${NANOX}
351
352  make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems install
353  check_status $? Could not make install ${NANOX}
354
355  if [ ${do_clean} = yes ] ; then
356    make -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems clean
357    check_status $? Could not make distclean ${NANOX}
358  fi
359
360  cd ../..
361}
362
363if [ ${do_nanox} = yes ] ; then
364  echo "Building ${NANOX} ..."
365  j_nanox >${LOGDIR}/${TARGET}-${NANOX}.log 2>&1
366fi
367
368######### Build and install FLTK support
369j_fltk()
370{
371  cd ${FLTK}
372  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
373     ./configure --host=${TARGET} --prefix=${PREFIX} \
374     --disable-shared
375  check_status $? Could not configure ${FLTK}
376
377  make
378  check_status $? Could not make ${FLTK}
379
380  make install
381  check_status $? Could not make install ${FLTK}
382
383  if [ ${do_clean} = yes ] ; then
384    make distclean
385    check_status $? Could not make distclean ${FLTK}
386  fi
387
388  cd ..
389}
390
391if [ ${do_fltk} = yes ] ; then
392  echo "Building ${FLTK} ..."
393  echo "SKIPPING ${FLTK} ..."
394  # j_fltk >${LOGDIR}/${TARGET}-${FLTK}.log 2>&1
395fi
396
397exit 0
Note: See TracBrowser for help on using the repository browser.