2 # Run this to generate all the initial makefiles, etc.
3 # It is only needed for the CVS version.
5 # have_version(prog, list of executables, required version)
7 # Returns true and sets $prog to the first executable with the
8 # required minimum major.minor.
15 ver=$($prog --version \
16 | gawk '{ if (match($0, /[0-9]+\.[0-9]+/))
18 print substr($0, RSTART, RLENGTH); ok=1; exit 0;
29 if expr 0$ver '>=' 0$3 >/dev/null 2>&1
43 echo "*** Error. Could not find an appropriate executable for $1 with "
44 echo "at least version $3."
57 if test "$1" = "--build-w32"; then
60 if [ ! -f ./config.guess ]; then
61 echo "./config.guess not found" >&2
66 if ! mingw32 --version >/dev/null; then
67 echo "We need at least version 0.3 of MingW32/CPD" >&2
71 if [ -f config.h ]; then
72 if grep HAVE_DOSISH_SYSTEM config.h | grep undef >/dev/null; then
73 echo "Pease run a 'make distclean' first" >&2
78 crossinstalldir=`mingw32 --install-dir`
79 crossbindir=`mingw32 --get-bindir 2>/dev/null` \
80 || crossbindir="$crossinstalldir/bin"
81 crossdatadir=`mingw32 --get-datadir 2>/dev/null` \
82 || crossdatadir="$crossinstalldir/share"
83 crosslibdir=`mingw32 --get-libdir 2>/dev/null` \
84 || crosslibdir="$crossinstalldir/i386--mingw32/lib"
85 crossincdir=`mingw32 --get-includedir 2>/dev/null` \
86 || crossincdir="$crossinstalldir/i386--mingw32/include"
87 CC=`mingw32 --get-path gcc`
88 CPP=`mingw32 --get-path cpp`
89 AR=`mingw32 --get-path ar`
90 RANLIB=`mingw32 --get-path ranlib`
91 export CC CPP AR RANLIB
94 if [ -n "$lib_config_files" ]; then
95 for i in $lib_config_files; do
96 j=`echo $i | tr '[a-z-]' '[A-Z_]'`
97 eval "$j=${crossbindir}/$i"
99 disable_foo_tests="$disable_foo_tests --disable-`echo $i| \
100 sed 's,-config$,,'`-test"
101 if [ ! -f "${crossbindir}/$i" ]; then
102 echo "$i not installed for MingW32" >&2
107 [ $DIE = yes ] && exit 1
109 ./configure --host=${host} --target=${target} ${disable_foo_tests} \
110 --bindir=${crossbindir} --libdir=${crosslibdir} \
111 --datadir=${crossdatadir} --includedir=${crossincdir} \
112 --enable-maintainer-mode $*
116 if ! have_version autoconf "$autoconf autoconf" $autoconf_vers
121 if have_version automake "$automake automake automake-1.6" $automake_vers
123 if ! have_version aclocal "$aclocal aclocal aclocal-1.6" $aclocal_vers
131 #if (libtool --version) < /dev/null > /dev/null 2>&1 ; then
132 # if (libtool --version | awk 'NR==1 { if( $4 >= '$libtool_vers') \
133 # exit 1; exit 0; }');
135 # echo "**Error**: "\`libtool\'" is too old."
136 # echo ' (version ' $libtool_vers ' or newer is required)'
141 # echo "**Error**: You must have "\`libtool\'" installed to compile $PGM."
142 # echo ' (version ' $libtool_vers ' or newer is required)'
146 if test "$DIE" = "yes"; then
150 #echo "Running libtoolize... Ignore non-fatal messages."
151 #echo "no" | libtoolize
153 echo "Running autopoint"
156 echo "Running $aclocal -I m4"
158 echo "Running autoheader..."
160 echo "Running $automake --gnu -a"
162 echo "Running $autoconf"