source: rtems-graphics-toolkit/do_it @ a2cea51

Last change on this file since a2cea51 was a2cea51, checked in by Joel Sherrill <joel.sherrill@…>, on 01/08/10 at 19:55:06

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

  • do_it: Fix typo.
  • Property mode set to 100755
File size: 6.8 KB
RevLine 
[8c14de8]1#! /bin/sh
2#
3#  Script to help build RTEMS Graphics Toolkit
[c768d24]4#
5#  $Id$
6#
7
[8c14de8]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# Are we noisy when running?
37verbose="no"
38######################## Parse arguments ###########################
39
40usage()
[c768d24]41{
[8c14de8]42cat <<EOF
[a2cea51]43do_it [options]
[8c14de8]44  -A - build and install all libraries
45  -j - build JPEG support (default=no)
46  -p - build PNG support (default=no)
47  -t - build TIFF support (default=no)
48  -1 - build Adobe Type 1 font support (default=no)
49  -T - build Truetype font support (default=no)
50  -c - clean after building (default=no)
51  -v - verbose
[c768d24]52
[8c14de8]53NOTES:
54  + Use of each option toggles the setting.  For example, \"-v -v -A -1\"
55    results in verbose=no and all steps done except Type 1 fonts.
[2102179]56  + RTEMS_MAKEFILE_PATH must be set.
57  + By default, nothing is built.
[8c14de8]58EOF
59}
[c768d24]60
[8c14de8]61fatal()
62{
63  usage
64  exit 1
65}
[c768d24]66
67check_status()
68{
69  if [ $1 -ne 0 ] ; then
[8c14de8]70    shift
71    echo "ERROR: $*" >&2
[c768d24]72    exit 1
73  fi
74}
75
[8c14de8]76toggle()
77{
78  case $1 in
79    no)  echo "yes" ;;
80    yes) echo "no" ;;
81    *)   fatal "Unknown value to toggle ($1)" ;;
82  esac
83}
84
85while getopts Ajpt1Tv OPT
86do
87    case "$OPT" in
88      A) do_jpeg="yes"
89         do_png="yes"
90         do_tiff="yes"
91         do_t1="yes"
92         do_ttf="yes"
93         ;;
94      j) do_jpeg=`toggle ${do_jpeg}` ;;
95      p) do_png=`toggle ${do_png}` ;;
96      t) do_tiff=`toggle ${do_tiff}` ;;
97      1) do_t1=`toggle ${do_t1}` ;;
98      T) do_ttf=`toggle ${do_ttf}` ;;
99      c) do_clean=`toggle ${do_clean}` ;;
100      v) verbose=`toggle ${verbose}` ;;
101      *) fatal;;
102    esac
103done
[c768d24]104
[8c14de8]105shiftcount=`expr $OPTIND - 1`
106shift $shiftcount
107
108if [ ${verbose} = yes ] ; then
109  echo "JPEG Library                : " ${LIBJPEG}
110  echo "Build JPEG Library          : " ${do_jpeg}
111  echo "PNG Library                 : " ${LIBPNG}
112  echo "Build PNG Library           : " ${do_png}
113  echo "TIFF Library                : " ${TIFFLIB}
114  echo "Build TIFF Library          : " ${do_tiff}
115  echo ""
116  echo "Build TrueType Font Library : " ${do_ttf}
117  echo "TrueType Font Library       : " ${FREETYPE}
118  echo "Adobe Type 1 Font Library   : " ${T1LIB}
119  echo "JPEG Library                : " ${do_t1}
120  echo "Clean after instal          : " ${do_clean}
[c768d24]121fi
122
[35c1f65]123######### START OF Consistency checks
124
125if [ X${RTEMS_MAKEFILE_PATH} = X ] ; then
126  echo RTEMS_MAKEFILE_PATH not set
127  exit 1
128fi
129
[8c14de8]130test -d ${LIBJPEG}
131check_status $? "${LIBJPEG} not present"
132test -d ${FREETYPE}
133check_status $? "${FREETYPE} not present"
134test -d ${LIBPNG}
135check_status $? "${LIBPNG} not present"
136test -d ${T1LIB}
137check_status $? "${T1LIB} not present"
138test -d ${TIFFLIB}
139check_status $? "${TIFFLIB} not present"
140
141test -d ${RTEMS_MAKEFILE_PATH}
142check_status $? "${RTEMS_MAKEFILE_PATH} not present"
143
144######### END OF Consistency checks
145
[e15c776]146echo "Generating RTEMS_SETTINGS file..."
147make -f Makefile.settings clean all
[c768d24]148check_status $? Could not generate RTEMS_SETTINGS
149
150source ./RTEMS_SETTINGS
151
[e15c776]152PREFIX=${BSPTOP}
[c768d24]153
[8c14de8]154if [ ${verbose} = yes ] ; then
155  echo "USING ${PREFIX} for install point!!!"
156fi
157
[35c1f65]158case ${BSP} in
159  pc386) ;; # can be used to turn on detect svgalib supportable on this BSP
160  *)
161esac
[8c14de8]162
163######### Log Directory
164LOGDIR=${BASEDIR}/log
165if [ ! -d ${LOGDIR} ] ; then
166  mkdir ${LOGDIR}
167fi
168#########
[c768d24]169
[8c14de8]170######### Build and install JPEG
171j_jpeg()
[9aa7c17]172{
[8c14de8]173  cd ${LIBJPEG}
174  CFLAGS="${CPU_CFLAGS}" \
175     ./configure --host=${TARGET} --prefix=${PREFIX} \
176     --includedir=${PREFIX}/lib/include \
177     --disable-shared \
178     --disable-programs
179  check_status $? Could not configure ${LIBJPEG}
180
181  make
182  check_status $? Could not make ${LIBJPEG}
183
184  make install
185  check_status $? Could not make isntall ${LIBJPEG}
186
187  if [ ${do_clean} = yes ] ; then
188    make distclean
189    check_status $? Could not make distclean ${LIBJPEG}
190  fi
191
192  cd ..
[9aa7c17]193}
194
[8c14de8]195if [ ${do_jpeg} = yes ] ; then
196  echo "Building ${LIBJPEG} ..."
197  j_jpeg >${LOGDIR}/${TARGET}-${LIBJPEG}.log 2>&1
198fi
199
200######### Build and install PNG support
201j_png()
202{
203  cd ${LIBPNG}
204  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
205     ./configure --host=${TARGET} --prefix=${PREFIX} \
206     --includedir=${PREFIX}/lib/include \
207     --disable-shared
208  check_status $? Could not configure ${LIBPNG}
209
210  make
211  check_status $? Could not make ${LIBPNG}
212
213  make install
214  check_status $? Could not make isntall ${LIBPNG}
215
216  if [ ${do_clean} = yes ] ; then
217    make distclean
218    check_status $? Could not make distclean ${LIBPNG}
219  fi
220
221  cd ..
222}
223
224if [ ${do_png} = yes ] ; then
225  echo "Building ${LIBPNG} ..."
226  j_png >${LOGDIR}/${TARGET}-${LIBPNG}.log 2>&1
227fi
228
229######### Build and install TIFF support
230j_tiff()
231{
232  cd ${TIFFLIB}
233  CFLAGS="${CPU_CFLAGS}" \
234     ./configure --host=${TARGET} --prefix=${PREFIX} \
235     --includedir=${PREFIX}/lib/include \
236     --disable-shared
237  check_status $? Could not configure ${TIFFLIB}
238
239  make
240  check_status $? Could not make ${TIFFLIB}
241
242  make install
243  check_status $? Could not make isntall ${TIFFLIB}
244
245  if [ ${do_clean} = yes ] ; then
246    make distclean
247    check_status $? Could not make distclean ${TIFFLIB}
248  fi
249
250  cd ..
251}
252
253if [ ${do_tiff} = yes ] ; then
254  echo "Building ${TIFFLIB} ..."
255  j_tiff >${LOGDIR}/${TARGET}-${TIFFLIB}.log 2>&1
256fi
257
258######### Build and install Adobe Type 1 Font support
259j_t1()
260{
261  cd ${T1LIB}
262  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
263     ./configure --host=${TARGET} --prefix=${PREFIX} \
264     --includedir=${PREFIX}/lib/include \
265     --datadir=${PREFIX}/share \
266     --disable-shared \
267     --without-athena --without-x
268  check_status $? Could not configure ${T1LIB}
269
270  make
271  check_status $? Could not make ${T1LIB}
272
273  make install
274  check_status $? Could not make isntall ${T1LIB}
275
276  if [ ${do_clean} = yes ] ; then
277    make distclean
278    check_status $? Could not make distclean ${T1LIB}
279  fi
280
281  cd ..
282}
283
284if [ ${do_t1} = yes ] ; then
285  echo "Building ${T1LIB}..."
286  j_t1 >${LOGDIR}/${TARGET}-${T1LIB}.log 2>&1
287fi
288
289######### Build and install Truetype Font support
290j_ttf()
291{
292  cd ${FREETYPE}
293  CFLAGS="${BSP_CFLAGS} ${CPU_CFLAGS}" \
294     ./configure --host=${TARGET} --prefix=${PREFIX} \
295     --includedir=${PREFIX}/lib/include \
296     --disable-shared
297  check_status $? Could not configure ${FREETYPE}
298
299  make
300  check_status $? Could not make ${FREETYPE}
301
302  make install
303  check_status $? Could not make isntall ${FREETYPE}
304
305  if [ ${do_clean} = yes ] ; then
306    make distclean
307    check_status $? Could not make distclean ${FREETYPE}
308  fi
309
310  cd ..
311}
312
313if [ ${do_ttf} = yes ] ; then
314  echo "Building ${FREETYPE} ..."
315  j_ttf >${LOGDIR}/${TARGET}-${FREETYPE}.log 2>&1
316fi
[9aa7c17]317
[c768d24]318exit 0
Note: See TracBrowser for help on using the repository browser.