waf:lib/replace fix gettext detection
authorChristian Ambach <ambi@samba.org>
Thu, 12 Dec 2013 21:10:36 +0000 (22:10 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 10 Mar 2014 15:10:37 +0000 (16:10 +0100)
if the user has specified a path for gettext, add it to CFLAGS and LDFLAGS
so we can find it during configure and build

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 31db0c8acdd68f396417e1f6504a91a40295bc89)

replace/wscript

index 91a93ef680a61a91e54365fa57db55cbf5b2050b..5c79517141c107bee4a3a397e489302e061162e0 100644 (file)
@@ -366,6 +366,13 @@ removeea setea
     # try to find libintl (if --without-gettext is not given)
     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"]);
         conf.CHECK_HEADERS('libintl.h')
         conf.CHECK_LIB('intl')
         conf.CHECK_DECLS('dgettext gettext bindtextdomain textdomain bind_textdomain_codeset', headers="libintl.h")