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