2 # Run this to generate all the initial makefiles,
3 # etc. just after a checkout.
7 if ${MAKE:-gmake} -q -C . autogen.sh 2> /dev/null
9 alias make=${MAKE:-gmake}
14 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
16 echo "**Error**: You must have \`autoconf' installed to compile tinc."
17 echo "Download the appropriate package for your distribution,"
18 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
22 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
23 (libtool --version) < /dev/null > /dev/null 2>&1 || {
25 echo "**Error**: You must have \`libtool' installed to compile tinc."
26 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
27 echo "(or a newer version if it is available)"
32 grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
33 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
34 (gettext --version) < /dev/null > /dev/null 2>&1 || {
36 echo "**Error**: You must have \`gettext' installed to compile tinc."
37 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
38 echo "(or a newer version if it is available)"
43 grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
44 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
45 (gettext --version) < /dev/null > /dev/null 2>&1 || {
47 echo "**Error**: You must have \`gettext' installed to compile tinc."
48 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
49 echo "(or a newer version if it is available)"
54 (automake --version) < /dev/null > /dev/null 2>&1 || {
56 echo "**Error**: You must have \`automake' installed to compile tinc."
57 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
58 echo "(or a newer version if it is available)"
64 # if no automake, don't bother testing for aclocal
65 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
67 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
68 echo "installed doesn't appear recent enough."
69 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
70 echo "(or a newer version if it is available)"
74 if test "$DIE" -eq 1; then
79 echo "**Warning**: I am going to run \`configure' with no arguments."
80 echo "If you wish to pass any to it, please specify them on the"
81 echo \`$0\'" command line."
87 am_opt=--include-deps;;
90 for coin in `find $srcdir -name configure.in -print`
93 if test -f $dr/NO-AUTO-GEN; then
94 echo skipping $dr -- flagged as no auto-gen
97 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
99 aclocalinclude="$ACLOCAL_FLAGS"
100 for k in $macrodirs; do
102 if test -f $k/Makefile.am.in; then
103 make -C $k -f Makefile.am.in Makefile.am
105 aclocalinclude="$aclocalinclude -I $k"
107 ## echo "**Warning**: No such directory \`$k'. Ignored."
111 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
112 if grep "sed.*POTFILES" configure.in >/dev/null; then
113 : do nothing -- we still have an old unmodified configure.in
115 echo "Creating $dr/aclocal.m4 ..."
116 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
117 echo "Running gettextize... Ignore non-fatal messages."
118 echo "no" | gettextize --force --copy
119 echo "Making $dr/aclocal.m4 writable ..."
120 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
123 if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
124 echo "Creating $dr/aclocal.m4 ..."
125 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
126 echo "Running gettextize... Ignore non-fatal messages."
127 echo "no" | gettextize --force --copy
128 echo "Making $dr/aclocal.m4 writable ..."
129 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
131 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
132 echo "Running libtoolize..."
133 libtoolize --force --copy
135 echo "Running aclocal $aclocalinclude ..."
136 aclocal $aclocalinclude
137 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
138 echo "Running autoheader..."
141 echo "Running automake --gnu $am_opt ..."
142 automake --add-missing --gnu $am_opt
143 echo "Running autoconf ..."
149 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
151 if test x$NOCONFIGURE = x; then
152 echo Running $srcdir/configure $conf_flags "$@" ...
153 $srcdir/configure $conf_flags "$@" \
154 && echo Now type \`make\' to compile $PKG_NAME || exit 1
156 echo Skipping configure process.