tdb: Remove libbsd dependency
authorRosen Penev <rosenp@gmail.com>
Fri, 31 Aug 2018 23:48:35 +0000 (16:48 -0700)
committerJo-Philipp Wich <jo@mein.io>
Mon, 24 Sep 2018 06:46:29 +0000 (08:46 +0200)
libbsd gets picked up since it's no longer limited to glibc.

Patch identical to libtalloc one. Same codebase.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 33dc529e0050519d45b73a05527fa04614482ae9)

libs/tdb/Makefile
libs/tdb/patches/100-Remove_libbsd_dependency_check.patch [new file with mode: 0644]

index 43131a16a4de11a53b8aab472699d4f9f75a0285..12558de0754d31834828b3930138a1f3998c630d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tdb
 PKG_VERSION:=1.3.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/libs/tdb/patches/100-Remove_libbsd_dependency_check.patch b/libs/tdb/patches/100-Remove_libbsd_dependency_check.patch
new file mode 100644 (file)
index 0000000..150d17b
--- /dev/null
@@ -0,0 +1,61 @@
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index fd00a42..337d559 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -340,22 +340,13 @@ def configure(conf):
+     conf.CHECK_FUNCS('prctl dirname basename')
+-    strlcpy_in_bsd = False
+-
+-    # libbsd on some platforms provides strlcpy and strlcat
+-    if not conf.CHECK_FUNCS('strlcpy strlcat'):
+-        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+-                               checklibc=True):
+-            strlcpy_in_bsd = True
+-    if not conf.CHECK_FUNCS('getpeereid'):
+-        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+-        conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS('setproctitle_init'):
+-        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+-    if not conf.CHECK_FUNCS('closefrom'):
+-        conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++    # Not checking for libbsd
++    conf.CHECK_FUNCS('strlcpy strlcat')
++    conf.CHECK_FUNCS('getpeereid')
++    conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
++    conf.CHECK_FUNCS('setproctitle_init')
++
++    conf.CHECK_FUNCS('closefrom')
+     conf.CHECK_CODE('''
+                 struct ucred cred;
+@@ -698,9 +689,6 @@ def configure(conf):
+     # look for a method of finding the list of network interfaces
+     for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+-        bsd_for_strlcpy = ''
+-        if strlcpy_in_bsd:
+-            bsd_for_strlcpy = ' bsd'
+         if conf.CHECK_CODE('''
+                            #define %s 1
+                            #define NO_CONFIG_H 1
+@@ -713,7 +701,7 @@ def configure(conf):
+                            #include "test/getifaddrs.c"
+                            ''' % method,
+                            method,
+-                           lib='nsl socket' + bsd_for_strlcpy,
++                           lib='nsl socket',
+                            addmain=False,
+                            execute=True):
+             break
+@@ -761,7 +749,6 @@ def build(bld):
+                 break
+     extra_libs = ''
+-    if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
+     bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
+         REPLACE_HOSTCC_SOURCE,