3 # $Id: maketcltk,v 1.14 2003/04/28 16:03:43 kripke Exp $
5 # sample how to build Tcl/Tk
6 # we can build shared or static versions,
7 # however, --disable-threads seems to break some tests ...
11 # recommended wish build:
12 # maketcltk -thr 8.3.5 tclx8.3.5 tix-8.1.4 blt2.4z tcllib-1.3 tclxml-2.6
13 # maketcltk -mingw 8.3.5
17 # maketcltk -thr 8.4.2 oratcl-4-1-branch
18 # maketcltk -thr 8.3.5 oratcl3.3
19 # maketcltk 8.3.4 oratcl3.3
22 # for dir in tcl tclx tix blt incrtcl oratcl; do
23 # http://belnet.dl.sourceforge.net/sourceforge/$dir
34 -base) base="$2"; shift 2;;
40 -mingw) mingw=true; shift;;
41 -a) static=true; shift;;
42 *) [ -n "$WIN32" ] && mingw=true;;
54 if [ -d $HOME/mingw/bin ]; then
55 PATH=$HOME/mingw/bin:$HOME/mingw/i386-mingw32msvc/bin:$PATH
56 elif [ -d /opt/cross-tools/bin ]; then
57 PATH=/opt/cross-tools/bin:/opt/cross-tools/i386-mingw32msvc/bin:$PATH
59 echo "could not find mingw installation. suggest you link $HOME/mingw to it">&2
64 CFG="$CFG --cache-file=config.cross.cache --host=i386-mingw32msvc"
65 CFG="$CFG --target=i386-mingw32msvc --build=i386-linux"
76 -thr) thr=--enable-threads; t=.t; shift;;
82 tclxml*) tclxml="$arg";;
84 oratcl*) oratcl="$arg";;
87 tcllib*) tcllib="$arg";;
100 $remake && ( cd $pkg/$other; make clean distclean; )
102 $remake && rm config.{cache,log,status}
103 $remake && make distclean
104 echo CC=gcc $cfg $CFG --prefix=$pfx $thr "$@"
105 [ -f config.status ] || $cfg $CFG --prefix=$pfx $thr "$@"
106 $remake && make clean
113 echo "### maketix $*"
117 with="--with-tclconfig=$dir/lib --with-tkconfig=$dir/lib"
118 # should be able to figure it out
119 # with="$with --with-tclinclude=$dir/include --with-tkinclude=$dir/include"
121 $remake && ( cd $pkg/$other; make clean distclean; )
123 $remake && make distclean
124 echo CC=gcc ./configure --prefix=$pfx $thr $with "$@"
125 [ -f config.status ] || ./configure --prefix=$pfx $thr $with "$@"
128 *8.4*) subdir=tk8.4;;
131 echo "# tix subdir $subdir"
133 $remake && make distclean
134 echo CC=gcc ./configure $CFG --prefix=$pfx $thr $with "$@"
135 ./configure $CFG --prefix=$pfx $thr $with "$@"
143 echo "### makeblt $*"
149 $remake && rm config.{cache,log,status}
151 echo CC=gcc ./configure $CFG --prefix=$pfx $thr "$@"
152 [ -f config.status ] || ./configure $CFG --prefix=$pfx $thr "$@"
153 $remake && make clean
154 make ;# important to make first, else bltsh is missing!
160 echo "### makexml $*"
166 $remake && rm config.{cache,log,status}
167 $remake && make distclean
168 echo CC=gcc ./configure $CFG --prefix=$pfx $thr "$@"
169 [ -f config.status ] || ./configure $CFG --prefix=$pfx $thr "$@"
170 $remake && make clean
181 if [ -d "tk$ver" ]; then
183 usetk="--enable-tk --with-tk=$dir/lib"
186 usetk="--disable-tk --without-tk"
188 echo tail -f $dir/makeall.log
189 $remake && [ -f $dir/makeall.log ] && mv $dir/makeall.log $dir/makeall.log.old
190 exec >>$dir/makeall.log 2>&1
192 makepkg $dir tcl$ver ./configure $shr
193 $mktk && makepkg $dir tk$ver ./configure $shr --with-tcl=$dir/lib
194 [ -n "$tclx" ] && makepkg $dir $tclx ./configure $shr \
195 --with-tcl=$dir/lib $usetk
196 [ -n "$oratcl" ] && makepkg $dir $oratcl ../configure $shr --with-tcl=$dir/lib
198 [ -n "$tkhtml" ] && maketkhtml $dir $tkhtml
199 [ -n "$tix" ] && maketix $dir "$tix" $shr
200 [ -n "$blt" ] && makeblt $dir "$blt" $shr \
201 --with-tcl=$dir/lib --with-tk=$dir/lib
203 if [ -n "$tcllib" ]; then
204 echo "### tcllib $tcllib"
205 (cd $tcllib && ./install.sh $dir)
207 if [ -n "$tclxml" ]; then
209 makexml $dir "$tclxml" $shr --with-tcl=$dir/lib
210 [ -d "tcldom-$ver" ] \
211 && makexml $dir "tcldom-$ver" $shr --with-tcl=$dir/lib
212 if false; then # requires gnome libxslt, libxml2
213 cat $dir/lib/TcldomConfig.sh $dir/lib/TclxmlConfig.sh \
214 >$dir/lib/tcldomxmlConfig.sh
215 [ -d "tclxslt-$ver" ] \
216 && makexml $dir "tclxslt-$ver" $shr --with-tcl=$dir/lib
221 if $static; then # only used for building binary dist ...
222 makeall $w$t.a --disable-shared
224 makeall $w$t.so --enable-shared