From d27c1e2f6913e32c4725d1ea8d96d2a43af0855e Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sun, 25 Oct 2015 00:05:13 +0200 Subject: [PATCH] build:wafsamba: dead code removal in gettext detection The values conf.env.CFLAGS and conf.env.LDFLAGS have no effect in waf 1.5 Additionally, values must be appended using: conf.env.append_value('CCFLAGS', value) In this case, conf.env.CFLAGS returns an new empty list because it is the wrong variable, so the appending has no effect whatsoever Finally, the default value for gettext_option should be None without quotes Signed-off-by: Thomas Nagy Reviewed-by: Reviewed-by: --- buildtools/wafsamba/wscript | 2 +- lib/replace/wscript | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index aca444b..26bb563 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -80,7 +80,7 @@ def set_options(opt): match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h']) opt.add_option('--with-gettext', help='additional directory to search for gettext', - action='store', dest='gettext_location', default='None') + action='store', dest='gettext_location', default=None) opt.add_option('--without-gettext', help=("Disable use of gettext"), action="store_true", dest='disable_gettext', default=False) diff --git a/lib/replace/wscript b/lib/replace/wscript index 0be52f7..36f2b47 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -362,12 +362,9 @@ removeea setea conf.env.intl_libs='' if not Options.options.disable_gettext: # any extra path given to look at? - if not Options.options.gettext_location == 'None': - conf.env['CFLAGS'].extend(["-I%s" % Options.options.gettext_location]); - conf.env['LDFLAGS'].extend(["-L%s" % Options.options.gettext_location]); - else: - conf.env['CFLAGS'].extend(["-I/usr/local"]); - conf.env['LDFLAGS'].extend(["-L/usr/local"]); + if Options.options.gettext_location: + conf.env.append_value('CCFLAGS', "-I%s" % Options.options.gettext_location) + conf.env.append_value('LINKFLAGS', "-L%s" % Options.options.gettext_location) conf.CHECK_HEADERS('libintl.h') conf.CHECK_LIB('intl') conf.CHECK_DECLS('dgettext gettext bindtextdomain textdomain bind_textdomain_codeset', headers="libintl.h") @@ -408,7 +405,7 @@ removeea setea conf.undefine('HAVE_DECL_DGETTEXT') # did the user insist on gettext (--with-gettext)? - if Options.options.gettext_location != 'None' and (not conf.env['HAVE_GETTEXT'] or not conf.env['HAVE_DGETTEXT']): + if Options.options.gettext_location and (not conf.env['HAVE_GETTEXT'] or not conf.env['HAVE_DGETTEXT']): conf.fatal('library gettext not found at specified location') conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')