-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathantigen.sh
More file actions
executable file
·85 lines (70 loc) · 1.83 KB
/
antigen.sh
File metadata and controls
executable file
·85 lines (70 loc) · 1.83 KB
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
#! /bin/sh
#
# "Portable" autoreconf for non-automake trees.
#
# Regular autoconf does not work very well on older autoconf/automake/libtool
# when automake is not used.
#
# This script tries to fix problems:
#
# - it installs files: config.sub, config.guess, install-sh
# - it installs ltmain.sh, if LT_INIT or *LIBTOOL macro is used
# - any arguments are given to aclocal
#
if test "x$1" = "x--help"; then
echo "usage: antigen.sh [aclocal flags]"
exit 0
fi
test -f configure.ac || {
echo "$0: configure.ac is missing"
exit 1
}
set -e
# default programs
ACLOCAL=${ACLOCAL:-aclocal}
AUTOCONF=${AUTOCONF:-autoconf}
AUTOHEADER=${AUTOHEADER:-autoheader}
# detect first glibtoolize then libtoolize
if test "x$LIBTOOLIZE" = "x"; then
LIBTOOLIZE=glibtoolize
which $LIBTOOLIZE >/dev/null 2>&1 \
|| LIBTOOLIZE=libtoolize
fi
#
# Workarounds for libtoolize randomness - it does not update
# the files if they exist, except it requires install-sh.
#
rm -f config.guess config.sub install-sh ltmain.sh libtool
# find install-sh
for d in \
"`dirname $0`" \
"`dirname $0`"/../share/antimake \
/usr/share/antimake \
/usr/share/libusual \
/usr/share/libtool/config \
/usr/share/automake-*
do
if test -f "$d/install-sh"; then
cp -p "$d/install-sh" .
break
fi
done
test -f install-sh || { echo "$0: Cannot find install-sh"; exit 1; }
# run libtoolize to get autoconf files
if ${LIBTOOLIZE} --help | grep "[-][-]install" > /dev/null; then
${LIBTOOLIZE} -i -f -q -c
else
${LIBTOOLIZE} -c
fi
# drop ltmain.sh if libtool is not used
grep -E 'LT_INIT|LIBTOOL' configure.ac > /dev/null \
|| rm -f ltmain.sh
# Now generate configure & config.h
${ACLOCAL} "$@"
# do we need to run autoheader?
grep AC_CONFIG_HEADER configure.ac > /dev/null \
&& ${AUTOHEADER}
# finally run autoconf
${AUTOCONF}
# clean junk
rm -rf autom4te.* aclocal*