2 # Run this to generate all the initial makefiles, etc.
7 # Allow invocation from a separate build directory; in that case, we change
8 # to the source directory to run the auto*, then change back before running configure
9 srcdir
=`dirname $ARGV0`
10 test -z "$srcdir" && srcdir
=.
17 LIBTOOLIZE_FLAGS
="--copy --force --automake"
18 ACLOCAL_FLAGS
="-I build"
19 AUTOHEADER
=${AUTOHEADER-autoheader}
20 GTKDOCIZE_FLAGS
="--copy"
21 GTKDOCIZE
=${GTKDOCIZE-gtkdocize}
22 AUTOMAKE_FLAGS
="--add-missing --gnu -Wall"
23 AUTOCONF
=${AUTOCONF-autoconf}
26 test -f configure.ac
&& CONFIGURE_AC
=configure.ac
28 if test "X$CONFIGURE_AC" = X
; then
29 echo "$ARGV0: ERROR: No $srcdir/configure.in or $srcdir/configure.ac found."
34 grep "^ *$1" "$CONFIGURE_AC" |
sed 's/.*(\[*\([^])]*\)]*).*/\1/'
37 autoconf_min_vers
=`extract_version AC_PREREQ`
38 automake_min_vers
=`extract_version AM_INIT_AUTOMAKE`
39 libtoolize_min_vers
=`extract_version AC_PROG_LIBTOOL`
40 aclocal_min_vers
=$automake_min_vers
43 # Not all echo versions allow -n, so we check what is possible. This test is
44 # based on the one in autoconf.
45 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
52 # some terminal codes ...
53 boldface
="`tput bold 2>/dev/null || true`"
54 normal
="`tput sgr0 2>/dev/null || true`"
56 echo $ECHO_N "$boldface"
58 echo $ECHO_N "$normal"
66 # compare_versions MIN_VERSION ACTUAL_VERSION
67 # returns true if ACTUAL_VERSION >= MIN_VERSION
72 IFS
="${IFS= }"; ch_save_IFS
="$IFS"; IFS
="."
73 set $ch_actual_version
74 for ch_min
in $ch_min_version; do
75 ch_cur
=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
76 if [ -z "$ch_min" ]; then break; fi
77 if [ -z "$ch_cur" ]; then ch_status
=1; break; fi
78 if [ $ch_cur -gt $ch_min ]; then break; fi
79 if [ $ch_cur -lt $ch_min ]; then ch_status
=1; break; fi
86 # version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
87 # checks to see if the package is available
96 vc_checkprog
=`eval echo "\\$$vc_variable"`
97 if [ -n "$vc_checkprog" ]; then
98 printbold
"using $vc_checkprog for $vc_package"
102 printbold
"checking for $vc_package >= $vc_min_version..."
103 for vc_checkprog
in $vc_checkprogs; do
104 echo $ECHO_N " testing $vc_checkprog... "
105 if $vc_checkprog --version < /dev
/null
> /dev
/null
2>&1; then
106 vc_actual_version
=`$vc_checkprog --version | head -n 1 | \
107 sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'`
108 if compare_versions
$vc_min_version $vc_actual_version; then
109 echo "found $vc_actual_version"
111 eval "$vc_variable=$vc_checkprog"
115 echo "too old (found version $vc_actual_version)"
121 if [ "$vc_status" != 0 ]; then
122 printerr
"***Error***: You must have $vc_package >= $vc_min_version installed"
123 printerr
" to build $PROJECT. Download the appropriate package for"
124 printerr
" from your distribution or get the source tarball at"
125 printerr
" $vc_source"
132 version_check autoconf AUTOCONF
$AUTOCONF $autoconf_min_vers \
133 "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-${autoconf_min_vers}.tar.gz" || DIE
=1
136 # Hunt for an appropriate version of automake and aclocal; we can't
137 # assume that 'automake' is necessarily the most recent installed version
139 # We check automake first to allow it to be a newer version than we know about.
141 version_check automake AUTOMAKE
"$AUTOMAKE automake automake-1.10 automake-1.9 automake-1.8 automake-1.7" $automake_min_vers \
142 "http://ftp.gnu.org/pub/gnu/automake/automake-${automake_min_vers}.tar.gz" || DIE
=1
143 ACLOCAL
=`echo $AUTOMAKE | sed s/automake/aclocal/`
146 version_check libtool LIBTOOLIZE
"$LIBTOOLIZE glibtoolize libtoolize" $libtoolize_min_vers \
147 "http://ftp.gnu.org/pub/gnu/libtool/libtool-${libtool_min_vers}.tar.gz" || DIE
=1
149 if test -n "$DIE"; then
154 if test -z "$*"; then
155 echo "$ARGV0: Note: \`./configure' will be run with no arguments."
156 echo " If you wish to pass any to it, please specify them on the"
157 echo " \`$0' command line."
162 echo "$ARGV0: running \`$@'"
166 do_cmd
$LIBTOOLIZE $LIBTOOLIZE_FLAGS
168 do_cmd
$ACLOCAL $ACLOCAL_FLAGS
172 # create dummy */Makefile.am.features and ChangeLog to make automake happy
173 > boilerplate
/Makefile.am.features
174 > src
/Makefile.am.features
177 # We don't call gtkdocize right now. When we do, we should then modify
178 # the generated gtk-doc.make and move it to build/Makefile.am.gtk-doc.
179 # See that file for details.
180 #do_cmd $GTKDOCIZE $GTKDOCIZE_FLAGS
182 do_cmd
$AUTOMAKE $AUTOMAKE_FLAGS
186 cd "$ORIGDIR" ||
exit 1
190 do_cmd
$srcdir/configure \
191 --cache-file=config.cache \
193 --enable-test-surfaces \
194 ${1+"$@"} && echo "Now type \`make' to compile $PROJECT." ||
exit 1
196 # Run this to generate all the initial makefiles, etc.
201 # Allow invocation from a separate build directory; in that case, we change
202 # to the source directory to run the auto*, then change back before running configure
203 srcdir
=`dirname $ARGV0`
204 test -z "$srcdir" && srcdir
=.
211 LIBTOOLIZE
=${LIBTOOLIZE-libtoolize}
212 LIBTOOLIZE_FLAGS
="--copy --force"
213 AUTOHEADER
=${AUTOHEADER-autoheader}
214 AUTOMAKE_FLAGS
="--add-missing --foreign"
215 AUTOCONF
=${AUTOCONF-autoconf}
218 test -f configure.
in && CONFIGURE_IN
=configure.
in
219 test -f configure.ac
&& CONFIGURE_IN
=configure.ac
221 if test "X$CONFIGURE_IN" = X
; then
222 echo "$ARGV0: ERROR: No $srcdir/configure.in or $srcdir/configure.ac found."
227 grep "^ *$1" $CONFIGURE_IN |
sed 's/.*(\[*\([^])]*\)]*).*/\1/'
230 autoconf_min_vers
=`extract_version AC_PREREQ`
231 automake_min_vers
=`extract_version AM_INIT_AUTOMAKE`
232 libtoolize_min_vers
=`extract_version AC_PROG_LIBTOOL`
233 aclocal_min_vers
=$automake_min_vers
236 # Not all echo versions allow -n, so we check what is possible. This test is
237 # based on the one in autoconf.
238 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
245 # some terminal codes ...
246 boldface
="`tput bold 2>/dev/null || true`"
247 normal
="`tput sgr0 2>/dev/null || true`"
249 echo $ECHO_N "$boldface"
251 echo $ECHO_N "$normal"
259 # compare_versions MIN_VERSION ACTUAL_VERSION
260 # returns true if ACTUAL_VERSION >= MIN_VERSION
265 IFS
="${IFS= }"; ch_save_IFS
="$IFS"; IFS
="."
266 set $ch_actual_version
267 for ch_min
in $ch_min_version; do
268 ch_cur
=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
269 if [ -z "$ch_min" ]; then break; fi
270 if [ -z "$ch_cur" ]; then ch_status
=1; break; fi
271 if [ $ch_cur -gt $ch_min ]; then break; fi
272 if [ $ch_cur -lt $ch_min ]; then ch_status
=1; break; fi
279 # version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
280 # checks to see if the package is available
289 vc_checkprog
=`eval echo "\\$$vc_variable"`
290 if [ -n "$vc_checkprog" ]; then
291 printbold
"using $vc_checkprog for $vc_package"
295 printbold
"checking for $vc_package >= $vc_min_version..."
296 for vc_checkprog
in $vc_checkprogs; do
297 echo $ECHO_N " testing $vc_checkprog... "
298 if $vc_checkprog --version < /dev
/null
> /dev
/null
2>&1; then
299 vc_actual_version
=`$vc_checkprog --version | head -n 1 | \
300 sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'`
301 if compare_versions
$vc_min_version $vc_actual_version; then
302 echo "found $vc_actual_version"
304 eval "$vc_variable=$vc_checkprog"
308 echo "too old (found version $vc_actual_version)"
314 if [ "$vc_status" != 0 ]; then
315 printerr
"***Error***: You must have $vc_package >= $vc_min_version installed"
316 printerr
" to build $PROJECT. Download the appropriate package for"
317 printerr
" from your distribution or get the source tarball at"
318 printerr
" $vc_source"
325 version_check autoconf AUTOCONF
$AUTOCONF $autoconf_min_vers \
326 "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-${autoconf_min_vers}.tar.gz" || DIE
=1
329 # Hunt for an appropriate version of automake and aclocal; we can't
330 # assume that 'automake' is necessarily the most recent installed version
332 # We check automake first to allow it to be a newer version than we know about.
334 version_check automake AUTOMAKE
"$AUTOMAKE automake automake-1.10 automake-1.9 automake-1.8 automake-1.7" $automake_min_vers \
335 "http://ftp.gnu.org/pub/gnu/automake/automake-${automake_min_vers}.tar.gz" || DIE
=1
336 ACLOCAL
=`echo $AUTOMAKE | sed s/automake/aclocal/`
339 version_check libtool LIBTOOLIZE
$LIBTOOLIZE $libtoolize_min_vers \
340 "http://ftp.gnu.org/pub/gnu/libtool/libtool-${libtool_min_vers}.tar.gz" || DIE
=1
342 if test -z "$ACLOCAL_FLAGS"; then
343 acdir
=`$ACLOCAL --print-ac-dir`
344 if [ ! -f $acdir/pkg.
m4 ]; then
345 echo "$ARGV0: Error: Could not find pkg-config macros."
346 echo " (Looked in $acdir/pkg.m4)"
347 echo " If pkg.m4 is available in /another/directory, please set"
348 echo " ACLOCAL_FLAGS=\"-I /another/directory\""
349 echo " Otherwise, please install pkg-config."
351 echo "pkg-config is available from:"
352 echo "http://www.freedesktop.org/software/pkgconfig/"
357 if test "X$DIE" != X
; then
362 if test -z "$*"; then
363 echo "$ARGV0: Note: \`./configure' will be run with no arguments."
364 echo " If you wish to pass any to it, please specify them on the"
365 echo " \`$0' command line."
370 echo "$ARGV0: running \`$@'"
374 do_cmd
$LIBTOOLIZE $LIBTOOLIZE_FLAGS
376 do_cmd
$ACLOCAL $ACLOCAL_FLAGS
380 do_cmd
$AUTOMAKE $AUTOMAKE_FLAGS
384 cd $ORIGDIR ||
exit 1
388 #do_cmd $srcdir/configure \
389 # --cache-file=config.cache \
392 # --enable-test-surfaces \
393 # ${1+"$@"} && echo "Now type \`make' to compile $PROJECT." || exit 1