-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathconfigure
executable file
·144 lines (110 loc) · 2.85 KB
/
configure
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
#!/bin/sh
LC_ALL=C
export LC_ALL
. auto/options
. auto/init
. auto/sources
test -d $TC_OBJS || mkdir $TC_OBJS
echo > $TC_AUTO_HEADERS_H
echo > $TC_AUTOCONF_ERR
echo "#define TC_CONFIGURE \"$TC_CONFIGURE\"" > $TC_AUTO_CONFIG_H
if test -z "$TC_PLATFORM"; then
echo "checking for OS"
TC_SYSTEM=`uname -s 2>/dev/null`
TC_MAJOR=`uname -r | cut -d. -f1`;
TC_MINOR=`uname -r | cut -d. -f2`;
TC_MACHINE=`uname -m 2>/dev/null`
echo " + $TC_SYSTEM $TC_MAJOR.$TC_MINOR $TC_MACHINE"
TC_PLATFORM="$TC_SYSTEM:$TC_MAJOR:$TC_MINOR:$TC_MACHINE";
else
echo "building for $TC_PLATFORM"
TC_SYSTEM=$TC_PLATFORM
fi
case "$TC_PLATFORM" in
Linux:*)
. auto/os/linux
;;
*)
echo "error: Linux only!"
exit 1
esac
if [ $TC_DEBUG = YES ]; then
have=TC_DEBUG . auto/have
fi
if [ $TC_SINGLE = YES ]; then
have=TC_SINGLE . auto/have
fi
if [ $TC_MILLION_SUPPORT = YES ]; then
have=TC_MILLION_SUPPORT . auto/have
fi
if [ $TC_ADVANCED = YES ]; then
TC_PCAP_CAPTURE=YES
TC_NFQUEUE=NO
have=TC_ADVANCED . auto/have
else
if test $TC_MAJOR -gt 3; then
TC_NFQUEUE=YES
echo "use nfqueue"
elif test $TC_MAJOR -eq 3; then
if test $TC_MINOR -ge 5; then
TC_NFQUEUE=YES
echo "use nfqueue"
else
echo "ip_queue could be supported"
fi
else
echo "ip_queue could be supported"
fi
fi
if [ $TC_NFQUEUE = YES ]; then
have=TC_NFQUEUE . auto/have
CORE_LIBS="$CORE_LIBS -lnfnetlink -lnetfilter_queue"
fi
if [ $TC_COMBINED = YES ]; then
have=TC_COMBINED . auto/have
fi
if [ $TC_PCAP_CAPTURE = YES ]; then
TC_PCAP_NEEDED=YES
fi
if [ $TC_PCAP_NEEDED = YES ]; then
if [ $TC_PF_RING_DIR != NONE ]; then
have=TC_HAVE_PF_RING . auto/have
CORE_LIBS="$CORE_LIBS $TC_PF_RING_DIR/userland/libpcap/libpcap.a"
CORE_LIBS="$CORE_LIBS $TC_PF_RING_DIR/userland/lib/libpfring.a"
CORE_LIBS="$CORE_LIBS -lrt -lpthread -lnuma"
else
CORE_LIBS="$CORE_LIBS -lpcap"
fi
fi
if [ $TC_DNAT = YES ]; then
have=TC_DNAT . auto/have
fi
. auto/cc/conf
. auto/headers
. auto/os/conf
. auto/linux
if [ $TC_PAYLOAD = YES ]; then
have=TC_PAYLOAD . auto/have
fi
case ".$TC_PREFIX" in
.)
TC_PREFIX=${TC_PREFIX:-/usr/local/intercept}
have=TC_PREFIX value="\"$TC_PREFIX/\"" . auto/define
;;
.!)
TC_PREFIX=
;;
*)
have=TC_PREFIX value="\"$TC_PREFIX/\"" . auto/define
;;
esac
if [ ".$TC_CONF_PREFIX" != "." ]; then
have=TC_CONF_PREFIX value="\"$TC_CONF_PREFIX/\"" . auto/define
fi
have=TC_SBIN_PATH value="\"$TC_SBIN_PATH\"" . auto/define
have=TC_CONF_PATH value="\"$TC_CONF_PATH\"" . auto/define
have=TC_PID_PATH value="\"$TC_PID_PATH\"" . auto/define
have=TC_ERROR_LOG_PATH value="\"$TC_ERROR_LOG_PATH\"" . auto/define
. auto/make
. auto/install
. auto/summary