[waf] also check for hdf5 directly
authorPaul Brossier <piem@piem.org>
Mon, 27 Dec 2021 03:07:02 +0000 (22:07 -0500)
committerPaul Brossier <piem@piem.org>
Wed, 29 Dec 2021 16:52:03 +0000 (11:52 -0500)
current brew does not ship libdhf5.pc

wscript

diff --git a/wscript b/wscript
index 71ea095..8287989 100644 (file)
--- a/wscript
+++ b/wscript
@@ -524,10 +524,16 @@ def configure(ctx):
         ctx.define('HAVE_MEMCPY_HACKS', 1)
 
     if (ctx.options.enable_hdf5 != False):
+        # try with pkg-config
         ctx.check_cfg(package='hdf5', args='--cflags --libs',
+                uselib_store='HDF5', mandatory=False)
+        # also try directly
+        ctx.check(lib=['hdf5'], use = ['HDF5'],
                 uselib_store='HDF5', mandatory=ctx.options.enable_hdf5)
         ctx.check(lib=['hdf5_hl'], use = ['HDF5'],
                 uselib_store='HDF5_HL', mandatory=ctx.options.enable_hdf5)
+        if 'LIB_HDF5_HL' in ctx.env and 'LIB_HDF5' in ctx.env:
+            ctx.define('HAVE_HDF5', 1)
 
     # write configuration header
     ctx.write_config_header('src/config.h')