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