Improve finding of libicu without pkgconfig.
authorCarl Hetherington <cth@carlh.net>
Fri, 25 Sep 2015 19:31:05 +0000 (20:31 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Sep 2015 19:31:05 +0000 (20:31 +0100)
wscript

diff --git a/wscript b/wscript
index c4e6fdf42b1c276715556a99dcf80d56d06680a1..2970e8fc555d53dc15edb941a8bc8baad8701677 100644 (file)
--- a/wscript
+++ b/wscript
@@ -162,7 +162,19 @@ def configure(conf):
     # libicu
     if conf.check_cfg(package='icu-i18n', args='--cflags --libs', uselib_store='ICU', mandatory=False) is None:
         if conf.check_cfg(package='icu', args='--cflags --libs', uselib_store='ICU', mandatory=False) is None:
-            Logs.pprint('RED', 'libicu not found')
+            conf.check_cxx(fragment="""
+                            #include <unicode/ucsdet.h>
+                            int main(void) {
+                                UErrorCode status = U_ZERO_ERROR;
+                                UCharsetDetector* detector = ucsdet_open (&status);
+                                return 0; }\n
+                            """,
+                       mandatory=True,
+                       msg='Checking for libicu',
+                       okmsg='yes',
+                       libpath=['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'],
+                       lib=['icuio', 'icui18n', 'icudata'],
+                       uselib_store='ICU')
 
     # libsndfile
     conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True)