]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # $Id$ | |
3 | # Run this to generate all the initial makefiles, etc. | |
4 | ||
5 | srcdir=`dirname $0` | |
6 | test -z "$srcdir" && srcdir=. | |
7 | ||
8 | PKG_NAME="PLD Linux Distribution rc-scripts" | |
9 | ||
10 | if [ "$1" = "changelog" ]; then | |
11 | ./changelog.sh | |
12 | exit 0 | |
13 | fi | |
14 | ||
15 | cd "$srcdir" | |
16 | ||
17 | ||
18 | (test -f $srcdir/configure.ac \ | |
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 | |
30 | echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME." | |
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 | ||
36 | (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { | |
37 | (libtoolize --version) < /dev/null > /dev/null 2>&1 || { | |
38 | echo | |
39 | echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME." | |
40 | echo "Get ftp://alpha.gnu.org/gnu/libtool/libtool-1.4b.tar.gz" | |
41 | echo "(or a newer version if it is available)" | |
42 | DIE=1 | |
43 | } | |
44 | } | |
45 | ||
46 | grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && { | |
47 | grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \ | |
48 | (gettextize --version) < /dev/null > /dev/null 2>&1 || { | |
49 | echo | |
50 | echo "**Error**: You must have \`gettext' installed to compile $PKG_NAME." | |
51 | echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.38.tar.gz" | |
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 | |
59 | echo "**Error**: You must have \`automake' installed to compile $PKG_NAME." | |
60 | echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p4.tar.gz" | |
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." | |
72 | echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p4.tar.gz" | |
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 | ||
93 | for coin in `find $srcdir -name configure.ac -print` | |
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 | |
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 | |
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 | |
122 | if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then | |
123 | echo "Running libtoolize..." | |
124 | libtoolize --force --copy | |
125 | fi | |
126 | echo "Running aclocal $aclocalinclude ..." | |
127 | aclocal $aclocalinclude | |
128 | if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then | |
129 | echo "Running autoheader..." | |
130 | autoheader | |
131 | fi | |
132 | echo "Running autoconf ..." | |
133 | autoconf | |
134 | echo "Running automake --gnu $am_opt ..." | |
135 | automake --add-missing --gnu $am_opt | |
136 | ) | |
137 | fi | |
138 | done | |
139 | ||
140 | conf_flags="" #--enable-maintainer-mode --enable-compile-warnings --enable-iso-c | |
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 |