Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow libc strlcpy #256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,23 @@ AC_MSG_RESULT(no)

dnl clock_gettime is in librt for glibc <2.17
AC_SEARCH_LIBS(clock_gettime, rt)
dnl strlcpy is in libbsd
AC_SEARCH_LIBS(strlcpy, bsd)

AC_CHECK_FUNC(strlcpy, found_strlcpy=yes, found_strlcpy=no)
if test "x$found_strlcpy" = xno; then
dnl check libbsd for strlcpy
PKG_CHECK_MODULES([BSD], [libbsd >= 0])
AC_SEARCH_LIBS(strlcpy, bsd,
[
found_bsd_strlcpy=yes
CFLAGS="$BSD_CFLAGS $CFLAGS"
LIBS="$BSD_LIBS $LIBS"
],
found_bsd_strlcpy=no)
fi

if test "x$found_strlcpy" = xno && test "x$found_bsd_strlcpy" = xno; then
AC_MSG_ERROR(cannot find strlcpy - upgrade your libc or install libbsd)
fi

dnl Needed for normal compile
AC_PROG_INSTALL
Expand Down
Loading