forked from slewsys/ed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogen.sh
executable file
·145 lines (122 loc) · 2.97 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
137
138
139
140
141
142
143
144
145
#!/bin/sh
#
# @(#)autogen.sh
#
# This script generates a GNU Autoconf configure script for the ed
# line editor.
#
script_name=$(basename $0)
case "$1" in
-h*|--h*)
echo "Usage: $script_name [-h|--help] [-s|--silent] [maintainer-update-dist]"
exit
;;
esac
verbose='true'
case "$1" in
-s*|--s*)
verbose='false'
shift
;;
esac
srcdir=$(dirname $0)
abs_srcdir="$(cd "$srcdir" && pwd)"
if [ ! -w "$abs_srcdir" ]; then
echo "$script_name: $abs_srcdir: Permission denied"
exit 2
fi
for cmd in aclocal autoheader automake autoreconf; do
eval ${cmd}_cmd='$(which '$cmd' 2>/dev/null)'
exit_status=$?
if test $exit_status -ne 0; then
cat <<EOF
$script_name: $cmd: Command not found
Please verify installation of GNU Autoconf, Automake, Autopoint,
Libtool, Gettext and Texinfo before running this script.
EOF
exit $exit_status
fi
done
$verbose && cat <<EOF
$script_name: Running:
cd "$abs_srcdir" &&
$aclocal_cmd -I./m4 --verbose --force --install >&2
EOF
aclocal_output=$(
cd "$abs_srcdir" &&
$aclocal_cmd -I./m4 --force --install 2>&1
)
exit_status=$?
if test $exit_status -ne 0; then
cat >&2 <<EOF
$script_name:
$aclocal_output
EOF
exit $exit_status
fi
$verbose && cat <<EOF
$script_name: Running:
cd "$abs_srcdir" &&
$autoheader_cmd --verbose --force --warnings=gnu >&2
EOF
autoheader_output=$(
cd "$abs_srcdir" &&
$autoheader_cmd --verbose --force --warnings=gnu 2>&1
)
exit_status=$?
if test $exit_status -ne 0; then
cat >&2 <<EOF
$script_name:
$autoheader_output
EOF
exit $exit_status
fi
$verbose && cat <<EOF
$script_name: Running:
cd "$abs_srcdir" &&
$automake_cmd --verbose --force-missing --copy --gnu >&2
EOF
automake_output=$(
cd "$abs_srcdir" &&
$automake_cmd --verbose --force-missing --copy 2>&1
)
exit_status=$?
if test $exit_status -ne 0; then
cat >&2 <<EOF
$script_name:
$automake_output
EOF
exit $exit_status
fi
$verbose && cat <<EOF
$script_name: Running:
cd "$abs_srcdir" &&
$autoreconf_cmd -I./m4 --verbose --install >&2
EOF
autoreconf_output=$(
cd "$abs_srcdir" &&
$autoreconf_cmd -I./m4 --verbose --install 2>&1
)
exit_status=$?
if test $exit_status -ne 0; then
cat >&2 <<EOF
$script_name:
$autoreconf_output
EOF
exit $exit_status
fi
if $verbose; then
echo "$script_name:" >&2
cat >&2 <<'EOF'
========================================================================
Autotools appears to have completed successfully. To continue,
optionally create and cd to a build directory, then run:
$ $top_srcdir/configure
$ make
The testsuite is generated with GNU AutoTest and requires
GNU make. It is run as follows:
$ gmake check
Please submit issues or pull requests to: <https://github.com/slewsys/ed>
------------------------------------------------------------------------
EOF
fi