summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2018-10-31 18:00:11 +0000
committerStephen Hemminger <stephen@networkplumber.org>2018-11-01 12:47:03 -0700
commit508f3c231efb179fb842d222e8151b395937b136 (patch)
treee82c7ea91c486ae6c0af618f3c76a069915761b7 /configure
parent7a04dd84a7f938f72fcef9efe8383314b0a66274 (diff)
downloadiproute2-508f3c231efb179fb842d222e8151b395937b136.tar.gz
Use libbsd for strlcpy if available
If libc does not provide strlcpy check for libbsd with pkg-config to avoid relying on inline version. Signed-off-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure11
1 files changed, 9 insertions, 2 deletions
diff --git a/configure b/configure
index 744d6282..c5655978 100755
--- a/configure
+++ b/configure
@@ -330,8 +330,15 @@ EOF
then
echo "no"
else
- echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
- echo "yes"
+ if ${PKG_CONFIG} libbsd --exists
+ then
+ echo 'CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
+ echo 'LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
+ echo "no"
+ else
+ echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
+ echo "yes"
+ fi
fi
rm -f $TMPDIR/strtest.c $TMPDIR/strtest
}