waf:lib/replace change detection of gettext
authorChristian Ambach <ambi@samba.org>
Thu, 12 Dec 2013 21:12:07 +0000 (22:12 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 10 Mar 2014 15:10:37 +0000 (16:10 +0100)
convert this to an automatic check: if no option is given, try to find gettext
and if found, use it
if user has specified --with-gettext, then bail out if it could not be found
in case of --without-gettext, skip all gettext related configure checks

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 a83f491810d34cc8b6eb4b0f40bbbb1440e0f84d)

replace/wscript

index 8b82b75da63807f1fdbe3082e93bf9fc2800d84b..91a93ef680a61a91e54365fa57db55cbf5b2050b 100644 (file)
@@ -363,6 +363,7 @@ removeea setea
                         headers='netinet/in.h arpa/nameser.h resolv.h')
 
 
+    # try to find libintl (if --without-gettext is not given)
     conf.env.intl_libs=''
     if not Options.options.disable_gettext:
         conf.CHECK_HEADERS('libintl.h')
@@ -394,10 +395,10 @@ removeea setea
             if conf.env['HAVE_GETTEXT'] and conf.env['HAVE_DGETTEXT']:
                 # save for dependency definitions
                 conf.env.intl_libs='iconv intl'
-            else:
-                conf.fatal('library gettext not found, try specifying the path to ' +
-                           'it with --with-gettext=</path/to/gettext> or ' +
-                           '--without-gettext to build without''')
+
+    # 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']):
+        conf.fatal('library gettext not found at specified location')
 
     conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')