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