1 |
#!/bin/sh |
#!/bin/sh |
2 |
# |
# |
3 |
|
# - Bootstrap script - |
4 |
|
# |
5 |
|
# Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr> |
6 |
|
# |
7 |
# This file builds the configure script and copies all needed files |
# This file builds the configure script and copies all needed files |
8 |
# provided by automake/libtoolize |
# provided by automake/libtoolize |
9 |
# |
# |
10 |
# NB: This script is adapted to Debian GNU/Linux SID program names |
# $Id$ |
11 |
# Perhaps you could have to modify program names to match your distro |
|
12 |
|
|
13 |
|
############################################################################## |
14 |
|
# Detect the right autoconf script |
15 |
|
############################################################################## |
16 |
|
|
17 |
|
# Find a suitable autoconf |
18 |
|
AUTOCONF="autoconf2.50" |
19 |
|
$AUTOCONF --version 1>/dev/null 2>&1 |
20 |
|
|
21 |
|
if [ $? -ne 0 ] ; then |
22 |
|
AUTOCONF="autoconf" |
23 |
|
$AUTOCONF --version 1>/dev/null 2>&1 |
24 |
|
|
25 |
|
if [ $? -ne 0 ] ; then |
26 |
|
echo "ERROR: 'autoconf' not found" |
27 |
|
exit -1 |
28 |
|
fi |
29 |
|
fi |
30 |
|
|
31 |
|
# Tests the autoconf version |
32 |
|
AC_VER=`$AUTOCONF --version | head -1 | sed 's/'^[^0-9]*'/''/'` |
33 |
|
AC_MAJORVER=`echo $AC_VER | cut -f1 -d'.'` |
34 |
|
AC_MINORVER=`echo $AC_VER | cut -f2 -d'.'` |
35 |
|
|
36 |
|
if [ "$AC_MAJORVER" -lt "2" ]; then |
37 |
|
echo "ERROR: This bootstrapper requires Autoconf >= 2.50 (detected $AC_VER)" |
38 |
|
exit -1 |
39 |
|
fi |
40 |
|
|
41 |
|
if [ "$AC_MINORVER" -lt "50" ]; then |
42 |
|
echo "ERROR: This bootstrapper requires Autoconf >= 2.50 (detected $AC_VER)" |
43 |
|
exit -1 |
44 |
|
fi |
45 |
|
|
46 |
|
LIBTOOLIZE="libtoolize" |
47 |
|
$LIBTOOLIZE --version 1>/dev/null 2>&1 |
48 |
|
|
49 |
|
if [ $? -ne 0 ] ; then |
50 |
|
LIBTOOLIZE="glibtoolize" |
51 |
|
$LIBTOOLIZE --version 1>/dev/null 2>&1 |
52 |
|
|
53 |
|
if [ $? -ne 0 ] ; then |
54 |
|
echo "ERROR: 'libtoolize' not found" |
55 |
|
exit -1 |
56 |
|
fi |
57 |
|
fi |
58 |
|
|
59 |
|
AUTOMAKE="automake" |
60 |
|
$AUTOMAKE --version 1>/dev/null 2>&1 |
61 |
|
|
62 |
|
if [ $? -ne 0 ] ; then |
63 |
|
echo "ERROR: 'automake' not found" |
64 |
|
exit -1 |
65 |
|
fi |
66 |
|
|
67 |
|
############################################################################## |
68 |
|
# Bootstraps the configure script |
69 |
|
############################################################################## |
70 |
|
|
71 |
echo "Creating ./configure" |
echo "Creating ./configure" |
72 |
autoconf2.50 |
$AUTOCONF |
73 |
|
|
74 |
echo "Copying files provided by automake" |
echo "Copying files provided by automake" |
75 |
automake -c -a 1>/dev/null 2>/dev/null |
$AUTOMAKE -c -a 1>/dev/null 2>&1 |
76 |
|
|
77 |
echo "Copying files provided by libtool" |
echo "Copying files provided by libtool" |
78 |
libtoolize -f -c 1>/dev/null 2>/dev/null |
$LIBTOOLIZE -f -c 1>/dev/null 2>&1 |
79 |
|
|
80 |
echo "Removing files that are not needed" |
echo "Removing files that are not needed" |
81 |
rm -rf autom4* |
rm -rf autom4* 1>/dev/null 2>&1 |
82 |
rm -rf ltmain.sh |
rm -rf ltmain.sh 1>/dev/null 2>&1 |