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