]> granicus.if.org Git - graphviz/commitdiff
Autotools: discover libANN manually if ann.pc is missing
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 2 Jan 2023 17:24:43 +0000 (09:24 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 2 Jan 2023 18:01:45 +0000 (10:01 -0800)
On Debian and Debian derivatives (e.g. Ubuntu) the libann and libann-dev
packages ship without an ann.pc file to support `pkg-config`. As a result of
this, `pkg-config` cannot find libANN and concludes it is not installed.

This change teaches the Autotools build system how to discover libANN manually
if the `pkg-config` technique fails. Note that we need to use `AC_CHECK_FILE`
instead of `AC_CHECK_HEADER` because libANN is in C++.

Gitlab: closes #1835

CHANGELOG.md
ci/tests.py
configure.ac

index 1be153c542dbed613ebdb19b6cff61aaa6f1caf6..075c03563210252f89d3e2c46b24edb56f1f6d9c 100644 (file)
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   from ~3.8MB to 32MB. #1710
 - Reserved stack size on macOS for the `dot` binary when built with CMake has
   been increased from 8MB to 32MB. #1710
+- The Autotools build system can now find libANN on Debian-based operating
+  systems, enabling compilation of libmingle and `mingle`. #1835
 
 ### Fixed
 
index 73f917fc11bcb55f0ce1817781252d8896aedc85..e2167a2a80e54a31f55a10267ef3f696a45282ac 100644 (file)
@@ -115,12 +115,6 @@ def test_existence(binary: str):
 
   os_id = _freedesktop_os_release().get("ID")
 
-  # FIXME: Remove skip when
-  # https://gitlab.com/graphviz/graphviz/-/issues/1835 is fixed
-  if os_id == "ubuntu" and binary == "mingle" and not is_cmake():
-    check_that_tool_does_not_exist(binary, os_id)
-    pytest.skip(f"mingle is not built for {os_id} (#1835)")
-
   # FIXME: Remove skip when
   # https://gitlab.com/graphviz/graphviz/-/issues/1834 is fixed
   if os_id == "centos" and binary == "smyrna":
index ef8a8113fd0a492be85e21438864e0f6bb0c8464..2439de5e7d2e1ec1d7ea7f73ea3d1ec4a8ceb144 100644 (file)
@@ -1924,7 +1924,18 @@ else
     AC_SUBST([ANN_CFLAGS])
     AC_SUBST([ANN_LIBS])
   ],[
-    use_ann="No (no ann.pc found)"
+    # fall back discovery for the Debian ecosystem which does not ship an ann.pc
+    AC_CHECK_FILE(/usr/include/ANN/ANN.h, [
+      ANN_CFLAGS= # nothing required
+      AC_CHECK_LIB(ann, ann_visit_pts, [
+        ANN_LIBS=-lann
+        use_ann="Yes"
+      ], [
+        use_ann="No (no ann.pc or libANN found)"
+      ])
+    ], [
+      use_ann="No (no ann.pc or ANN.h found)"
+    ])
   ])
 fi
 AM_CONDITIONAL(WITH_ANN, [test x"${use_ann%% *}" = "xYes"])