Skip to content

Commit d7ec00b

Browse files
committed
Add gcc presence test to configure.
Related to #64 and #65.
1 parent d4a6bb2 commit d7ec00b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

configure

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,34 @@ iptables_find_version() {
152152
fi
153153
}
154154

155+
compiler_presence_test() {
156+
echo -n "Check for working gcc: "
157+
gcc -v >/dev/null 2>&1
158+
if [ $? = 0 ]; then
159+
echo Yes
160+
else
161+
echo No
162+
163+
echo "! You need gcc to install module from source"
164+
if [ -s /etc/debian_version ]; then
165+
NAME=Debian
166+
if [ -e /etc/os-release ]; then
167+
. /etc/os-release >/dev/null 2>&1
168+
fi
169+
echo "! "
170+
echo "! Under $NAME try to run this:"
171+
echo "! root# apt-get install gcc"
172+
echo "! "
173+
elif [ -s /etc/redhat-release ]; then
174+
echo "! "
175+
echo "! Under Centos try to run this:"
176+
echo "! root# yum install gcc"
177+
echo "! "
178+
fi
179+
exit 1
180+
fi
181+
}
182+
155183
compile_libitp_test() {
156184
local FLAGS
157185
local MSG
@@ -211,6 +239,7 @@ iptables_try_pkgconfig() {
211239
# and if not, then it's older who need it.
212240
IPTCFLAGS="-I$KDIR/include -DIPTABLES_VERSION=\\\\\"$IPTVER\\\\\""
213241
fi
242+
compiler_presence_test
214243
if compile_libitp_test xtables.h; then
215244
IPTCFLAGS="-DXTABLES $IPTCFLAGS"
216245
elif ! compile_libitp_test iptables.h; then

0 commit comments

Comments
 (0)