Commit a25df488 authored by Vadim Kochan's avatar Vadim Kochan Committed by Stephen Hemminger

configure: Check for Berkeley DB for arpd compilation

Add check for Berkeley DB header & lib before compile arpd util.
Signed-off-by: default avatarVadim Kochan <vadim4j@gmail.com>
parent a1978834
...@@ -289,12 +289,34 @@ check_mnl() ...@@ -289,12 +289,34 @@ check_mnl()
if ${PKG_CONFIG} libmnl --exists if ${PKG_CONFIG} libmnl --exists
then then
echo "HAVE_MNL:=y" >>Config echo "HAVE_MNL:=y" >>Config
echo -n "yes" echo "yes"
else else
echo -n "no" echo "no"
fi fi
} }
check_berkeley_db()
{
cat >$TMPDIR/dbtest.c <<EOF
#include <fcntl.h>
#include <stdlib.h>
#include <db_185.h>
int main(int argc, char **argv) {
dbopen("/tmp/xxx_test_db.db", O_CREAT|O_RDWR, 0644, DB_HASH, NULL);
return 0;
}
EOF
$CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1
if [ $? -eq 0 ]
then
echo "HAVE_BERKELEY_DB:=y" >>Config
echo "yes"
else
echo "no"
fi
rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest
}
echo "# Generated config based on" $INCLUDE >Config echo "# Generated config based on" $INCLUDE >Config
check_toolchain check_toolchain
...@@ -328,6 +350,9 @@ check_elf ...@@ -328,6 +350,9 @@ check_elf
echo -n "libmnl support: " echo -n "libmnl support: "
check_mnl check_mnl
echo -n "Berkeley DB: "
check_berkeley_db
echo echo
echo -n "docs:" echo -n "docs:"
check_docs check_docs
......
SSOBJ=ss.o ssfilter.o SSOBJ=ss.o ssfilter.o
LNSTATOBJ=lnstat.o lnstat_util.o LNSTATOBJ=lnstat.o lnstat_util.o
TARGETS=ss nstat ifstat rtacct arpd lnstat TARGETS=ss nstat ifstat rtacct lnstat
include ../Config include ../Config
ifeq ($(HAVE_BERKELEY_DB),y)
TARGETS += arpd
endif
ifeq ($(HAVE_SELINUX),y) ifeq ($(HAVE_SELINUX),y)
LDLIBS += $(shell pkg-config --libs libselinux) LDLIBS += $(shell pkg-config --libs libselinux)
CFLAGS += $(shell pkg-config --cflags libselinux) -DHAVE_SELINUX CFLAGS += $(shell pkg-config --cflags libselinux) -DHAVE_SELINUX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment