[PATCH] lib/util: Fix build for lttng libraries that does not support tracef

Christof Schmitt cs at samba.org
Tue Sep 12 20:02:28 UTC 2017

From 40db7fb2b8e6214fdc713b51721e8598c923485e Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Thu, 8 Sep 2016 14:03:02 -0700
Subject: [PATCH] lib/util: Fix build for lttng libraries that does not support

On a system that has older lttng-ust development headers installed that
do not yet provide the tracef api, configure fails with:

Checking for library lttng-ust : yes
ERROR: Target 'lttng-ust' in directory /samba/lib/util re-defined as EMPTY - was SYSLIB

Fix the initialization order in waf, to not redefine the lttng-ust

Signed-off-by: Christof Schmitt <cs at samba.org>
 lib/util/wscript_configure | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure
index 7c17633..8e5a59c 100644
--- a/lib/util/wscript_configure
+++ b/lib/util/wscript_configure
@@ -122,6 +122,8 @@ if Options.options.enable_systemd != False:
         conf.CHECK_LIB('systemd-daemon', shlib=True)
         conf.CHECK_LIB('systemd-journal', shlib=True)
+conf.SET_TARGET_TYPE('lttng-ust', 'EMPTY')
 if Options.options.enable_lttng != False:
     conf.CHECK_CFG(package='lttng-ust', args='--cflags --libs',
                    msg='Checking for lttng-ust', uselib_store="LTTNG-UST")
@@ -132,9 +134,6 @@ if (conf.CONFIG_SET('HAVE_LTTNG_TRACEF_H') and
     conf.DEFINE('HAVE_LTTNG_TRACEF', '1')
     conf.env['HAVE_LTTNG_TRACEF'] = True
-    conf.SET_TARGET_TYPE('lttng-ust', 'EMPTY')
-    conf.undefine('HAVE_LTTNG_TRACEF')
 conf.env['CPPPATH_GPFS'] = Options.options.gpfs_headers_dir
 if conf.CHECK_HEADERS('gpfs.h', False, False, "gpfs"):

More information about the samba-technical mailing list