lib/util: Fix build for lttng libraries that does not support tracef
authorChristof Schmitt <cs@samba.org>
Thu, 8 Sep 2016 21:03:02 +0000 (14:03 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 27 Sep 2017 20:11:11 +0000 (22:11 +0200)
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
target

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/util/wscript_configure

index 7c176334c984d37347e89f7c6fb2bc30f65a55ed..8e5a59c84803d8518eac3e25a92bb3219a3d62eb 100644 (file)
@@ -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.CONFIG_SET('HAVE_LTTNG_UST')):
     conf.DEFINE('HAVE_LTTNG_TRACEF', '1')
     conf.env['HAVE_LTTNG_TRACEF'] = True
-else:
-    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"):