summaryrefslogtreecommitdiff
path: root/bpf_parser.y
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-04-22 13:42:19 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-04-22 13:46:53 +0200
commit0f86cd6c1dcc2129285e6081751bae3a53058aeb (patch)
treeca67e2a0f8233ed6f075b6c9535763d41135bd7c /bpf_parser.y
parentb043dddbf0591e67c9c9e4e78df8b9e1c9cafd06 (diff)
conf: Use configuration file path from Makefile instead of hardcoded paths
Currently, the path to the configuration files is hardcoded to $PREFIX/etc/netsniff-ng. If we want to keep the configuration files outside of prefix (e.g. during development), we need to pass the complete path as specified in $ETCDIRE (and $ETCDIR respectively, which could e.g. be overriden on the command line during build install) as a preprocessor define. This way, we can e.g. install the configuration files to /etc while installing the binaries in /usr/local with: $ make PREFIX=/usr/local ETCDIR=/etc $ make PREFIX=/usr/local ETCDIR=/etc install Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'bpf_parser.y')
-rw-r--r--bpf_parser.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/bpf_parser.y b/bpf_parser.y
index 0cf2a75..26ec125 100644
--- a/bpf_parser.y
+++ b/bpf_parser.y
@@ -749,8 +749,8 @@ int compile_filter(char *file, int verbose, int bypass, int format,
base = basename((b = xstrdup(file)));
slprintf(tmp_file, sizeof(tmp_file), "%s/.tmp-%u-%s", dir, rand(), base);
- slprintf(cmd, sizeof(cmd), "cpp -I" PREFIX_STRING
- "/etc/netsniff-ng/ %s > %s", file, tmp_file);
+ slprintf(cmd, sizeof(cmd), "cpp -I" ETCDIRE_STRING " %s > %s",
+ file, tmp_file);
if (system(cmd) != 0)
panic("Failed to invoke C preprocessor!\n");