From c79290aba62201810070e28aef85816e60abb511 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Tue, 5 Jul 2016 16:08:38 +0200 Subject: [PATCH] pfctl: build files. --- libbsd.py | 17 +++++++++++++++++ libbsd_waf.py | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/libbsd.py b/libbsd.py index f9734f4d..1138623b 100755 --- a/libbsd.py +++ b/libbsd.py @@ -1777,6 +1777,8 @@ def user_space(mm): mod = builder.Module('user_space') mod.addUserSpaceHeaderFiles( [ + 'contrib/pf/pfctl/pfctl.h', + 'contrib/pf/pfctl/pfctl_parser.h', 'include/arpa/ftp.h', 'include/arpa/inet.h', 'include/arpa/nameser_compat.h', @@ -1880,6 +1882,12 @@ def user_space(mm): mm.generator['convert'](), mm.generator['convert'](), mm.generator['route-keywords']())) + mod.addFile(mm.generator['file']('contrib/pf/pfctl/parse.y', + mm.generator['freebsd-path'](), + mm.generator['convert'](), + mm.generator['convert'](), + mm.generator['yacc']('pfctly', + 'parse.h'))) mod.addUserSpaceSourceFiles( [ 'lib/libc/db/btree/bt_close.c', @@ -1912,6 +1920,15 @@ def user_space(mm): mod.addUserSpaceSourceFiles( [ 'bin/hostname/hostname.c', + 'contrib/pf/pfctl/pfctl_altq.c', + 'contrib/pf/pfctl/pfctl.c', + 'contrib/pf/pfctl/pfctl_optimize.c', + 'contrib/pf/pfctl/pfctl_osfp.c', + 'contrib/pf/pfctl/pfctl_parser.c', + 'contrib/pf/pfctl/pfctl_qstats.c', + 'contrib/pf/pfctl/pfctl_radix.c', + 'contrib/pf/pfctl/pfctl_table.c', + 'contrib/pf/pfctl/pf_print_state.c', 'lib/libc/gen/err.c', 'lib/libc/gen/feature_present.c', 'lib/libc/gen/gethostname.c', diff --git a/libbsd_waf.py b/libbsd_waf.py index 5c24b93f..e1bd5d8e 100644 --- a/libbsd_waf.py +++ b/libbsd_waf.py @@ -193,6 +193,17 @@ def build(bld): defines = defines + ['__FreeBSD__=1', 'BSD=1', 'INET6', '_U_=__attribute__((unused))', 'HAVE_LIMITS_H=1', 'HAVE_INTTYPES=1', 'HAVE_STDINT=1', 'HAVE_STRERROR=1', 'HAVE_STRLCPY=1', 'HAVE_SNPRINTF=1', 'HAVE_VSNPRINTF=1', 'HAVE_SOCKADDR_SA_LEN=1', 'HAVE_NET_IF_MEDIA_H=1', 'HAVE_SYS_IOCCOM_H=1', 'NEED_YYPARSE_WRAPPER=1', 'yylval=pcap_lval'], source = "freebsd/contrib/libpcap/grammar.c") libbsd_use += ["yacc_pcap"] + if bld.env.AUTO_REGEN: + bld(target = "freebsd/contrib/pf/pfctl/parse.c", + source = "freebsd/contrib/pf/pfctl/parse.y", + rule = host_shell + "${YACC} -b pfctly -d -p pfctly ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < pfctly.tab.c > ${TGT} && rm -f pfctly.tab.c && mv pfctly.tab.h freebsd/contrib/pf/pfctl/parse.h") + bld.objects(target = "yacc_pfctly", + features = "c", + cflags = cflags, + includes = [] + includes, + defines = defines + [], + source = "freebsd/contrib/pf/pfctl/parse.c") + libbsd_use += ["yacc_pfctly"] if bld.env.AUTO_REGEN: bld(target = "freebsd/lib/libc/net/nsparser.c", source = "freebsd/lib/libc/net/nsparser.y", @@ -218,6 +229,15 @@ def build(bld): # Objects built with different CFLAGS objs01_source = ['freebsd/bin/hostname/hostname.c', + 'freebsd/contrib/pf/pfctl/pf_print_state.c', + 'freebsd/contrib/pf/pfctl/pfctl.c', + 'freebsd/contrib/pf/pfctl/pfctl_altq.c', + 'freebsd/contrib/pf/pfctl/pfctl_optimize.c', + 'freebsd/contrib/pf/pfctl/pfctl_osfp.c', + 'freebsd/contrib/pf/pfctl/pfctl_parser.c', + 'freebsd/contrib/pf/pfctl/pfctl_qstats.c', + 'freebsd/contrib/pf/pfctl/pfctl_radix.c', + 'freebsd/contrib/pf/pfctl/pfctl_table.c', 'freebsd/lib/libc/gen/err.c', 'freebsd/lib/libc/gen/feature_present.c', 'freebsd/lib/libc/gen/gethostname.c',