root/source/autogen.sh

Revision 176, 4.6 kB (checked in by frank, 18 months ago)

Updated OS X build to latest source (429)

Added Darwin code to autogen.sh

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