root/trunk/autogen.sh

Revision 117, 4.4 kB (checked in by mercyful, 3 years ago)

Enthral BBS Build 0.428 Alpha
Check ChangeLog? for all Updates.

  • Property svn:executable set to *
  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy Id
Line 
1                                                  #!/bin/bash
2have_automake=false
3have_aclocal=false
4have_autoheader=false
5have_autoconf=false
6
7echo "This script will detect (GNU Automake),"
8echo "Generate your multi-platform configure script."
9echo ""
10
11if automake --version < /dev/null > /dev/null 2>&1 ; then
12        automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
13        case $automake_version in
14           1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
15                ;;
16           *)
17                have_automake=true
18                ;;
19        esac
20fi
21
22if $have_automake ; then
23        AUTOMAKE="automake"
24else
25        if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
26                AUTOMAKE="automake-1.9"
27        elif automake19 --version < /dev/null > /dev/null 2>&1 ; then
28        AUTOMAKE="automake19"
29    else
30                echo "automake missing or too old. This requires atleast automake-1.9"
31                exit 1
32        fi
33fi
34
35
36if aclocal --version < /dev/null > /dev/null 2>&1 ; then
37    aclocal_version=`aclocal --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
38    case aclocal_version in
39       1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
40        ;;
41       *)
42        have_aclocal=true
43        ;;
44    esac
45fi
46
47if $have_aclocal ; then
48    ACLOCAL="aclocal"
49else
50    if aclocal-1.9 --version < /dev/null > /dev/null 2>&1 ; then
51        ACLOCAL="aclocal-1.9"
52    elif aclocal19 --version < /dev/null > /dev/null 2>&1 ; then
53        ACLOCAL="aclocal19"
54    else
55        echo "aclocal missing or too old. This requires atleast aclocal-1.9"
56        exit 1
57    fi
58fi
59
60echo running $ACLOCAL...
61$ACLOCAL --force
62if test "$?" != "0"; then
63        echo aclocal failed, stopping.
64        exit 2
65fi
66
67# Uses Normal name, no version number appended.
68echo running libtoolize...
69libtoolize --force
70if test "$?" != "0"; then
71        echo libtoolize failed, stopping.
72        exit 3
73fi
74
75# Detect Standard Autoheader
76if autoheader --version < /dev/null > /dev/null 2>&1 ; then
77    autoheader_version=`autoheader --version | grep 'Autoconf version' | sed 's/^[^0-9]*\(.*\)/\1/'`
78    case autoheader_version in
79       1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
80        ;;
81       *)
82        have_autoheader=true
83        ;;
84    esac
85fi
86
87# Detect Latest and Greatest Version first, then cycle down.
88if $have_autoheader ; then
89    AUTOHEADER="autoheader"
90else
91    if autoheader --version < /dev/null > /dev/null 2>&1 ; then
92        AUTOHEADER="autoheader"
93    elif autoheader-2.62 --version < /dev/null > /dev/null 2>&1 ; then
94        AUTOHEADER="autoheader-2.62"
95    elif autoheader259 --version < /dev/null > /dev/null 2>&1 ; then
96        AUTOHEADER="autoheader259"
97    elif autoheader213 --version < /dev/null > /dev/null 2>&1 ; then
98        AUTOHEADER="autoheader213"
99    else
100        echo "autoheader missing."
101        exit 1
102    fi
103fi
104
105echo running autoheader...
106$AUTOHEADER --force
107if test "$?" != "0"; then
108        echo autoheader failed, stopping.
109        exit 4
110fi
111
112# Make the Makefile(s)
113echo running $AUTOMAKE...
114$AUTOMAKE -a --foreign -f
115if test "$?" != "0"; then
116        echo automake failed, stopping.
117        exit 5
118fi
119
120# Detect Standard Autoheader
121if autoconf --version < /dev/null > /dev/null 2>&1 ; then
122    autoconf_version=`autoconf --version | grep 'Autoconf version' | sed 's/^[^0-9]*\(.*\)/\1/'`
123    case autoconf_version in
124       1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
125        ;;
126       *)
127        have_autoconf=true
128        ;;
129    esac
130fi
131
132# Detect Latest and Greatest Version first, then cycle down.
133if $have_autoconf ; then
134    AUTOCONF="autoconf"
135else
136    if autoconf --version < /dev/null > /dev/null 2>&1 ; then
137        AUTOCONF="autoconf"
138    elif autoheader-2.62 --version < /dev/null > /dev/null 2>&1 ; then
139        AUTOCONF="autoconf-2.62"
140    elif autoheader259 --version < /dev/null > /dev/null 2>&1 ; then
141        AUTOCONF="autoconf259"
142    elif autoheader213 --version < /dev/null > /dev/null 2>&1 ; then
143        AUTOCONF="autoconf213"
144    else
145        echo "autoconf missing."
146        exit 1
147    fi
148fi
149
150
151echo running autoconf...
152$AUTOCONF --force
153if test "$?" != "0"; then
154        echo autoconf failed, stopping.
155        exit 6
156fi
157
158echo if no errors occured, run ./configure
159exit 0
160
161#autogen.sh generates:
162#       aclocal.m4 Makefile.in config.guess config.sub ltmain.sh
163#
164#configure generates:
165#       config.status libtool Makefile.in
Note: See TracBrowser for help on using the browser.