minor tweaks
[geda-gaf/peter-b.git] / buildall.sh
blobf5a965b54b4999af1f0f90d22cb9b614a30f8cc0
1 #!/bin/sh
3 export INSTALLDIR=$HOME/geda
5 # Set these to point to GNU make
6 export MAKE=make
7 export GNUMAKE=make
9 # Nothing below configurable
10 ########################################################################
12 # Check for bzip2 as some tarballs come as .tar.bz2 files
13 whichbzip2=`which bzip2`
14 if [ "$whichbzip2" = "" ]
15 then
16 echo You must have bzip2 installed
17 exit 1
20 # Create a dummy lynx if it doesn't exist
21 whichlynx=`which lynx`
22 if [ "$whichlynx" = "" ]
23 then
24 touch $INSTALLDIR/bin/lynx
25 chmod 755 $INSTALLDIR/bin/lynx
26 CREATEDLYNX=1
29 # Create a somewhat dumb docbook2pdf if it doesn't exist
30 whichdocbook2pdf=`which docbook2pdf`
31 if [ "$whichdocbook2pdf" = "" ]
32 then
34 cat << EOF > $INSTALLDIR/bin/docbook2pdf
35 #!/bin/sh
37 newfilename=\`echo \$1 | sed "s/sgml/pdf/"\`
38 touch \$newfilename
39 EOF
41 chmod 755 $INSTALLDIR/bin/docbook2pdf
42 CREATEDDOCBOOK2PDF=1
46 export PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH
47 export PATH=$INSTALLDIR/bin:$PATH
48 export LD_LIBRARY_PATH=$INSTALLDIR/lib:$LD_LIBRARY_PATH
49 export CFLAGS=-I$INSTALLDIR/include
50 export LDFLAGS=-L$INSTALLDIR/lib
52 EXTRA_CONFIGURE_FLAGS=
54 # $1 name of package and created subdirectory
55 configure_build_install()
57 filename=$1.tar.gz
58 tarflags=xvfz
59 if [ ! -e $filename ]
60 then
61 filename=$1.tar.bz2
62 if [ ! -e $filename ]
63 then
64 echo Could not find $1.tar.gz or $1.tar.bz2
65 exit 2
66 else
67 bzip2 -d $filename
68 filename=$1.tar
69 tarflags=xvf
73 echo Untarring: $filename with tar $tarflags
74 tar $tarflags $filename
75 status=$?
76 if [ $status != 0 ]
77 then
78 echo $1: failed to untar
79 exit 3
82 cd $1
83 status=$?
84 if [ $status != 0 ]
85 then
86 echo $1: failed to cd into $1
87 exit 4
90 echo Configuring: $1 $EXTRA_CONFIGURE_FLAGS
91 ./configure --prefix=$INSTALLDIR $EXTRA_CONFIGURE_FLAGS
92 status=$?
93 if [ $status != 0 ]
94 then
95 echo $1: failed to configure
96 exit 5
99 echo Building: $1
100 $MAKE
101 status=$?
102 if [ $status != 0 ]
103 then
104 echo $1: failed to $MAKE
105 exit 6
108 echo Installing: $1
109 $MAKE install
110 status=$?
111 if [ $status != 0 ]
112 then
113 echo $1: failed to $MAKE install
114 exit 7
117 cd ..
120 ########################################################################
122 # Build the actual dependencies now
124 ########################################################################
126 configure_build_install pkgconfig-0.15.0
128 export EXTRA_CONFIGURE_FLAGS=--disable-csharp
129 configure_build_install gettext-0.14.3
130 export EXTRA_CONFIGURE_FLAGS=
132 configure_build_install freetype-2.1.9
133 configure_build_install render-0.8
134 configure_build_install libXrender-0.8.4
135 configure_build_install expat-1.95.8
136 configure_build_install fontconfig-2.3.1
137 configure_build_install libXft-2.1.6
138 configure_build_install xextensions-1.0.1
139 configure_build_install fixesext-2.0.1
140 configure_build_install libXfixes-2.0.1
141 configure_build_install libXcursor-1.1.2
142 configure_build_install zlib-1.2.2
143 configure_build_install libpng-1.2.8-config
144 configure_build_install libiconv-1.9.2
145 configure_build_install glib-2.6.3
146 configure_build_install atk-1.9.0
147 configure_build_install pango-1.8.1
149 export EXTRA_CONFIGURE_FLAGS=-"-without-libtiff --without-libjpeg"
150 configure_build_install gtk+-2.6.4
151 export EXTRA_CONFIGURE_FLAGS=
153 configure_build_install guile-1.6.7
154 configure_build_install libstroke-0.5.1
155 configure_build_install libgdgeda-2.0.15
157 ########################################################################
159 # Now build gEDA/gaf
161 ########################################################################
162 $MAKE open
163 $MAKE install
165 ########################################################################
167 # Cleanup
169 ########################################################################
170 if [ "$CREATEDLYNX" != "" ]
171 then
172 rm -f $INSTALLDIR/bin/lynx
175 if [ "$CREATEDDOCBOOK2PDF" != "" ]
176 then
177 rm -f $INSTALLDIR/bin/docbook2pdf