- conf.check_cxx(fragment = """
- #include <boost/filesystem.hpp>\n
- int main() { boost::filesystem::copy_file ("a", "b"); }\n
- """,
- msg = 'Checking for boost filesystem library',
- libpath = '/usr/local/lib',
- lib = ['boost_filesystem', 'boost_system'],
- uselib_store = 'BOOST_FILESYSTEM')
-
- conf.check_cxx(fragment = """
- #include <boost/locale.hpp>\n
- int main() { boost::locale::conv::to_utf<char> ("a", "cp850"); }\n
- """,
- msg = 'Checking for boost locale library',
- libpath = '/usr/local/lib',
- lib = ['boost_locale', 'boost_system'],
- uselib_store = 'BOOST_LOCALE')
-
- conf.recurse('test')
+ conf.check_cxx(fragment="""
+ #include <boost/filesystem.hpp>\n
+ int main() { boost::filesystem::copy_file ("a", "b"); }\n
+ """,
+ msg='Checking for boost filesystem library',
+ libpath='/usr/local/lib',
+ lib=['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
+ uselib_store='BOOST_FILESYSTEM')
+
+ # Find the icu- libraries on the system as we need to link to them when we look for boost locale.
+ locale_libs = ['boost_locale%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix]
+ for pkg in subprocess.check_output(['pkg-config', '--list-all']).splitlines():
+ pkg = pkg.decode('utf-8')
+ if pkg.startswith("icu"):
+ for lib in subprocess.check_output(['pkg-config', '--libs-only-l', pkg.split()[0]]).split():
+ name = lib[2:]
+ if not name in locale_libs:
+ locale_libs.append(name.decode('utf-8'))
+
+ conf.check_cxx(fragment="""
+ #include <boost/locale.hpp>\n
+ int main() { boost::locale::conv::to_utf<char> ("a", "cp850"); }\n
+ """,
+ msg='Checking for boost locale library',
+ libpath='/usr/local/lib',
+ lib=locale_libs,
+ uselib_store='BOOST_LOCALE')
+
+ conf.check_cxx(fragment="""
+ #include <boost/regex.hpp>\n
+ int main() { boost::regex re ("foo"); }\n
+ """,
+ msg='Checking for boost regex library',
+ libpath='/usr/local/lib',
+ lib=['boost_regex%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
+ uselib_store='BOOST_REGEX')
+
+ if not conf.env.DISABLE_TESTS:
+ conf.recurse('test')