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