3
3
# Written and placed in public domain by Jeffrey Walton
4
4
# Autotools sucks. My condolences you have to work with it.
5
5
6
- if ! command -v aclocal & > /dev/null; then
6
+ if ! command -v aclocal > /dev/null 2>&1 ; then
7
7
echo " aclocal not found. Bootstrap will probably fail"
8
8
fi
9
9
10
- if ! command -v automake & > /dev/null; then
10
+ if ! command -v automake > /dev/null 2>&1 ; then
11
11
echo " automake not found. Bootstrap will probably fail"
12
12
fi
13
13
14
- if ! command -v autoupdate & > /dev/null; then
14
+ if ! command -v autoupdate > /dev/null 2>&1 ; then
15
15
echo " autoupdate not found. Bootstrap will probably fail"
16
16
fi
17
17
18
- if ! command -v autoconf & > /dev/null; then
18
+ if ! command -v autoconf > /dev/null 2>&1 ; then
19
19
echo " autoconf not found. Bootstrap will probably fail"
20
20
fi
21
21
22
- if ! command -v autoreconf & > /dev/null; then
22
+ if ! command -v autoreconf > /dev/null 2>&1 ; then
23
23
echo " autoreconf not found. Bootstrap will probably fail"
24
24
fi
25
25
26
- if ! command -v file & > /dev/null; then
26
+ if ! command -v file > /dev/null 2>&1 ; then
27
27
echo " file not found. Bootstrap will probably fail"
28
28
fi
29
29
30
- if ! command -v wget & > /dev/null; then
31
- if ! command -v curl & > /dev/null; then
30
+ if ! command -v wget > /dev/null 2>&1 ; then
31
+ if ! command -v curl > /dev/null 2>&1 ; then
32
32
echo " wget and curl not found. Updates will probably fail"
33
33
fi
34
34
fi
@@ -41,27 +41,27 @@ SED=sed
41
41
AWK=awk
42
42
43
43
# Fixup, Solaris and friends
44
- if [[ -d /usr/xpg4/bin ] ]; then
44
+ if [ -d /usr/xpg4/bin ]; then
45
45
SED=/usr/xpg4/bin/sed
46
46
AWK=/usr/xpg4/bin/awk
47
47
GREP=/usr/xpg4/bin/grep
48
- elif [[ -d /usr/bin/posix ] ]; then
48
+ elif [ -d /usr/bin/posix ]; then
49
49
SED=/usr/bin/posix/sed
50
50
AWK=/usr/bin/posix/awk
51
51
GREP=/usr/bin/posix/grep
52
52
fi
53
53
54
- if command -v wget & > /dev/null; then
54
+ if command -v wget > /dev/null 2>&1 ; then
55
55
FETCH_CMD=" wget -q -O"
56
- elif command -v curl & > /dev/null; then
56
+ elif command -v curl > /dev/null 2>&1 ; then
57
57
FETCH_CMD=" curl -L -s -o"
58
58
else
59
- FETCH_CMD=" foobar "
59
+ FETCH_CMD=" curl-and-wget-not-found "
60
60
fi
61
61
62
62
# Fixup for sed and "illegal byte sequence"
63
- IS_DARWIN=$( uname -s 2> /dev/null | " $GREP " -i -c darwin)
64
- if [[ " $IS_DARWIN " -ne 0 ] ]; then
63
+ IS_DARWIN=` uname -s 2>&1 | " $GREP " -i -c darwin`
64
+ if [ " $IS_DARWIN " -ne 0 ]; then
65
65
LC_ALL=C; export LC_ALL
66
66
fi
67
67
75
75
mkdir -p m4 build-aux
76
76
77
77
echo " Running aclocal"
78
- if ! aclocal & > /dev/null; then
78
+ if ! aclocal > /dev/null 2>&1 ; then
79
79
echo " aclocal failed."
80
80
exit 1
81
81
fi
82
82
83
83
echo " Running autoupdate"
84
- if ! autoupdate & > /dev/null; then
84
+ if ! autoupdate > /dev/null 2>&1 ; then
85
85
echo " autoupdate failed."
86
86
exit 1
87
87
fi
88
88
89
89
# Run autoreconf twice on failure. Also see
90
90
# https://github.com/tracebox/tracebox/issues/57
91
91
echo " Running autoreconf"
92
- if ! autoreconf --force --install & > /dev/null; then
92
+ if ! autoreconf --force --install > /dev/null 2>&1 ; then
93
93
echo " autoreconf failed, running again."
94
- if ! autoreconf --force --install; then
94
+ if ! autoreconf --force --install > /dev/null 2>&1 ; then
95
95
echo " autoreconf failed, again."
96
96
exit 1
97
97
fi
98
98
fi
99
99
100
100
# Create the configure script
101
- if ! autoconf; then
101
+ if ! autoconf > /dev/null 2>&1 ; then
102
102
echo " autoconf failed."
103
103
exit 1
104
104
fi
109
109
# https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
110
110
111
111
echo " Updating config.sub"
112
- ${FETCH_CMD} config.sub.new ' https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub'
112
+ if ${FETCH_CMD} config.sub.new \
113
+ ' https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub' > /dev/null 2>&1 ; then
113
114
114
- # Solaris removes +w, can't overwrite
115
- chmod +w build-aux/config.sub
116
- mv config.sub.new build-aux/config.sub
117
- chmod +x build-aux/config.sub
115
+ # Solaris removes +w, can't overwrite
116
+ chmod +w build-aux/config.sub
117
+ mv config.sub.new build-aux/config.sub
118
+ chmod +x build-aux/config.sub
118
119
119
- if [[ " $IS_DARWIN " -ne 0 ]] && [[ -n $( command -v xattr 2> /dev/null) ]]; then
120
- echo " Removing config.sub quarantine"
121
- xattr -d " com.apple.quarantine" build-aux/config.sub & > /dev/null
120
+ if [ " $IS_DARWIN " -ne 0 ] && [ command -v xattr > /dev/null 2>&1 ]; then
121
+ echo " Removing config.sub quarantine"
122
+ xattr -d " com.apple.quarantine" build-aux/config.sub > /dev/null 2>&1
123
+ fi
122
124
fi
123
125
124
126
echo " Updating config.guess"
125
- ${FETCH_CMD} config.guess.new ' https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess'
127
+ if ${FETCH_CMD} config.guess.new \
128
+ ' https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess' > /dev/null 2>&1 ; then
126
129
127
- # Solaris removes +w, can't overwrite
128
- chmod +w build-aux/config.guess
129
- mv config.guess.new build-aux/config.guess
130
- chmod +x build-aux/config.guess
130
+ # Solaris removes +w, can't overwrite
131
+ chmod +w build-aux/config.guess
132
+ mv config.guess.new build-aux/config.guess
133
+ chmod +x build-aux/config.guess
131
134
132
- if [[ " $IS_DARWIN " -ne 0 ]] && [[ -n $( command -v xattr 2> /dev/null) ]]; then
133
- echo " Removing config.guess quarantine"
134
- xattr -d " com.apple.quarantine" build-aux/config.guess & > /dev/null
135
+ if [ " $IS_DARWIN " -ne 0 ] && [ command -v xattr > /dev/null 2>&1 ]; then
136
+ echo " Removing config.guess quarantine"
137
+ xattr -d " com.apple.quarantine" build-aux/config.guess > /dev/null 2>&1
138
+ fi
135
139
fi
136
140
137
141
# ############################################################################
0 commit comments