forked from opencog/link-grammar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·98 lines (83 loc) · 2.38 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
#!/bin/sh
#
# Run this before configure
#
# This file blatantly ripped off from subversion.
#
# Note: this dependency on Perl is fine: only developers use autogen.sh
# and we can state that dev people need Perl on their machine
rm -f autogen.err
automake --version | perl -ne 'if (/\(GNU automake\) (([0-9]+).([0-9]+))/) {print; if ($2 < 1 || ($2 == 1 && $3 < 4)) {exit 1;}}'
if [ $? -ne 0 ]; then
echo "Error: you need automake 1.4 or later. Please upgrade."
exit 1
fi
if test ! -d `aclocal --print-ac-dir 2>> autogen.err`; then
echo "Bad aclocal (automake) installation"
exit 1
fi
# Produce aclocal.m4, so autoconf gets the automake macros it needs
#
case `uname` in
CYGWIN*)
include_dir='-I m4' # Needed for Cygwin only.
;;
Darwin)
[ "$LIBTOOLIZE" = "" ] && LIBTOOLIZE=glibtoolize
;;
esac
${LIBTOOLIZE:=libtoolize} --force --copy || {
echo "error: libtoolize failed"
exit 1
}
echo "Creating aclocal.m4: aclocal $include_dir $ACLOCAL_FLAGS"
aclocal $include_dir $ACLOCAL_FLAGS 2>> autogen.err
# Produce all the `GNUmakefile.in's and create neat missing things
# like `install-sh', etc.
#
echo "automake --add-missing --copy --foreign"
automake --add-missing --copy --foreign 2>> autogen.err || {
echo ""
echo "* * * warning: possible errors while running automake - check autogen.err"
echo ""
}
# If there's a config.cache file, we may need to delete it.
# If we have an existing configure script, save a copy for comparison.
if [ -f config.cache ] && [ -f configure ]; then
cp configure configure.$$.tmp
fi
# Produce ./configure
#
echo "Creating configure..."
autoconf 2>> autogen.err || {
echo ""
echo "* * * warning: possible errors while running automake - check autogen.err"
echo ""
grep 'Undefined AX_ macro' autogen.err && exit 1
}
run_configure=true
for arg in $*; do
case $arg in
--no-configure)
run_configure=false
;;
*)
;;
esac
done
if $run_configure; then
mkdir -p build
cd build
../configure --enable-maintainer-mode "$@"
status=$?
if [ $status -eq 0 ]; then
echo
echo "Now type 'make' to compile link-grammar (in the 'build' directory)."
else
echo
echo "\"configure\" returned a bad status ($status)."
fi
else
echo
echo "Now run 'configure' and 'make' to compile link-grammar."
fi