]> git.pld-linux.org Git - projects/rc-scripts.git/blame - autogen.sh
ensure changelog is fresh for make dist
[projects/rc-scripts.git] / autogen.sh
CommitLineData
7e04fe0e 1#!/bin/sh
2# Run this to generate all the initial makefiles, etc.
3
4srcdir=`dirname $0`
5test -z "$srcdir" && srcdir=.
6
86734c0c 7PKG_NAME="PLD Linux Distribution rc-scripts"
7e04fe0e 8
5c07d946
AM
9cd "$srcdir"
10
46d018dd 11
18f80877 12(test -f $srcdir/configure.ac \
7e04fe0e 13 && test -d $srcdir/src) || {
14 echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
15 echo " top-level rc-scripts directory"
16
17 exit 1
18}
19
20DIE=0
21
22(autoconf --version) < /dev/null > /dev/null 2>&1 || {
23 echo
972964bb 24 echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
7e04fe0e 25 echo "Download the appropriate package for your distribution,"
26 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
27 DIE=1
28}
29
18f80877 30(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
7e04fe0e 31 (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
32 echo
972964bb 33 echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
763b88c2 34 echo "Get ftp://alpha.gnu.org/gnu/libtool/libtool-1.4b.tar.gz"
7e04fe0e 35 echo "(or a newer version if it is available)"
36 DIE=1
37 }
38}
39
18f80877
AM
40grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
41 grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
7e04fe0e 42 (gettextize --version) < /dev/null > /dev/null 2>&1 || {
43 echo
972964bb 44 echo "**Error**: You must have \`gettext' installed to compile $PKG_NAME."
763b88c2 45 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.38.tar.gz"
7e04fe0e 46 echo "(or a newer version if it is available)"
47 DIE=1
48 }
49}
50
51(automake --version) < /dev/null > /dev/null 2>&1 || {
52 echo
972964bb 53 echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
763b88c2 54 echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p4.tar.gz"
7e04fe0e 55 echo "(or a newer version if it is available)"
56 DIE=1
57 NO_AUTOMAKE=yes
58}
59
60
61# if no automake, don't bother testing for aclocal
62test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
63 echo
64 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
65 echo "installed doesn't appear recent enough."
763b88c2 66 echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p4.tar.gz"
7e04fe0e 67 echo "(or a newer version if it is available)"
68 DIE=1
69}
70
71if test "$DIE" -eq 1; then
72 exit 1
73fi
74
75if test -z "$*"; then
76 echo "**Warning**: I am going to run \`configure' with no arguments."
77 echo "If you wish to pass any to it, please specify them on the"
78 echo \`$0\'" command line."
79 echo
80fi
81
82case $CC in
83xlc )
84 am_opt=--include-deps;;
85esac
86
18f80877 87for coin in `find $srcdir -name configure.ac -print`
7e04fe0e 88do
89 dr=`dirname $coin`
90 if test -f $dr/NO-AUTO-GEN; then
91 echo skipping $dr -- flagged as no auto-gen
92 else
93 echo processing $dr
94 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
95 ( cd $dr
96 aclocalinclude="$ACLOCAL_FLAGS"
97 for k in $macrodirs; do
98 if test -d $k; then
99 aclocalinclude="$aclocalinclude -I $k"
100 ##else
101 ## echo "**Warning**: No such directory \`$k'. Ignored."
102 fi
103 done
18f80877
AM
104 if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then
105 if grep "sed.*POTFILES" configure.ac >/dev/null; then
106 : do nothing -- we still have an old unmodified configure.ac
7e04fe0e 107 else
108 echo "Creating $dr/aclocal.m4 ..."
109 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
110 echo "Running gettextize... Ignore non-fatal messages."
111 echo "no" | gettextize --force --copy
112 echo "Making $dr/aclocal.m4 writable ..."
113 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
114 fi
115 fi
18f80877 116 if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
7e04fe0e 117 echo "Running libtoolize..."
118 libtoolize --force --copy
119 fi
120 echo "Running aclocal $aclocalinclude ..."
121 aclocal $aclocalinclude
a9cf954e 122 if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then
7e04fe0e 123 echo "Running autoheader..."
124 autoheader
125 fi
7e04fe0e 126 echo "Running autoconf ..."
127 autoconf
763b88c2
AM
128 echo "Running automake --gnu $am_opt ..."
129 automake --add-missing --gnu $am_opt
7e04fe0e 130 )
131 fi
132done
133
9addeedb 134conf_flags="" #--enable-maintainer-mode --enable-compile-warnings --enable-iso-c
7e04fe0e 135
136if test x$NOCONFIGURE = x; then
137 echo Running $srcdir/configure $conf_flags "$@" ...
138 $srcdir/configure $conf_flags "$@" \
139 && echo Now type \`make\' to compile $PKG_NAME
140else
141 echo Skipping configure process.
142fi
This page took 0.731285 seconds and 4 git commands to generate.