From 5c875f454016583297dbba623f470d6c0341d57b Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 2 Jul 2024 23:29:55 +0100 Subject: [PATCH] use pkg-config to find msolve, otherwise try to run it --- build/pkgs/msolve/spkg-configure.m4 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 build/pkgs/msolve/spkg-configure.m4 diff --git a/build/pkgs/msolve/spkg-configure.m4 b/build/pkgs/msolve/spkg-configure.m4 new file mode 100644 index 00000000000..b0440b9b071 --- /dev/null +++ b/build/pkgs/msolve/spkg-configure.m4 @@ -0,0 +1,23 @@ +SAGE_SPKG_CONFIGURE([msolve], [ + PKG_CHECK_MODULES([msolve], [msolve >= 0.6.5], [], [ + AC_CACHE_CHECK([for msolve], [ac_cv_path_MSOLVE], + [AC_PATH_PROGS_FEATURE_CHECK([MSOLVE], [msolve], + [msolvin=$(mktemp) + msolvout=$(mktemp) + msolvchk=$(mktemp) + echo -e 'x,y\n0\nx-y,\nx*y-1' >$msolvin + changequote(<<, >>)dnl + echo -e '[0, [1,\n[[[-1, -1], [-1, -1]], [[1, 1], [1, 1]]]\n]]:' >$msolvchk + changequote([, ])dnl + $ac_path_MSOLVE -f $msolvin -o $msolvout + AS_IF([test x$(diff $msolvout $msolvchk) = x], + [ac_cv_path_MSOLVE=$ac_path_MSOLVE + ac_path_MSOLVE_found=:], + [sage_spkg_install_msolve=yes + AC_MSG_RESULT([could not find working msolve]) + ]) + ], [sage_spkg_install_msolve=yes + AC_MSG_RESULT([could not find working msolve]) + ])]) + ]) +])