summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-06-30 15:46:21 +0200
committerVolker Lendecke <vl@samba.org>2015-11-19 07:01:09 +0100
commit5f6c4fa4860f794d25f1fcc2e557ca81cbe90183 (patch)
tree1621a361611c2da7e9d490274d8c4b112a9656d6 /lib
parentb64f24971c5930ff382af6f69ab1fd84b4024fbf (diff)
downloadsamba-5f6c4fa4860f794d25f1fcc2e557ca81cbe90183.tar.gz
libreplace: Only check for malloc.h if needed
OpenBSD complains that malloc.h is deprecated on every gcc invocation. That hides a lot of real warnings. malloc and friends nowadays are typically defined in stdlib.h, only check there. We need memalign. On OpenBSD this does not exist, so libreplace replaces it. The wscript test in libreplace only checks whether memalign can link. Unfortunately in glibc memalign comes from malloc.h. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/wscript9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index d6cddf513c3..37cbbb7dc23 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -44,7 +44,10 @@ def configure(conf):
conf.CHECK_HEADERS('sys/resource.h sys/security.h sys/shm.h sys/statfs.h sys/statvfs.h sys/termio.h')
conf.CHECK_HEADERS('sys/vfs.h sys/xattr.h termio.h termios.h sys/file.h')
conf.CHECK_HEADERS('sys/ucontext.h sys/wait.h sys/stat.h')
- conf.CHECK_HEADERS('malloc.h')
+
+ if not conf.CHECK_DECLS('malloc', headers='stdlib.h'):
+ conf.CHECK_HEADERS('malloc.h')
+
conf.CHECK_HEADERS('grp.h')
conf.CHECK_HEADERS('sys/select.h setjmp.h utime.h sys/syslog.h syslog.h')
conf.CHECK_HEADERS('stdarg.h vararg.h sys/mount.h mntent.h')
@@ -247,6 +250,10 @@ def configure(conf):
conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+
+ if conf.CONFIG_SET('HAVE_MEMALIGN'):
+ conf.CHECK_DECLS('memalign', headers='malloc.h')
+
conf.CHECK_FUNCS('prctl dirname basename')
# libbsd on some platforms provides strlcpy and strlcat