checkin of 0.3.0
[pspp-builds.git] / reconfigure
1 #! /bin/sh -e
2
3 nls=--disable-nls
4 clean=no
5 include_deps=yes
6
7 while true; do
8   if [ "$1" = "--enable-nls" ]; then
9     nls=
10   elif [ "$1" = "--disable-nls" ]; then
11     nls=--disable-nls
12   elif [ "$1" = "--clean" ]; then
13     clean=yes
14   elif [ "$1" = "--not-clean" ]; then
15     clean=no
16   elif [ "$1" = "--no-include-deps" ]; then
17     include_deps=no
18   elif [ "$1" = "--include-deps" ]; then
19     include_deps=yes
20   elif [ "$1" = "--help" ]; then
21     echo "Usage: $0 [--enable-nls] [--clean] [--include-deps] ..."
22     exit 0
23   else
24     break
25   fi
26   
27   shift
28 done
29
30 # Extract PSPP version number.
31 VERSION=`sed -ne 's/^.*\[//;s/].*$//;/^[0-9]*\.[0-9]*\.[0-9]*$/p' < configure.in`
32
33 if [ "$clean" = "no" ]; then
34   echo "Generating a Makefile for cleaning..."
35   if [ ! -f Makefile ]; then
36     aclocal
37     autoheader
38     make -f Makefile.am docfiles VERSION=$VERSION
39     automake --foreign
40     autoconf
41     ./configure $nls $*
42   fi
43   echo "Cleaning the distribution..."
44   make -k maintainer-clean || true
45 fi
46
47 echo "Configuring..."
48 aclocal
49 autoheader
50 make -f Makefile.am docfiles VERSION=$VERSION
51 automake
52 autoconf
53 ./configure $nls $*
54 make mostlyclean || true        # This causes dependencies to be generated
55
56 if [ "$include_deps" = "yes" ]; then
57   echo "Configuring with included dependencies..."
58   automake --include-deps
59   autoconf
60   ./configure $nls $*
61 fi