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