mirror of
https://github.com/zeek/zeek.git
synced 2025-10-01 22:28:20 +00:00
Avoid reporting paths repeatedly in zeek-config --include_dir
This commit is contained in:
parent
5111b8e386
commit
ca725c1f9b
1 changed files with 19 additions and 5 deletions
|
@ -17,11 +17,25 @@ binpac_root=@ZEEK_CONFIG_BINPAC_ROOT_DIR@
|
|||
caf_root=@ZEEK_CONFIG_CAF_ROOT_DIR@
|
||||
broker_root=@ZEEK_CONFIG_BROKER_ROOT_DIR@
|
||||
|
||||
include_dir=${include_dir}:@ZEEK_CONFIG_PCAP_INCLUDE_DIR@
|
||||
include_dir=${include_dir}:@ZEEK_CONFIG_ZLIB_INCLUDE_DIR@
|
||||
include_dir=${include_dir}:@ZEEK_CONFIG_OPENSSL_INCLUDE_DIR@
|
||||
include_dir=${include_dir}:@ZEEK_CONFIG_LibKrb5_INCLUDE_DIR@
|
||||
include_dir=${include_dir}:@ZEEK_CONFIG_GooglePerftools_INCLUDE_DIR@
|
||||
add_path() {
|
||||
# $1: existing path
|
||||
# $2: path to add
|
||||
if test -z "$2" || test "$1" = "$2" ||
|
||||
echo "$1" | grep -q "^$2:" 2>/dev/null ||
|
||||
echo "$1" | grep -q ":$2:" 2>/dev/null ||
|
||||
echo "$1" | grep -q ":$2$" 2>/dev/null; then
|
||||
echo "$1"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "$1:$2"
|
||||
}
|
||||
|
||||
include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_PCAP_INCLUDE_DIR@")
|
||||
include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_ZLIB_INCLUDE_DIR@")
|
||||
include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_OPENSSL_INCLUDE_DIR@")
|
||||
include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_LibKrb5_INCLUDE_DIR@")
|
||||
include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_GooglePerftools_INCLUDE_DIR@")
|
||||
|
||||
usage="\
|
||||
Usage: zeek-config [--version] [--build_type] [--prefix] [--lib_dir] [--script_dir] [--site_dir] [--plugin_dir] [--config_dir] [--python_dir] [--include_dir] [--cmake_dir] [--zeekpath] [--zeek_dist] [--binpac_root] [--caf_root] [--broker_root]"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue