]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
util: Add detection of libunwind
authorMartin Schwenke <martin@meltin.net>
Tue, 1 Oct 2019 03:52:38 +0000 (13:52 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 21 Jan 2020 08:12:17 +0000 (08:12 +0000)
The current detection doesn't seem to work, so libunwind doesn't seem
to be used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jan 21 08:12:17 UTC 2020 on sn-devel-184

lib/util/wscript_build
lib/util/wscript_configure

index 3a80b93b2c7f2507462444a69e9e4052b150b900..a827eea3ed946d3fa1ad467e948b1ba96ab7b5d9 100644 (file)
@@ -82,7 +82,7 @@ bld.SAMBA_SUBSYSTEM('samba-util-core',
                               become_daemon.c mkdir_p.c''',
                     deps='''time-basic samba-debug socket-blocking talloc
                             tevent execinfo pthread strv tini''',
-                    public_deps='systemd systemd-daemon sys_rw',
+                    public_deps='systemd systemd-daemon sys_rw LIBUNWIND',
                     local_include=False)
 
 bld.SAMBA_LIBRARY('iov_buf',
index 93853511575636c70f46fcccaf8cbc1c468bd2e4..4f57184f5156866ab33577d140d970d6149b2d1c 100644 (file)
@@ -8,7 +8,16 @@ if Options.options.disable_fault_handling:
 
 # backtrace could be in libexecinfo or in libc
 conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h')
-conf.CHECK_HEADERS('execinfo.h libunwind.h')
+conf.CHECK_HEADERS('execinfo.h')
+
+conf.SET_TARGET_TYPE('LIBUNWIND', 'EMPTY')
+if conf.check_cfg(package='libunwind-generic',
+                  args='--cflags --libs',
+                  msg='Checking for libunwind',
+                  uselib_store='LIBUNWIND',
+                  mandatory=False):
+    if conf.CHECK_HEADERS('libunwind.h'):
+        conf.SET_TARGET_TYPE('LIBUNWIND', 'SYSLIB')
 
 conf.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define='HAVE_FRSIZE', headers='sys/statvfs.h')