1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

waf:lib/replace change detection of gettext

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>
This commit is contained in:
Christian Ambach
2013-12-12 22:12:07 +01:00
parent df6ddcfbfc
commit a83f491810
2 changed files with 6 additions and 6 deletions

View File

@ -80,8 +80,7 @@ def set_options(opt):
match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h']) match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
opt.add_option('--with-gettext', opt.add_option('--with-gettext',
help='additional directory to search for gettext', help='additional directory to search for gettext',
action='store', dest='gettext_location', default='/usr/local', action='store', dest='gettext_location', default='None')
match = ['Checking for library intl', 'Checking for header libintl.h'])
opt.add_option('--without-gettext', opt.add_option('--without-gettext',
help=("Disable use of gettext"), help=("Disable use of gettext"),
action="store_true", dest='disable_gettext', default=False) action="store_true", dest='disable_gettext', default=False)

View File

@ -367,6 +367,7 @@ removeea setea
headers='netinet/in.h arpa/nameser.h resolv.h') headers='netinet/in.h arpa/nameser.h resolv.h')
# try to find libintl (if --without-gettext is not given)
conf.env.intl_libs='' conf.env.intl_libs=''
if not Options.options.disable_gettext: if not Options.options.disable_gettext:
conf.CHECK_HEADERS('libintl.h') conf.CHECK_HEADERS('libintl.h')
@ -398,10 +399,10 @@ removeea setea
if conf.env['HAVE_GETTEXT'] and conf.env['HAVE_DGETTEXT']: if conf.env['HAVE_GETTEXT'] and conf.env['HAVE_DGETTEXT']:
# save for dependency definitions # save for dependency definitions
conf.env.intl_libs='iconv intl' conf.env.intl_libs='iconv intl'
else:
conf.fatal('library gettext not found, try specifying the path to ' + # did the user insist on gettext (--with-gettext)?
'it with --with-gettext=</path/to/gettext> or ' + if Options.options.gettext_location != 'None' and (not conf.env['HAVE_GETTEXT'] or not conf.env['HAVE_DGETTEXT']):
'--without-gettext to build without''') conf.fatal('library gettext not found at specified location')
conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h') conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')