ソースを参照

Check for strlcpy and libbsd during configure

On BSD-derived systems (such as OS X), where strlcpy already exists
in libc, we can build just fine without libbsd.
Martin Storsjö 11 年 前
コミット
0984b36a55
3 ファイル変更8 行追加1 行削除
  1. 1 1
      Makefile.am
  2. 5 0
      configure.ac
  3. 2 0
      src/smb_ntlm.c

+ 1 - 1
Makefile.am

@@ -74,7 +74,7 @@ libdsm_la_SOURCES = \
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libdsm.pc
 
-libdsm_la_LDFLAGS = -version-info @BDSM_LIBTOOL_VERSION@ @LTLIBICONV@ @TASN1_LIBS@ -lbsd
+libdsm_la_LDFLAGS = -version-info @BDSM_LIBTOOL_VERSION@ @LTLIBICONV@ @TASN1_LIBS@
 
 
 bin_PROGRAMS =

+ 5 - 0
configure.ac

@@ -51,6 +51,11 @@ AC_CONFIG_MACRO_DIR([m4])
 ## Checks for the ASN.1 parser
 PKG_CHECK_MODULES([TASN1], [libtasn1])
 
+AC_SEARCH_LIBS([strlcpy], [bsd], [], [
+  AC_MSG_ERROR([unable to find the strlcpy() function (missing libbsd?)])
+])
+AC_CHECK_HEADERS([bsd/string.h])
+
 ## Checks for doxygen presence
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
 AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])

+ 2 - 0
src/smb_ntlm.c

@@ -22,7 +22,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/time.h>
+#ifdef HAVE_BSD_STRING_H
 #include <bsd/string.h>
+#endif
 
 #include "mdx/md4.h"
 #include "rc4/rc4.h"