blob: e2ce5bb20048d400c1caebeb3373e873d6d5bfd9 [file] [log] [blame]
Emeric Vigier2f625822012-08-06 11:09:52 -04001#!/bin/sh
2# Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
3#
4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without
6# modifications, as long as this notice is preserved.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12WANT_AUTOCONF_2_5=1
13export WANT_AUTOCONF_2_5
14
15rm -rf autoconf auto*.cache libtool
16if test ! -d autoconf ; then mkdir autoconf ; fi
17
18libtoolize="libtoolize"
19for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
20 if test -x /usr/bin/$lt ; then
21 libtoolize=$lt ; break
22 fi
23 if test -x /usr/local/bin/$lt ; then
24 libtoolize=$lt ; break
25 fi
26done
27$libtoolize --copy --force
28
29AUTOMAKE_FLAGS=""
30case $libtoolize in
31*glibtoolize)
32 AUTOMAKE_FLAGS="-i"
33 ;;
34esac
35
36ACLOCALDIRS=""
37if test -d m4 ; then
38 ACLOCALDIRS="-I m4" ; fi
39
40if test ! -z "$ACLOCAL" ; then
41 ACLOCALDIRS="$ACLOCALDIRS -I"${ACLOCAL}
42elif test ! -z "$ACLOCAL_FLAGS" ; then
43 ACLOCALDIRS="$ACLOCALDIRS $ACLOCAL_FLAGS" ; fi
44
45reconf=""
46if test -f ~/.configure ; then
47 reconf=`grep ^reconfig: ~/.configure | sed -e s/^reconfig://`
48elif test -f /etc/configure.conf ; then
49 reconf=`grep ^reconfig: /etc/configure.conf | sed -e s/^reconfig://` ; fi
50if test ! -z "$reconf" ; then ACLOCALDIRS="$ACLOCALDIRS $reconf" ; fi
51
52if [ -d ~/share/aclocal ] ; then
53 ACLOCALDIRS="$ACLOCALDIRS -I ~/share/aclocal"
54elif [ -d /usr/local/share/aclocal ] ; then
55 ACLOCALDIRS="$ACLOCALDIRS -I /usr/local/share/aclocal"
56fi
57
58if test ! -z "$1" -o ! -z "${AUTOCONF_SUFFIX}" ; then
59 ver="$1"
60else
61 for v in 2.53 2.57 ; do
62 if test -f /usr/bin/autoconf-$v ; then
63 ver=$v
64 fi
65 done
66fi
67
68if test "$ver" = "2.53" -a -z "$AUTOMAKE_SUFFIX" ; then
69 if test -f /usr/bin/automake-1.5 ; then
70 AUTOMAKE_SUFFIX="-1.5"
71 fi
72fi
73
74aclocal${AUTOMAKE_SUFFIX} $ACLOCALDIRS
75
76if test -f /usr/bin/autoheader-$ver ; then
77 /usr/bin/autoheader-$ver
78else
79 autoheader${AUTOCONF_SUFFIX}
80fi
81
82automake${AUTOMAKE_SUFFIX} --add-missing --copy ${AUTOMAKE_FLAGS}
83
84if test -f /usr/bin/autoconf-$ver ; then
85 /usr/bin/autoconf-$ver
86else
87 autoconf${AUTOCONF_SUFFIX}
88fi
89rm -f config.cache
90
91# fix for some broken...
92
93if test -f /usr/bin/automake-1.4 ; then
94 if test -f ltmain.sh ; then
95 cp ltmain.sh autoconf/ltmain.sh
96 fi
97fi
98