osdl.net!shemminger | 449bf1f | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 1 | #! /bin/bash |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 2 | # This is not an autoconf generated configure |
osdl.net!shemminger | 449bf1f | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 3 | # |
osdl.net!shemminger | 4b1bbd9 | 2004-08-09 16:35:28 +0000 | [diff] [blame] | 4 | INCLUDE=${1:-"$PWD/include"} |
osdl.net!shemminger | 449bf1f | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 5 | |
Stephen Hemminger | e557d1a | 2012-02-15 10:03:39 -0800 | [diff] [blame] | 6 | # Make a temp directory in build tree. |
| 7 | TMPDIR=$(mktemp -d config.XXXXXX) |
Mathias Krause | c2f7d6c | 2012-09-01 20:55:29 +0200 | [diff] [blame] | 8 | trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM |
Stephen Hemminger | e557d1a | 2012-02-15 10:03:39 -0800 | [diff] [blame] | 9 | |
vadimk | 10ed8b7 | 2014-11-30 18:08:25 +0200 | [diff] [blame] | 10 | check_prog() |
| 11 | { |
| 12 | echo -n "$2" |
| 13 | command -v $1 >/dev/null 2>&1 && (echo "$3:=y" >> Config; echo "yes") || (echo "no"; return 1) |
| 14 | } |
| 15 | |
| 16 | check_docs() |
| 17 | { |
| 18 | if check_prog latex " latex: " HAVE_LATEX; then |
| 19 | check_prog pdflatex " pdflatex: " HAVE_PDFLATEX || echo " WARNING: no PDF docs can be built from LaTeX files" |
| 20 | check_prog sgml2latex " sgml2latex: " HAVE_SGML2LATEX || echo " WARNING: no LaTeX files can be build from SGML files" |
| 21 | else |
| 22 | echo " WARNING: no docs can be built from LaTeX files" |
| 23 | fi |
| 24 | |
| 25 | check_prog sgml2html " sgml2html: " HAVE_SGML2HTML || echo " WARNING: no HTML docs can be built from SGML" |
| 26 | } |
| 27 | |
Mike Frysinger | 601f60e | 2012-12-16 17:09:15 -0500 | [diff] [blame] | 28 | check_toolchain() |
| 29 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 30 | : ${PKG_CONFIG:=pkg-config} |
| 31 | : ${AR=ar} |
| 32 | : ${CC=gcc} |
Stephen Hemminger | ae7b9a0 | 2012-12-19 16:01:39 -0800 | [diff] [blame] | 33 | echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 34 | echo "AR:=${AR}" >>Config |
| 35 | echo "CC:=${CC}" >>Config |
Mike Frysinger | 601f60e | 2012-12-16 17:09:15 -0500 | [diff] [blame] | 36 | } |
| 37 | |
Andreas Henriksson | 14743a7 | 2010-01-01 23:20:30 +0100 | [diff] [blame] | 38 | check_atm() |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 39 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 40 | cat >$TMPDIR/atmtest.c <<EOF |
osdl.net!shemminger | c830d77 | 2004-07-02 17:47:53 +0000 | [diff] [blame] | 41 | #include <atm.h> |
| 42 | int main(int argc, char **argv) { |
| 43 | struct atm_qos qos; |
| 44 | (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0); |
| 45 | return 0; |
| 46 | } |
| 47 | EOF |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 48 | |
| 49 | $CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1 |
| 50 | if [ $? -eq 0 ] |
| 51 | then |
| 52 | echo "TC_CONFIG_ATM:=y" >>Config |
| 53 | echo yes |
| 54 | else |
| 55 | echo no |
| 56 | fi |
| 57 | rm -f $TMPDIR/atmtest.c $TMPDIR/atmtest |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 58 | } |
Jamal Hadi Salim | 63c7d26 | 2009-02-07 08:19:20 -0500 | [diff] [blame] | 59 | |
Daniel Borkmann | 4710e46 | 2016-10-18 14:13:09 +0200 | [diff] [blame] | 60 | check_xtables() |
| 61 | { |
| 62 | if ! ${PKG_CONFIG} xtables --exists |
| 63 | then |
| 64 | echo "TC_CONFIG_NO_XT:=y" >>Config |
| 65 | fi |
| 66 | } |
| 67 | |
Andreas Henriksson | 14743a7 | 2010-01-01 23:20:30 +0100 | [diff] [blame] | 68 | check_xt() |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 69 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 70 | #check if we have xtables from iptables >= 1.4.5. |
| 71 | cat >$TMPDIR/ipttest.c <<EOF |
Andreas Henriksson | a36ceb8 | 2009-12-02 16:11:50 +0100 | [diff] [blame] | 72 | #include <xtables.h> |
| 73 | #include <linux/netfilter.h> |
| 74 | static struct xtables_globals test_globals = { |
| 75 | .option_offset = 0, |
| 76 | .program_name = "tc-ipt", |
| 77 | .program_version = XTABLES_VERSION, |
| 78 | .orig_opts = NULL, |
| 79 | .opts = NULL, |
| 80 | .exit_err = NULL, |
| 81 | }; |
| 82 | |
| 83 | int main(int argc, char **argv) |
| 84 | { |
| 85 | xtables_init_all(&test_globals, NFPROTO_IPV4); |
| 86 | return 0; |
| 87 | } |
Andreas Henriksson | a36ceb8 | 2009-12-02 16:11:50 +0100 | [diff] [blame] | 88 | EOF |
| 89 | |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 90 | if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL \ |
| 91 | $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1 |
| 92 | then |
Andreas Henriksson | a36ceb8 | 2009-12-02 16:11:50 +0100 | [diff] [blame] | 93 | echo "TC_CONFIG_XT:=y" >>Config |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 94 | echo "using xtables" |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 95 | fi |
| 96 | rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 97 | } |
| 98 | |
Andreas Henriksson | 14743a7 | 2010-01-01 23:20:30 +0100 | [diff] [blame] | 99 | check_xt_old() |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 100 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 101 | # bail if previous XT checks has already succeded. |
| 102 | if grep -q TC_CONFIG_XT Config |
| 103 | then |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 104 | return |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 105 | fi |
Andreas Henriksson | a36ceb8 | 2009-12-02 16:11:50 +0100 | [diff] [blame] | 106 | |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 107 | #check if we dont need our internal header .. |
| 108 | cat >$TMPDIR/ipttest.c <<EOF |
Jamal Hadi Salim | 63c7d26 | 2009-02-07 08:19:20 -0500 | [diff] [blame] | 109 | #include <xtables.h> |
| 110 | char *lib_dir; |
| 111 | unsigned int global_option_offset = 0; |
| 112 | const char *program_version = XTABLES_VERSION; |
| 113 | const char *program_name = "tc-ipt"; |
| 114 | struct afinfo afinfo = { |
| 115 | .libprefix = "libxt_", |
| 116 | }; |
| 117 | |
| 118 | void exit_error(enum exittype status, const char *msg, ...) |
| 119 | { |
| 120 | } |
| 121 | |
| 122 | int main(int argc, char **argv) { |
| 123 | |
| 124 | return 0; |
| 125 | } |
| 126 | |
| 127 | EOF |
Jamal Hadi Salim | 63c7d26 | 2009-02-07 08:19:20 -0500 | [diff] [blame] | 128 | |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 129 | $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 |
| 130 | if [ $? -eq 0 ] |
| 131 | then |
Andreas Henriksson | 80d689d | 2009-12-02 16:11:21 +0100 | [diff] [blame] | 132 | echo "TC_CONFIG_XT_OLD:=y" >>Config |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 133 | echo "using old xtables (no need for xt-internal.h)" |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 134 | fi |
| 135 | rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 136 | } |
| 137 | |
Andreas Henriksson | 14743a7 | 2010-01-01 23:20:30 +0100 | [diff] [blame] | 138 | check_xt_old_internal_h() |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 139 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 140 | # bail if previous XT checks has already succeded. |
| 141 | if grep -q TC_CONFIG_XT Config |
| 142 | then |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 143 | return |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 144 | fi |
Jamal Hadi Salim | 63c7d26 | 2009-02-07 08:19:20 -0500 | [diff] [blame] | 145 | |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 146 | #check if we need our own internal.h |
| 147 | cat >$TMPDIR/ipttest.c <<EOF |
Jamal Hadi Salim | 63c7d26 | 2009-02-07 08:19:20 -0500 | [diff] [blame] | 148 | #include <xtables.h> |
| 149 | #include "xt-internal.h" |
| 150 | char *lib_dir; |
| 151 | unsigned int global_option_offset = 0; |
| 152 | const char *program_version = XTABLES_VERSION; |
| 153 | const char *program_name = "tc-ipt"; |
| 154 | struct afinfo afinfo = { |
| 155 | .libprefix = "libxt_", |
| 156 | }; |
| 157 | |
| 158 | void exit_error(enum exittype status, const char *msg, ...) |
| 159 | { |
| 160 | } |
| 161 | |
| 162 | int main(int argc, char **argv) { |
| 163 | |
| 164 | return 0; |
| 165 | } |
| 166 | |
| 167 | EOF |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 168 | $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 |
Jamal Hadi Salim | 63c7d26 | 2009-02-07 08:19:20 -0500 | [diff] [blame] | 169 | |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 170 | if [ $? -eq 0 ] |
| 171 | then |
| 172 | echo "using old xtables with xt-internal.h" |
| 173 | echo "TC_CONFIG_XT_OLD_H:=y" >>Config |
| 174 | fi |
| 175 | rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 176 | } |
| 177 | |
Andreas Henriksson | 14743a7 | 2010-01-01 23:20:30 +0100 | [diff] [blame] | 178 | check_ipt() |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 179 | { |
| 180 | if ! grep TC_CONFIG_XT Config > /dev/null |
| 181 | then |
| 182 | echo "using iptables" |
| 183 | fi |
| 184 | } |
| 185 | |
Andreas Henriksson | 12ddfff | 2010-03-11 10:54:31 +0000 | [diff] [blame] | 186 | check_ipt_lib_dir() |
| 187 | { |
Mike Frysinger | e4fc4ad | 2012-11-08 11:41:17 -0500 | [diff] [blame] | 188 | IPT_LIB_DIR=$(${PKG_CONFIG} --variable=xtlibdir xtables) |
Li Wei | da7fbb2 | 2012-08-20 09:41:47 +0800 | [diff] [blame] | 189 | if [ -n "$IPT_LIB_DIR" ]; then |
| 190 | echo $IPT_LIB_DIR |
| 191 | echo "IPT_LIB_DIR:=$IPT_LIB_DIR" >> Config |
| 192 | return |
| 193 | fi |
| 194 | |
Andreas Henriksson | 12ddfff | 2010-03-11 10:54:31 +0000 | [diff] [blame] | 195 | for dir in /lib /usr/lib /usr/local/lib |
| 196 | do |
Dan McGee | 44e743e | 2011-07-15 08:52:24 +0000 | [diff] [blame] | 197 | for file in $dir/{xtables,iptables}/lib*t_*so ; do |
Andreas Henriksson | 12ddfff | 2010-03-11 10:54:31 +0000 | [diff] [blame] | 198 | if [ -f $file ]; then |
Dan McGee | 44e743e | 2011-07-15 08:52:24 +0000 | [diff] [blame] | 199 | echo ${file%/*} |
| 200 | echo "IPT_LIB_DIR:=${file%/*}" >> Config |
Andreas Henriksson | 12ddfff | 2010-03-11 10:54:31 +0000 | [diff] [blame] | 201 | return |
| 202 | fi |
| 203 | done |
| 204 | done |
| 205 | echo "not found!" |
| 206 | } |
| 207 | |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 208 | check_setns() |
| 209 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 210 | cat >$TMPDIR/setnstest.c <<EOF |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 211 | #include <sched.h> |
Vadim Kochan | d116ff3 | 2015-03-07 08:30:58 +0200 | [diff] [blame] | 212 | int main(int argc, char **argv) |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 213 | { |
| 214 | (void)setns(0,0); |
| 215 | return 0; |
| 216 | } |
| 217 | EOF |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 218 | $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1 |
| 219 | if [ $? -eq 0 ] |
| 220 | then |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 221 | echo "IP_CONFIG_SETNS:=y" >>Config |
| 222 | echo "yes" |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 223 | else |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 224 | echo "no" |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 225 | fi |
| 226 | rm -f $TMPDIR/setnstest.c $TMPDIR/setnstest |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 227 | } |
| 228 | |
Florian Westphal | 8194411 | 2012-08-09 09:18:50 +0000 | [diff] [blame] | 229 | check_ipset() |
| 230 | { |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 231 | cat >$TMPDIR/ipsettest.c <<EOF |
Florian Westphal | 8194411 | 2012-08-09 09:18:50 +0000 | [diff] [blame] | 232 | #include <linux/netfilter/ipset/ip_set.h> |
| 233 | #ifndef IP_SET_INVALID |
| 234 | #define IPSET_DIM_MAX 3 |
| 235 | typedef unsigned short ip_set_id_t; |
| 236 | #endif |
| 237 | #include <linux/netfilter/xt_set.h> |
| 238 | |
| 239 | struct xt_set_info info; |
| 240 | #if IPSET_PROTOCOL == 6 |
| 241 | int main(void) |
| 242 | { |
| 243 | return IPSET_MAXNAMELEN; |
| 244 | } |
| 245 | #else |
| 246 | #error unknown ipset version |
| 247 | #endif |
| 248 | EOF |
| 249 | |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 250 | if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1 |
| 251 | then |
Florian Westphal | 8194411 | 2012-08-09 09:18:50 +0000 | [diff] [blame] | 252 | echo "TC_CONFIG_IPSET:=y" >>Config |
| 253 | echo "yes" |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 254 | else |
Florian Westphal | 8194411 | 2012-08-09 09:18:50 +0000 | [diff] [blame] | 255 | echo "no" |
Stephen Hemminger | 07a6f5e | 2012-12-18 09:20:13 -0800 | [diff] [blame] | 256 | fi |
| 257 | rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsettest |
Florian Westphal | 8194411 | 2012-08-09 09:18:50 +0000 | [diff] [blame] | 258 | } |
| 259 | |
Daniel Borkmann | 11c39b5 | 2015-03-16 19:37:41 +0100 | [diff] [blame] | 260 | check_elf() |
| 261 | { |
| 262 | cat >$TMPDIR/elftest.c <<EOF |
| 263 | #include <libelf.h> |
| 264 | #include <gelf.h> |
| 265 | int main(void) |
| 266 | { |
| 267 | Elf_Scn *scn; |
| 268 | GElf_Shdr shdr; |
| 269 | return elf_version(EV_CURRENT); |
| 270 | } |
| 271 | EOF |
| 272 | |
| 273 | if $CC -I$INCLUDE -o $TMPDIR/elftest $TMPDIR/elftest.c -lelf >/dev/null 2>&1 |
| 274 | then |
| 275 | echo "TC_CONFIG_ELF:=y" >>Config |
| 276 | echo "yes" |
| 277 | else |
| 278 | echo "no" |
| 279 | fi |
| 280 | rm -f $TMPDIR/elftest.c $TMPDIR/elftest |
| 281 | } |
| 282 | |
Richard Haines | 116ac92 | 2014-03-07 10:36:52 +0000 | [diff] [blame] | 283 | check_selinux() |
| 284 | # SELinux is a compile time option in the ss utility |
| 285 | { |
| 286 | if ${PKG_CONFIG} libselinux --exists |
| 287 | then |
| 288 | echo "HAVE_SELINUX:=y" >>Config |
| 289 | echo "yes" |
| 290 | else |
| 291 | echo "no" |
| 292 | fi |
| 293 | } |
| 294 | |
Vadim Kochan | b690740 | 2015-05-29 13:27:41 +0300 | [diff] [blame] | 295 | check_mnl() |
| 296 | { |
| 297 | if ${PKG_CONFIG} libmnl --exists |
| 298 | then |
| 299 | echo "HAVE_MNL:=y" >>Config |
Vadim Kochan | a25df48 | 2015-09-18 19:17:13 +0300 | [diff] [blame] | 300 | echo "yes" |
Vadim Kochan | b690740 | 2015-05-29 13:27:41 +0300 | [diff] [blame] | 301 | else |
Vadim Kochan | a25df48 | 2015-09-18 19:17:13 +0300 | [diff] [blame] | 302 | echo "no" |
Vadim Kochan | b690740 | 2015-05-29 13:27:41 +0300 | [diff] [blame] | 303 | fi |
| 304 | } |
| 305 | |
Vadim Kochan | a25df48 | 2015-09-18 19:17:13 +0300 | [diff] [blame] | 306 | check_berkeley_db() |
| 307 | { |
| 308 | cat >$TMPDIR/dbtest.c <<EOF |
| 309 | #include <fcntl.h> |
| 310 | #include <stdlib.h> |
| 311 | #include <db_185.h> |
| 312 | int main(int argc, char **argv) { |
| 313 | dbopen("/tmp/xxx_test_db.db", O_CREAT|O_RDWR, 0644, DB_HASH, NULL); |
| 314 | return 0; |
| 315 | } |
| 316 | EOF |
| 317 | $CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1 |
| 318 | if [ $? -eq 0 ] |
| 319 | then |
| 320 | echo "HAVE_BERKELEY_DB:=y" >>Config |
| 321 | echo "yes" |
| 322 | else |
| 323 | echo "no" |
| 324 | fi |
| 325 | rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest |
| 326 | } |
| 327 | |
David Ahern | 57bdf8b | 2016-05-24 15:04:49 -0700 | [diff] [blame] | 328 | quiet_config() |
| 329 | { |
| 330 | cat <<EOF |
| 331 | # user can control verbosity similar to kernel builds (e.g., V=1) |
| 332 | ifeq ("\$(origin V)", "command line") |
| 333 | VERBOSE = \$(V) |
| 334 | endif |
| 335 | ifndef VERBOSE |
| 336 | VERBOSE = 0 |
| 337 | endif |
| 338 | ifeq (\$(VERBOSE),1) |
| 339 | Q = |
| 340 | else |
| 341 | Q = @ |
| 342 | endif |
| 343 | |
| 344 | ifeq (\$(VERBOSE), 0) |
| 345 | QUIET_CC = @echo ' CC '\$@; |
| 346 | QUIET_AR = @echo ' AR '\$@; |
| 347 | QUIET_LINK = @echo ' LINK '\$@; |
| 348 | QUIET_YACC = @echo ' YACC '\$@; |
| 349 | QUIET_LEX = @echo ' LEX '\$@; |
| 350 | endif |
| 351 | EOF |
| 352 | } |
| 353 | |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 354 | echo "# Generated config based on" $INCLUDE >Config |
David Ahern | 57bdf8b | 2016-05-24 15:04:49 -0700 | [diff] [blame] | 355 | quiet_config >> Config |
| 356 | |
Mike Frysinger | 601f60e | 2012-12-16 17:09:15 -0500 | [diff] [blame] | 357 | check_toolchain |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 358 | |
| 359 | echo "TC schedulers" |
| 360 | |
| 361 | echo -n " ATM " |
| 362 | check_atm |
| 363 | |
Daniel Borkmann | 4710e46 | 2016-10-18 14:13:09 +0200 | [diff] [blame] | 364 | check_xtables |
| 365 | if ! grep -q TC_CONFIG_NO_XT Config |
| 366 | then |
| 367 | echo -n " IPT " |
| 368 | check_xt |
| 369 | check_xt_old |
| 370 | check_xt_old_internal_h |
| 371 | check_ipt |
Andreas Henriksson | f1a0125 | 2009-12-02 05:12:30 +0000 | [diff] [blame] | 372 | |
Daniel Borkmann | 4710e46 | 2016-10-18 14:13:09 +0200 | [diff] [blame] | 373 | echo -n " IPSET " |
| 374 | check_ipset |
| 375 | fi |
Florian Westphal | 8194411 | 2012-08-09 09:18:50 +0000 | [diff] [blame] | 376 | |
Stephen Hemminger | aaf7045 | 2015-06-25 15:10:22 -0400 | [diff] [blame] | 377 | echo |
Daniel Borkmann | 4710e46 | 2016-10-18 14:13:09 +0200 | [diff] [blame] | 378 | if ! grep -q TC_CONFIG_NO_XT Config |
| 379 | then |
| 380 | echo -n "iptables modules directory: " |
| 381 | check_ipt_lib_dir |
| 382 | fi |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 383 | |
| 384 | echo -n "libc has setns: " |
| 385 | check_setns |
Richard Haines | 116ac92 | 2014-03-07 10:36:52 +0000 | [diff] [blame] | 386 | |
| 387 | echo -n "SELinux support: " |
| 388 | check_selinux |
vadimk | 10ed8b7 | 2014-11-30 18:08:25 +0200 | [diff] [blame] | 389 | |
Daniel Borkmann | 11c39b5 | 2015-03-16 19:37:41 +0100 | [diff] [blame] | 390 | echo -n "ELF support: " |
| 391 | check_elf |
| 392 | |
Vadim Kochan | b690740 | 2015-05-29 13:27:41 +0300 | [diff] [blame] | 393 | echo -n "libmnl support: " |
| 394 | check_mnl |
Vadim Kochan | b690740 | 2015-05-29 13:27:41 +0300 | [diff] [blame] | 395 | |
Vadim Kochan | a25df48 | 2015-09-18 19:17:13 +0300 | [diff] [blame] | 396 | echo -n "Berkeley DB: " |
| 397 | check_berkeley_db |
| 398 | |
Stephen Hemminger | aaf7045 | 2015-06-25 15:10:22 -0400 | [diff] [blame] | 399 | echo |
| 400 | echo -n "docs:" |
vadimk | 10ed8b7 | 2014-11-30 18:08:25 +0200 | [diff] [blame] | 401 | check_docs |
Stephen Hemminger | aaf7045 | 2015-06-25 15:10:22 -0400 | [diff] [blame] | 402 | echo |
David Ahern | 57bdf8b | 2016-05-24 15:04:49 -0700 | [diff] [blame] | 403 | |
| 404 | echo >> Config |
| 405 | echo "%.o: %.c" >> Config |
| 406 | echo ' $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<' >> Config |