From 617871ee28e925171462d4821f60aa9f79fab94e Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 11 Dec 2010 18:50:51 +0300 Subject: [PATCH] build: add a dependency on lib iconv for lib intl if we are not able to find it This is due that on some platform lib intl depend on lib iconv, failling to provide this library cause waf to be unable to link with lib intl and makes it think that the library doesn't exists ! --- lib/replace/wscript | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 8b5980758d..86a4bdb8d8 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -210,7 +210,18 @@ def configure(conf): conf.CHECK_FUNCS_IN('res_search', 'resolv', checklibc=True, headers='netinet/in.h arpa/nameser.h resolv.h') - conf.CHECK_FUNCS_IN('gettext', 'intl', checklibc=True, headers='libintl.h') + + if not conf.CHECK_FUNCS_IN('gettext', 'intl', checklibc=True, headers='libintl.h'): + # Some hosts need lib iconv for linking with lib intl + # So we try with flags just in case it helps. + oldflags = conf.env['LDFLAGS_INTL'] + conf.env['LDFLAGS_INTL'] = "-liconv" + if not conf.CHECK_LIB('intl'): + conf.env['LDFLAGS_INTL'] = oldflags + else: + conf.CHECK_FUNCS_IN('gettext', 'intl', checklibc=True, headers='libintl.h') + + conf.CHECK_FUNCS_IN('dgettext gettext', 'intl', headers='libintl.h') conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h') conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True) -- 2.34.1