waf:lib/replace change detection of gettext
authorChristian Ambach <ambi@samba.org>
Thu, 12 Dec 2013 21:12:07 +0000 (22:12 +0100)
committerChristian Ambach <ambi@samba.org>
Fri, 3 Jan 2014 04:04:44 +0000 (05:04 +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>
buildtools/wafsamba/wscript
lib/replace/wscript

index fe2e51507e7bf0bb9274f91efedb1765bddb6750..79842278861dfcd6e956c0c6e6f044645839a163 100755 (executable)
@@ -80,8 +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='/usr/local',
-                   match = ['Checking for library intl', 'Checking for header libintl.h'])
+                   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)
index 6784dd3cb814573ef2a25c1dff83c8889de252c1..5f29e9fe7b094f07737711411bd306eb59131e07 100644 (file)
@@ -367,6 +367,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')
@@ -398,10 +399,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')