This repository has been archived by the owner on Jun 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogen.sh
executable file
·136 lines (119 loc) · 3.09 KB
/
autogen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/sh
rm -fr autom4te.cache
for libtoolize in glibtoolize libtoolize ; do
LIBTOOLIZE=`which $libtoolize 2>/dev/null`
if test "$LIBTOOLIZE" ; then
break;
fi
done
LIBTOOLIZE="$libtoolize --force --copy --automake"
# set up environment variables with the correct
# version of autoconf and automake - this also needs
# to be done in configure.ac to maintain consistancy
. ./autoversion.sh
touch AUTHORS ChangeLog NEWS README
# Discover what version of autoconf we are using.
autoconfversion=`$AUTOCONF --version | head -n 1`
automakeversion=`$AUTOMAKE --version | head -n 1`
libtoolversion=`$LIBTOOLIZE --version | head -n 1`
echo "Using $autoconfversion"
echo "Using $automakeversion"
echo "Using $libtoolversion"
case $autoconfversion in
*2.59 | *2.[6-9]? | 2.???)
;;
*)
echo "This autoconf version is not supported by SNS Common Libraries."
echo "SNS Common Libraries only supports autoconf 2.59."
echo "You may download it from ftp://ftp.gnu.org/gnu/autoconf"
exit
;;
esac
case $automakeversion in
*1.9.[4-9] | *1.9.?? | *1.1[0-9]*)
;;
*)
echo "This automake version is not supported by SNS Common Libraries."
echo "SNS Common Libraries only supports automake 1.9.4 and up."
echo "You may download it from ftp://ftp.gnu.org/gnu/automake"
exit
;;
esac
case $libtoolversion in
*1.5.?? | *[2-9].*)
;;
*)
echo "This libtool version is not supported by SNS Common Libraries."
echo "SNS Common Libraries only supports libtool 1.5.10 and up."
echo "You may download it from ftp://ftp.gnu.org/gnu/libtool"
exit
;;
esac
echo -n "Locating GNU m4... "
GNUM4=
for prog in $M4 gm4 gnum4 m4; do
# continue if $prog generates error (e.g. does not exist)
( $prog --version ) < /dev/null > /dev/null 2>&1
if test $? -ne 0 ; then continue; fi
# /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
case `$prog --version < /dev/null 2>&1` in
*GNU*) GNUM4=$prog
break ;;
esac
done
if test x$GNUM4 = x ; then
echo "not found."
exit
else
echo `which $GNUM4`
fi
#
if { test ! -d config ; } ; then
mkdir config ;
else
rm -rf config/* ;
fi
# Prepare the use of libtool
if ( $LIBTOOLIZE --version ) < /dev/null > /dev/null 2>&1 ; then
echo "Preparing the use of libtool ..."
$LIBTOOLIZE
if { test -r ltmain.sh ; } ; then mv ltmain.sh config/ ; fi
echo "done."
else
echo "libtoolize not found -- aborting"
exit
fi
# Generate the Makefiles and configure files
if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
echo "Building macros..."
$ACLOCAL
echo "done."
else
echo "aclocal not found -- aborting"
exit
fi
if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
echo "Building config header template..."
$AUTOHEADER
echo "done."
else
echo "autoheader not found -- aborting"
exit
fi
if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
echo "Building Makefile templates..."
$AUTOMAKE
echo "done."
else
echo "automake not found -- aborting"
exit
fi
if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
echo "Building configure..."
$AUTOCONF
echo "done."
else
echo "autoconf not found -- aborting"
exit
fi
# $Id$