4 # Find libtoolize. Prefer 1.x versions.
6 libtoolize=`conftools/PrintPath glibtoolize1 glibtoolize libtoolize libtoolize15 libtoolize14`
7 if [ "x$libtoolize" = "x" ]; then
8 echo "libtoolize not found in path"
13 # Create the libtool helper files
15 # Note: we copy (rather than link) the files.
17 # Note: This bundled version of expat will not always replace the
18 # files since we have a special config.guess/config.sub that we
19 # want to ensure is used.
20 echo "Copying libtool helper files ..."
22 # Remove any m4 cache and libtool files so one can switch between
23 # autoconf and libtool versions by simply rerunning the buildconf script.
25 m4files='lt~obsolete.m4 ltversion.m4 ltoptions.m4 argz.m4 ltsugar.m4 libtool.m4'
27 (cd conftools ; rm -f ltconfig ltmain.sh aclocal.m4 $m4files)
28 rm -rf autom4te*.cache aclocal.m4
30 $libtoolize --copy --automake
35 if [ ! -f libtool.m4 ]; then
36 ltpath=`dirname $libtoolize`
37 ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
38 if [ -f $ltfile ]; then
39 echo "libtool.m4 found at $ltfile"
40 cp $ltfile conftools/libtool.m4
42 echo "libtool.m4 not found - aborting!"
48 # Build aclocal.m4 from libtool's m4 files
50 echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf.sh" > aclocal.m4
51 echo "dnl edits here will be lost" >> aclocal.m4
53 for m4file in $m4files
55 m4file=conftools/$m4file
56 if [ -f $m4file ]; then
57 echo "Incorporating $m4file into aclocal.m4 ..."
58 cat $m4file >> aclocal.m4
63 cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
66 # Generate the autoconf header template (config.h.in) and ./configure
68 echo "Creating config.h.in ..."
69 ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
71 echo "Creating configure ..."
72 ### do some work to toss config.cache?
73 ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
75 # Remove autoconf caches
76 rm -rf autom4te*.cache aclocal.m4