]> git.pld-linux.org Git - projects/rc-scripts.git/blob - autogen.sh
0b6b4fb49cb57448ad312782cf6aee265d1fc021
[projects/rc-scripts.git] / autogen.sh
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 cd "$srcdir"
9
10 PKG_NAME="PLD Linux Distribution rc-scripts"
11
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     
21 (test -f $srcdir/configure.ac \
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
33   echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
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
39 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
40   (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
41     echo
42     echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
43     echo "Get ftp://alpha.gnu.org/gnu/libtool/libtool-1.4b.tar.gz"
44     echo "(or a newer version if it is available)"
45     DIE=1
46   }
47 }
48
49 grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
50   grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
51   (gettextize --version) < /dev/null > /dev/null 2>&1 || {
52     echo
53     echo "**Error**: You must have \`gettext' installed to compile $PKG_NAME."
54     echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.38.tar.gz"
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
62   echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
63   echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p4.tar.gz"
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."
75   echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p4.tar.gz"
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
96 for coin in `find $srcdir -name configure.ac -print`
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
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
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
125       if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
126         echo "Running libtoolize..."
127         libtoolize --force --copy
128       fi
129       echo "Running aclocal $aclocalinclude ..."
130       aclocal $aclocalinclude
131       if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
132         echo "Running autoheader..."
133         autoheader
134       fi
135       echo "Running autoconf ..."
136       autoconf
137       echo "Running automake --gnu $am_opt ..."
138       automake --add-missing --gnu $am_opt
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
This page took 0.154453 seconds and 3 git commands to generate.