(Debian) dpatch: debian/patches/412786_xmlwf_man_standard_fix.dpatch
[mirror-ossqm-expat.git] / buildconf.sh
blob3db2f0c2747dbc75bfbe726c05f1fa5649c4b7fc
1 #! /bin/sh
3 #--------------------------------------------------------------------------
4 # autoconf 2.52 or newer
6 ac_version="`${AUTOCONF:-autoconf} --version 2> /dev/null | head -1 | sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`"
7 if test -z "$ac_version"; then
8 echo "ERROR: autoconf not found."
9 echo " You need autoconf version 2.52 or newer installed."
10 exit 1
12 IFS=.; set $ac_version; IFS=' '
13 if test "$1" = "2" -a "$2" -lt "52" || test "$1" -lt "2"; then
14 echo "ERROR: autoconf version $ac_version found."
15 echo " You need autoconf version 2.52 or newer installed."
16 exit 1
19 echo "found: autoconf version $ac_version (ok)"
21 #--------------------------------------------------------------------------
22 # libtool 1.4 or newer
26 # find libtoolize, or glibtoolize on MacOS X
28 libtoolize=`conftools/PrintPath glibtoolize libtoolize`
29 if [ "x$libtoolize" = "x" ]; then
30 echo "ERROR: libtoolize not found."
31 echo " You need libtool version 1.4 or newer installed"
32 exit 1
35 lt_pversion="`$libtoolize --version 2> /dev/null | sed -e 's/^[^0-9]*//'`"
37 # convert something like 1.4p1 to 1.4.p1
38 lt_version="`echo $lt_pversion | sed -e 's/\([a-z]*\)$/.\1/'`"
40 IFS=.; set $lt_version; IFS=' '
41 if test "$1" = "1" -a "$2" -lt "4"; then
42 echo "ERROR: libtool version $lt_pversion found."
43 echo " You need libtool version 1.4 or newer installed"
44 exit 1
47 echo "found: libtool version $lt_pversion (ok)"
49 #--------------------------------------------------------------------------
51 # Remove any libtool files so one can switch between libtool 1.3
52 # and libtool 1.4 by simply rerunning the buildconf script.
53 (cd conftools/; rm -f ltmain.sh ltconfig)
56 # Create the libtool helper files
58 echo "Copying libtool helper files ..."
61 # Note: we don't use --force (any more) since we have a special
62 # config.guess/config.sub that we want to ensure is used.
64 # --copy to avoid symlinks; we want originals for the distro
65 # --automake to make it shut up about "things to do"
67 $libtoolize --force --automake
70 # Find the libtool.m4 file. The developer/packager can set the LIBTOOL_M4
71 # environment variable to specify its location. If that variable is not
72 # set, then we'll assume a "standard" libtool installation and try to
73 # derive its location.
75 ltpath=`dirname $libtoolize`
76 ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
78 echo "Using libtool.m4 from ${ltfile}."
80 #--------------------------------------------------------------------------
82 ### for a little while... remove stray aclocal.m4 files from
83 ### developers' working copies. we no longer use it. (nothing else
84 ### will remove it, and leaving it creates big problems)
85 rm -f aclocal.m4
87 ${ACLOCAL:-aclocal} --force
90 # Generate the autoconf header template (expat_config.h.in) and ./configure
92 echo "Creating expat_config.h.in ..."
93 ${AUTOHEADER:-autoheader} --force
95 echo "Creating configure ..."
96 ### do some work to toss config.cache?
97 ${AUTOCONF:-autoconf} --force
99 # toss this; it gets created by autoconf on some systems
100 rm -rf autom4te*.cache
102 # exit with the right value, so any calling script can continue
103 exit 0