Code

* packaging/macosx/native-gtk/build-gtk.sh: Minor fix for configure being
[inkscape.git] / packaging / macosx / native-gtk / build-gtk.sh
1 #!/bin/sh
2 #
3 # Based on the Imendio 'build-gtk.sh' script.
4 #
5 # Inkscape build additions by Michael Wybrow <mjwybrow@users.sf.net>
6 #
7 # See the following page for build instructions:
8 # http://developer.imendio.com/projects/gtk-macosx/build-instructions
9 #
10 # Usage:
11 # export PREFIX=/your/install/prefix
12 # ./build-gtk bootstrap
13 # ./build-gtk build inkscape
14 #
16 # XXX: Check for xargs with -i
17 #
18 # In lib/pkgconfig/freetpe2.pc
19 #
20 # -  Libs: -L${libdir} -lfreetype -lz
21 # +  Libs: -L${libdir} -lfreetype -lz -Wl,-framework,CoreServices,-framework,ApplicationServices 
22 #
23 # bin/freetype-config
24 #
25 # -  libs="-lfreetype -lz"
26 # +  libs="-lfreetype -lz -Wl,-framework,CoreServices,-framework,ApplicationServices"
27 #
28 # In lib/pkgconfig/fontconfig.pc
29 #       Add -lexpat
30 #       
32 version=1.3-inkscape
34 export PREFIX=${PREFIX-/opt/gtk}
35 export PATH=$PREFIX/bin:/usr/bin:$PATH
36 #export PATH=$PREFIX/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:
37 export LIBTOOLIZE=$PREFIX/bin/libtoolize
39 # FIXME: We might need some more intelligent way to get the path here.
40 export PYTHONPATH=$PREFIX/lib/python2.3/site-packages
42 # Needed for glib etc to pick up gettext
43 export LDFLAGS=-L$PREFIX/lib
44 export CPPFLAGS=-I$PREFIX/include
46 export XDG_DATA_DIRS=$PREFIX/share
48 COMMON_OPTIONS="--prefix=$PREFIX --disable-static --enable-shared \
49 --disable-gtk-doc --disable-scrollkeeper"
51 #export MAKEFLAGS=-j2
53 if [ "x$UNIVERSAL_BUILD" = "xYes" ]; then
54     COMMON_OPTIONS="$COMMON_OPTIONS --disable-dependency-tracking"
56     export SDK="/Developer/SDKs/MacOSX10.4u.sdk"
57     export MACOSX_DEPLOYMENT_TARGET=10.4
58     #export MACOSX_DEPLOYMENT_TARGET_i386=10.4
59     #export MACOSX_DEPLOYMENT_TARGET_ppc=10.3
60     export CFLAGS="-isysroot ${SDK} -arch ppc -arch i386"
61     export CXXFLAGS="-isysroot ${SDK} -arch ppc -arch i386"
63     CONFIGURE_pkg_config="--with-pc-path=$PREFIX/lib/pkgconfig:/usr/X11R6/lib/pkgconfig --enable-indirect-deps --disable-dependency-tracking"
65     CONFIGURE_libpng="--disable-dependency-tracking"
66     PRECONFIGURE_libpng="eval CPPFLAGS='$CPPFLAGS -DPNG_NO_ASSEMBLER_CODE'"
67     
68     CONFIGURE_tiff="--disable-dependency-tracking"
70     POSTCONFIGURE_jpeg_6b="patch_libtool_dylib"
71     
72     CONFIGURE_gc="--disable-dependency-tracking"
73     POSTCONFIGURE_gc="patch_libtool_dylib"
74     PRECONFIGURE_gc="eval CFLAGS='$CFLAGS -DUSE_GENERIC_PUSH_REGS'"
75     
76     POSTCONFIGURE_freetype="eval cd builds/unix/ && pwd && patch_libtool_dylib && cd ../.."
78     CONFIGURE_fontconfig="--disable-dependency-tracking --disable-docs"
79     POSTCONFIGURE_fontconfig="eval cd fc-arch && make all && cd .. && perl -pi~ -e 's|#define FC_ARCHITECTURE \"x86\"|#ifdef __ppc__\n#define FC_ARCHITECTURE \"ppc\"\n#else\n#define FC_ARCHITECTURE \"x86\"\n#endif|g' fc-arch/fcarch.h"
81     CONFIGURE_cairo="--disable-dependency-tracking --enable-shared --disable-quartz --disable-atsui --enable-glitz"
82     POSTCONFIGURE_cairo="patch_libtool_dylib"
83     
84     CONFIGURE_glitz="--disable-dependency-tracking"
86     CONFIGURE_lcms="--disable-dependency-tracking"
87     
88     CONFIGURE_glib="$COMMON_OPTIONS"
89     POSTCONFIGURE_glib="eval make glibconfig.h config.h && cp ~/ws-fat/{glib,}config.h ."
90     #POSTCONFIGURE_glib="eval make glibconfig.h && perl -pi~ -e 's|#define G_BYTE_ORDER G_LITTLE_ENDIAN|#include <machine/endian.h>\n#define G_BYTE_ORDER __DARWIN_BYTE_ORDER|g' glibconfig.h"
91     
92     CONFIGURE_pango="$COMMON_OPTIONS"
93     POSTCONFIGURE_pango="eval perl -pi~ -e 's|SUBDIRS = pango modules examples docs tools tests|SUBDIRS = pango modules docs tools tests|g' Makefile && perl -pi~ -e 's|harfbuzz_dump_LDADD = |harfbuzz_dump_LDADD = -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker ApplicationServices|g' pango/opentype/Makefile"
94     
95     CONFIGURE_gtk="$COMMON_OPTIONS"
97     CONFIGURE_atk="$COMMON_OPTIONS"
98     
99     CONFIGURE_libxml2="$COMMON_OPTIONS"
100     
101     CONFIGURE_libsigc="$COMMON_OPTIONS"
102     POSTCONFIGURE_libsigc="patch_libtool_dylib"
103     
104     CONFIGURE_glibmm="$COMMON_OPTIONS"
105     
106     CONFIGURE_cairomm="$COMMON_OPTIONS"
107     
108     CONFIGURE_gtkmm="$COMMON_OPTIONS --disable-examples --disable-demos"
109     POSTCONFIGURE_gtkmm="patch_libtool_dylib"
110     
111     CONFIGURE_libxslt="$COMMON_OPTIONS"
112     
113     CONFIGURE_popt="$COMMON_OPTIONS"
114     POSTCONFIGURE_popt="patch_libtool_dylib"
115 fi
117 if [ "x$PANTHER_BUILD" = "xYes" ]; then
118     # XXX: Check the machine is PPC
119     #      or rework to have things like pkg-config built natively.
121     # Overwrite some build settings.
122     export SDK="/Developer/SDKs/MacOSX10.3.9.sdk"
123     export MACOSX_DEPLOYMENT_TARGET=10.3
124     export CFLAGS="-isysroot ${SDK} -arch ppc"
125     export CXXFLAGS="-isysroot ${SDK} -arch ppc"
126 fi
129 # Support install-check from jhbuild to speed up compilation
130 if [ -x $PREFIX/bin/install-check ]; then
131     export INSTALL=$PREFIX/bin/install-check
132 fi
135 SOURCE=${SOURCE-$HOME/Source/gtk}
136 CAIROCVSROOT=${CAIROCVSROOT-:pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo}
137 INKSCAPESVNURL="https://svn.sourceforge.net/svnroot/inkscape"
138 GNOMESVNURL=${GNOMESVNURL-https://svn.gnome.org/svn}
140 if [ x$1 = xrun ]; then
141     cmd="$2"
142     shift 2
143     exec $cmd $*
144 fi
146 if [ $# -eq 0 -o "x`echo "$*" | grep shell`" = xshell ]; then
147     # Can be used in .bashrc to set a fancy prompt...
148     export INSIDE_GTK_BUILD=1
149     bash
150     exit 0
151 fi
153 CORE_MODULES="cairo gnome-common glib pango atk gtk+"
154 EXTRA_MODULES="libxml2 libxslt loudmouth libglade gossip gtk-engines"
155 PYGTK_MODULES=" pycairo pygobject pygtk"
156 INKSCAPE_MODULES="$CORE_MODULES libxml2 libxslt gc lcms libsig++ doxygen glibmm cairomm gtkmm popt inkscape"
158 # Could add those (orbit requires popt though)
159 MORE_MODULES="libIDL ORBit2 gconf"
161 function print_usage
163     echo
164     echo "GTK+ on Mac OS X build script version $version."
165     echo 
166     echo "Usage:"
167     echo "`basename $0` [bootstrap|[shell]|run <cmd>|build [<modules>]], modules are:"
168     echo " Core: $CORE_MODULES"
169     echo " Extra: $EXTRA_MODULES"
170     echo " Python: $PYGTK_MODULES"
171     echo " Inkscape: $INKSCAPE_MODULES"
172     echo
173     echo "Setup: This script defaults to downloading source to ~/Source/gtk and"
174     echo "installing in /opt/gtk. Make sure your user has write access to the"
175     echo "latter directory. You can override those directories by setting the"
176     echo "SOURCE and PREFIX environment variables. Anoncvs is used by default"
177     echo "for access to GNOME SVN, if you wish to override, set the environment"
178     echo "variable GNOMESVNURL to your own account."
179     echo
180     echo "While in the shell that this script provides, the environment variable"
181     echo "INSIDE_GTK_BUILD is set, which makes it possible to put something like"
182     echo "the following in ~/.bashrc:"
183     echo
184     echo " if [ x\$INSIDE_GTK_BUILD != x ]; then"
185     echo "     PS1=\"[GTK] \u@\h \W $ \""
186     echo " fi"
187     echo
188     echo "Start by bootstrapping. This will install the necessary build tools."
189     echo "Then build GTK+ & co by using the \"build\" command. If no modules are"
190     echo "specified, only the ones needed for GTK+ will be built. The special"
191     echo "modules \"core\" and \"all\" can be used to build just the core or all"
192     echo "modules."
193     echo
194     echo "If you want to build something manually or run something, use the "
195     echo "\"shell\" command (or no command) to get a shell with the environment"
196     echo "properly setup."
197     echo 
198     echo "Tip: if you build and install \"install-check\" from jhbuild into your"
199     echo "PREFIX, recompiling when hacking on GTK+ & co will be a lot faster."
200     echo
203 function download
205     BASENAME=`basename $1`
207     if [ -s $BASENAME ]; then
208         echo "Already downloaded"
209         return 0
210     fi
212     curl $1 > $BASENAME || return 1
214     return 0
217 function should_build
219     if [ -f $1/BUILT ]; then
220         echo "Already built"
221         return 1
222     fi
224     return 0
227 function tarball_get_and_build
229     BASENAME=`basename $1`
230     DIRNAME=`echo $BASENAME | sed -e s,.src.,., | sed -e s,.tar.*,,`
231     INSTCMD="make install"
232     PREFIXARG="--prefix=$PREFIX"
233     COMMONOPTS="$COMMON_OPTIONS"
234    
235     SHORTNAME=`echo $DIRNAME | sed -e s,-*[0-9\.]*$,,`
236     if !(echo "$MODULES" | grep -w $SHORTNAME) >/dev/null; then
237         return 0
238     fi
239     
240     echo
241     echo "Building $DIRNAME"
242     echo -ne "\033]0;Building $DIRNAME\007"
243     
244     # Special case jpeg... :/
245     if [ x`echo $DIRNAME | grep jpeg` != x ]; then
246         INSTCMD="make install-lib"
247     fi
248     
249     if [ x`echo $BASENAME | grep bz2` != x ]; then
250         COMP="j"
251     else
252         COMP="z"
253     fi
254     
255     # Doxygen doesn't have a standard configure script.
256     if [ x`echo $BASENAME | grep doxygen` != x ]; then
257         PREFIXARG="--prefix $PREFIX"
258         COMMONOPTS="--shared"
259     fi
260     
261     # Modify specific configure options
262     UNDERSCORENAME=`echo $SHORTNAME | sed -e s,-,_, | tr -d '+'`
263     CONFIGURE_EXTRA=`eval echo '\$'{CONFIGURE_$UNDERSCORENAME}`
264     if [ "x$CONFIGURE_EXTRA" != "x" ]; then
265         COMMONOPTS="$COMMONOPTS $CONFIGURE_EXTRA"
266     fi
267     PRECONFIGURE=`eval echo '\$'{PRECONFIGURE_$UNDERSCORENAME}`
268     if [ "x$PRECONFIGURE" == "x" ]; then
269         PRECONFIGURE="true"
270     fi
271     POSTCONFIGURE=`eval echo '\$'{POSTCONFIGURE_$UNDERSCORENAME}`
272     if [ "x$POSTCONFIGURE" == "x" ]; then
273         POSTCONFIGURE="true"
274     fi
275     
276     cd $SOURCE || return 1
277     download $1 || return 1
278     should_build $DIRNAME || return 0
279     tar ${COMP}xf $BASENAME && \
280         cd $DIRNAME && \
281         $PRECONFIGURE && \
282         echo "./configure $PREFIXARG $COMMONOPTS $2" && \
283         ./configure $PREFIXARG $COMMONOPTS $2 && \
284         $POSTCONFIGURE && \
285         make && $INSTCMD && touch BUILT
289 function cpan_get_and_build
291     BASENAME=`basename $1`
292     DIRNAME=`echo $BASENAME | sed -e s,.tar.*,,`
293     
294     SHORTNAME=`echo $DIRNAME | sed -e s,-*[0-9\.]*$,,`
295     if !(echo "$MODULES" | grep -w $SHORTNAME) >/dev/null; then
296         return 0
297     fi
298     
299     echo
300     echo "Building $DIRNAME"
301     echo -ne "\033]0;Building $DIRNAME\007"
302     
303     if [ x`echo $BASENAME | grep bz2` != x ]; then
304         COMP="j"
305     else
306         COMP="z"
307     fi
308     
309     cd $SOURCE || return 1
310     download $1 || return 1
311     should_build $DIRNAME || return 0
312     tar ${COMP}xf $BASENAME && \
313         cd $DIRNAME && \
314         perl Makefile.PL $2 && \
315         make && \
316         (echo "Enter your password to istall $BASENAME"; make install) && \
317         touch BUILT
320 function git_get_and_build
322     if !(echo "$MODULES" | grep -w $2) >/dev/null; then
323         return 0
324     fi
325     
326     echo
327     echo "Building $2"
328     echo -ne "\033]0;Building $2\007"
329     
330     cd $SOURCE
331     if [ -d $2 ]; then
332         cd $2
333         cg-update || return
334     else
335         cg-clone $1/$2 || return
336         cd $2
337     fi
338     
339     echo "./autogen.sh $COMMON_OPTIONS $3"
340     (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
343 function cvs_get_and_build
345     if !(echo "$MODULES" | grep -w $2) >/dev/null; then
346         return 0
347     fi
348     
349     echo
350     echo "Building $2"
351     echo -ne "\033]0;Building $2\007"
352     
353     cd $SOURCE
354     if [ -d $2 ]; then
355         cd $2
356         cvs up -dP || return
357     else
358         cvs -d $1 co -P $2 || return
359         cd $2
360     fi
361     
362     echo "./autogen.sh $COMMON_OPTIONS $3"
363     (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
366 function svn_get_and_build
368     if !(echo "$MODULES" | grep -w $2) >/dev/null; then
369         return 0
370     fi
371     
372     echo
373     echo "Building $2"
374     echo -ne "\033]0;Building $2\007"
375     
376     cd $SOURCE
377     if [ -d $2 ]; then
378         cd $2
379         svn up || return
380     else
381         svn co $1/$2/trunk $2 || return
382         cd $2
383     fi
384     
385     echo "./autogen.sh $COMMON_OPTIONS $3"
386     #(./autogen.sh $COMMON_OPTIONS $3 && ./configure --prefix=$PREFIX $COMMON_OPTIONS $3 && make && make install)
387     (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
390 function set_automake
392     old_AUTOMAKE=$AUTOMAKE
393     old_ACLOCAL=$ACLOCAL
395     export AUTOMAKE=automake-$1
396     export ACLOCAL=aclocal-$1
399 function restore_automake
401     if [ x$old_AUTOMAKE != x ]; then
402         export AUTOMAKE=$old_AUTOMAKE
403     else
404         unset AUTOMAKE
405     fi
407     if [ x$old_ACLOCAL != x ]; then
408         export ACLOCAL=$old_ACLOCAL
409     else
410         unset ACLOCAL
411     fi
414 function do_exit
416     echo -ne "\033]0;\007"
417     exit
420 # Make sure to restore the title when done.
421 trap do_exit EXIT SIGINT SIGTERM
424 # configure doesn't pass CFLAGS through to generated libtool 
425 function patch_libtool_dylib()
427     # Only do this for universal builds.
428     if [ "x$UNIVERSAL_BUILD" != "xYes" ]; then
429         return 0
430     fi
432     cp libtool libtool.old
433     perl -pi -e "s@-dynamiclib@$CFLAGS \$&@" libtool
434     if test "x$1" = "xwithbundle"; then
435         perl -pi -e "s@-bundle@$CFLAGS \$&@" libtool
436     fi
440 function process_modules()
442     # Bootstrap packages.
443     PACKAGES=" \
444         http://pkgconfig.freedesktop.org/releases/pkg-config-0.21.tar.gz \
445         http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz \
446         http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2 \
447         http://ftp.gnu.org/pub/gnu/automake/automake-1.7.9.tar.bz2 \
448         http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2 \
449         http://heanet.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.15.tar.bz2 \
450         ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz \
451         http://people.imendio.com/richard/gtk-osx/files/jpeg-6b.tar.gz \
452         http://ftp.gnu.org/gnu/gettext/gettext-0.16.tar.gz \
453         http://heanet.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz \
454         http://heanet.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.0.tar.bz2 \
455         http://fontconfig.org/release/fontconfig-2.4.2.tar.gz \
456         http://people.imendio.com/richard/gtk-osx/files/docbook-files-1.tar.gz \
457         http://www.cs.mu.oz.au/~mjwybrow/gtk-osx/gnome-doc-utils-fake-1.tar.gz \
458         "
460         #http://people.imendio.com/richard/gtk-osx/files/popt-1.7.tar.gz
461     
462     for PACKAGE in $PACKAGES; do
463         tarball_get_and_build $PACKAGE || exit 1
464     done
466     PACKAGE=http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.6/gtk-doc-1.6.tar.bz2
467     tarball_get_and_build $PACKAGE "--with-xml-catalog=$PREFIX/etc/xml/catalog" || exit 1
468     
469     PACKAGE=ftp://ftp4.freebsd.org/pub/FreeBSD/ports/distfiles/XML-Parser-2.34.tar.gz
470     cpan_get_and_build $PACKAGE "PREFIX=$PREFIX INSTALLDIRS=perl EXPATLIBPATH=$PREFIX/lib EXPATINCPATH=$PREFIX/include" || exit 1
472     PACKAGES=" \
473         http://ftp.gnome.org/pub/GNOME/sources/intltool/0.35/intltool-0.35.0.tar.bz2 \
474         http://icon-theme.freedesktop.org/releases/hicolor-icon-theme-0.9.tar.gz \
475         http://ftp.gnome.org/pub/GNOME/sources/gnome-icon-theme/2.14/gnome-icon-theme-2.14.2.tar.bz2 \
476         "
477     
478     for PACKAGE in $PACKAGES; do
479         tarball_get_and_build $PACKAGE || exit 1
480     done
483     # Other packages:
484     if [ "$UNIVERSAL_BUILD" == "Yes" ];
485     then
486         tarball_get_and_build http://cairographics.org/snapshots/glitz-0.5.6.tar.gz || exit 1
487         tarball_get_and_build http://cairographics.org/releases/cairo-1.2.6.tar.gz || exit 1
488         tarball_get_and_build http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz || exit 1
489         tarball_get_and_build http://www.littlecms.com/lcms-1.16.tar.gz || exit 1
490         tarball_get_and_build ftp://ftp.gtk.org/pub/glib/2.12/glib-2.12.9.tar.bz2 || exit 1
491         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/pango/1.14/pango-1.14.5.tar.bz2 || exit 1
492         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/atk/1.12/atk-1.12.4.tar.bz2 || exit 1
493         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/gtk+/2.10/gtk+-2.10.9.tar.bz2 || exit 1
494         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libxml2/2.6/libxml2-2.6.26.tar.bz2 || exit 1
495         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libsigc++/2.0/libsigc++-2.0.17.tar.bz2 || exit 1
496         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/glibmm/2.12/glibmm-2.12.4.tar.bz2 || exit 1
497         tarball_get_and_build http://cairographics.org/releases/cairomm-1.2.4.tar.gz || exit 1
498         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/gtkmm/2.10/gtkmm-2.10.6.tar.bz2 || exit 1
499         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libxslt/1.1/libxslt-1.1.17.tar.bz2 || exit 1
500         tarball_get_and_build ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/popt-1.7.tar.gz || exit 1
502         svn_get_and_build $INKSCAPESVNURL inkscape || exit 1
504         exit 0
505     else
506             git_get_and_build git://git.cairographics.org/git cairo "--enable-pdf --enable-atsui --enable-quartz --disable-xlib" || exit 1
508             tarball_get_and_build http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.7.tar.gz || exit 1
509             tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libsigc++/2.0/libsigc++-2.0.17.tar.gz || exit 1
510             tarball_get_and_build http://ftp.stack.nl/pub/users/dimitri/doxygen-1.5.1.src.tar.gz || exit 1
511             tarball_get_and_build ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/popt-1.7.tar.gz || exit 1
512     fi
514     svn_get_and_build $GNOMESVNURL libxml2 || exit 1
515     svn_get_and_build $GNOMESVNURL libxslt || exit 1
516     svn_get_and_build $GNOMESVNURL gnome-common || exit 1
517     svn_get_and_build $GNOMESVNURL glib || exit 1
518     svn_get_and_build $GNOMESVNURL atk || exit 1
519     svn_get_and_build $GNOMESVNURL pango "--without-x" || exit 1
520     svn_get_and_build $GNOMESVNURL gtk+ "--with-gdktarget=quartz" || exit 1
521     svn_get_and_build $GNOMESVNURL gtk-engines || exit 1
522     svn_get_and_build $GNOMESVNURL loudmouth "--with-ssl=openssl" || exit 1
523     svn_get_and_build $GNOMESVNURL libglade || exit 1
524     # gossip needs xml2po from gnome-doc-utils.
525     svn_get_and_build $GNOMESVNURL gossip "--with-backend=cocoa" || exit 1
526     svn_get_and_build $CAIROCVSROOT pycairo || exit 1
527     svn_get_and_build $GNOMESVNURL pygobject "--disable-docs" || exit 1
528     svn_get_and_build $GNOMESVNURL pygtk "--disable-docs" || exit 1
530     svn_get_and_build $GNOMESVNURL glibmm "--disable-docs --disable-fulldocs" || exit 1
531     cvs_get_and_build $CAIROCVSROOT cairomm || exit 1
532     svn_get_and_build $GNOMESVNURL gtkmm "--disable-docs --disable-examples --disable-demos" || exit 1
534     svn_get_and_build $INKSCAPESVNURL inkscape || exit 1
537     #svn_get_and_build $GNOMESVNURL gimp || exit 1
538     # For gimp:
539     # libart_lgpl, needs automake 1.4 and doesn't run libtoolize
540     # gtkhtml2 (optional)
541     # libpoppler (optional)
542     # ./autogen.sh --prefix=/opt/gimp --disable-gtk-doc 
545 if (echo "$*" | grep bootstrap) >/dev/null; then
546     if [ "x`cg-version 2>/dev/null`" == "x" ]; then
547         echo "You need the cogito to get cairo from git. It's available e.g. in Darwin ports."
548         exit 1
549     fi
550     if [ "x`which svn 2>/dev/null`" == "x" ]; then
551         echo "You need the svn client to get inkscape."
552         exit 1
553     fi
554     
555     mkdir -p $SOURCE 2>/dev/null || \
556         (echo "Error: Couldn't create source checkout dir $SOURCE"; exit 1)
557     mkdir -p $PREFIX/bin 2>/dev/null || \
558         (echo "Error: Couldn't create bin dir $PREFIX/bin"; exit 1)
559     
560     echo "Building bootstrap packages."
561  
562     MODULES="pkg-config libtool autoconf automake libpng till jpeg-6b gettext \
563              expat fontconfig docbook-files \
564              "
565              # freetype
566              # XML-Parser intltool hicolor-icon-theme gnome-icon-theme"
567              # gnome-doc-utils-fake gtk-doc \
568     process_modules
569     
570     # Setup glibtool* links since some stuff expects them to be named like 
571     # that on OSX
572     if [ -z $PREFIX/bin/glibtoolize ]; then
573         ln -s $PREFIX/bin/libtoolize $PREFIX/bin/glibtoolize
574         ln -s $PREFIX/bin/libtool $PREFIX/bin/glibtool
575     fi
577     echo
578     echo "Done bootstrapping. Continue with \"build\" or \"shell\"."
579     exit 0
580 fi
582 if [ "x$1" != xbuild ]; then
583     print_usage
584     exit 1
585 fi
587 shift
589 MODULES=$*
590 if [ $# -eq 0 ]; then
591     echo "Building core modules."
592     MODULES="$CORE_MODULES"
593 elif [ "x$1" = xcore ]; then
594     echo "Building core modules."
595     MODULES="$CORE_MODULES"
596 elif [ "x$1" = xpython ]; then
597     echo "Building python modules."
598     MODULES="$PYGTK_MODULES"
599 elif [ "x$1" = xall ]; then
600     echo "Building core+extra+python modules."
601     MODULES="$CORE_MODULES $EXTRA_MODULES $PYGTK_MODULES"
602 elif [ "x$1" = xinkscape ]; then
603     echo "Building inkscape modules."
604     MODULES="$INKSCAPE_MODULES"
605 fi
607 process_modules
608 echo "Done."