#!/bin/sh

glibdir=`pwd`/glib
libidldir=`pwd`/libIDL

echo "**********************************************"
echo "The libs needed by Mozilla will go in"
echo "$glibdir"
echo "and"
echo "$libidldir"
echo "Are you sure this is where you want them?"
echo "(press ctrl-c and move this stuff to another"
echo "location or press enter to continue)"
echo "**********************************************"
read

# build glib first
rm -rf $glibdir
mkdir $glibdir
cd glib-1.2.3
rm config.cache
make clean
./configure --prefix=$glibdir
make
make install
cd ..

# build libIDL next
rm -rf $libidldir
mkdir $libidldir
cd libIDL-0.6.5
rm config.cache
make clean
./configure --prefix=$libidldir --with-glib-prefix=$glibdir
make
make install
cd ..


echo "**********************************************"
echo "The support libraries have been built and"
echo "installed, please set these environment"
echo "vabiables before running the main Mozilla"
echo "'configure' script:"
echo "export GLIB_CONFIG=$glibdir/bin/glib-config"
echo "export LIBIDL_CONFIG=$libidldir/bin/libIDL-config"
echo "**********************************************"
