From d82756cd470c514e65762d37a1a73e677aaa0be3 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 17 Sep 2021 12:21:07 +0100 Subject: [PATCH] Add package version checking to configure --- configure | 584 ++++++++++++++++++++++++++++++++++------------ configure.ac | 16 +- m4/ocaml.m4 | 22 ++ master_changes.md | 1 + 4 files changed, 471 insertions(+), 152 deletions(-) diff --git a/configure b/configure index 606c078387c..578a44b5ea7 100755 --- a/configure +++ b/configure @@ -5821,52 +5821,126 @@ $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re" >&5 -$as_echo_n "checking for OCaml findlib package re... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re 1.9.0 or later" >&5 +$as_echo_n "checking for OCaml findlib package re 1.9.0 or later... " >&6; } + + if version=`$OCAMLFIND query re -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "1.9.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_re=no + + else + OCAML_PKG_re=re + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in re ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_re=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_re=no fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_re=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package base64" >&5 -$as_echo_n "checking for OCaml findlib package base64... " >&6; } +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package base64 3.1.0 or later" >&5 +$as_echo_n "checking for OCaml findlib package base64 3.1.0 or later... " >&6; } + + if version=`$OCAMLFIND query base64 -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "3.1.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_base64=no + + else + OCAML_PKG_base64=base64 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in base64 ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_base64=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_base64=no fi +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_base64=no + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cmdliner" >&5 @@ -5917,100 +5991,248 @@ $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cudf" >&5 -$as_echo_n "checking for OCaml findlib package cudf... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cudf 0.7 or later" >&5 +$as_echo_n "checking for OCaml findlib package cudf 0.7 or later... " >&6; } + + if version=`$OCAMLFIND query cudf -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "0.7" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_cudf=no + + else + OCAML_PKG_cudf=cudf + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in cudf ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_cudf=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_cudf=no fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_cudf=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose3.common" >&5 -$as_echo_n "checking for OCaml findlib package dose3.common... " >&6; } +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose3.common 6.1 or later" >&5 +$as_echo_n "checking for OCaml findlib package dose3.common 6.1 or later... " >&6; } + + if version=`$OCAMLFIND query dose3.common -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "6.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_dose3_common=no + + else + OCAML_PKG_dose3_common=dose3.common + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in dose3.common ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_dose3_common=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_dose3_common=no fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_dose3_common=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose3.algo" >&5 -$as_echo_n "checking for OCaml findlib package dose3.algo... " >&6; } +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose3.algo 6.1 or later" >&5 +$as_echo_n "checking for OCaml findlib package dose3.algo 6.1 or later... " >&6; } + + if version=`$OCAMLFIND query dose3.algo -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "6.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_dose3_algo=no + + else + OCAML_PKG_dose3_algo=dose3.algo + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in dose3.algo ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_dose3_algo=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_dose3_algo=no fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_dose3_algo=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package opam-file-format" >&5 -$as_echo_n "checking for OCaml findlib package opam-file-format... " >&6; } +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package opam-file-format 2.1.3 or later" >&5 +$as_echo_n "checking for OCaml findlib package opam-file-format 2.1.3 or later... " >&6; } + + if version=`$OCAMLFIND query opam-file-format -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "2.1.3" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_opam_file_format=no + + else + OCAML_PKG_opam_file_format=opam-file-format + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in opam-file-format ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_opam_file_format=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_opam_file_format=no fi +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_opam_file_format=no + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package spdx_licenses" >&5 @@ -6039,52 +6261,126 @@ $as_echo "not found" >&6; } # Optional dependencies - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package mccs" >&5 -$as_echo_n "checking for OCaml findlib package mccs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package mccs 1.1+9 or later" >&5 +$as_echo_n "checking for OCaml findlib package mccs 1.1+9 or later... " >&6; } + + if version=`$OCAMLFIND query mccs -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "1.1+9" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_mccs=no + + else + OCAML_PKG_mccs=mccs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in mccs ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_mccs=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_mccs=no fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_mccs=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package opam-0install-cudf" >&5 -$as_echo_n "checking for OCaml findlib package opam-0install-cudf... " >&6; } +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package opam-0install-cudf 0.4 or later" >&5 +$as_echo_n "checking for OCaml findlib package opam-0install-cudf 0.4 or later... " >&6; } + + if version=`$OCAMLFIND query opam-0install-cudf -format '%v' 2>/dev/null`; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "0.4" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 +$as_echo "no ($version installed)" >&6; } + OCAML_PKG_opam_0install_cudf=no + + else + OCAML_PKG_opam_0install_cudf=opam-0install-cudf + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 +$as_echo "found $version" >&6; } - unset found - unset pkg - found=no - for pkg in opam-0install-cudf ; do - if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - OCAML_PKG_opam_0install_cudf=$pkg - found=yes - break - fi - done - if test "$found" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - OCAML_PKG_opam_0install_cudf=no fi +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OCAML_PKG_opam_0install_cudf=no + +fi + + if test "x${with_mccs}" = "xno" && test "x$OCAML_PKG_mccs" != "xno"; then : diff --git a/configure.ac b/configure.ac index 47466ae045e..54f832058dc 100644 --- a/configure.ac +++ b/configure.ac @@ -325,19 +325,19 @@ echo # Dependencies AC_CHECK_OCAML_PKG([unix]) AC_CHECK_OCAML_PKG([bigarray]) -AC_CHECK_OCAML_PKG([re]) -AC_CHECK_OCAML_PKG([base64]) +AC_CHECK_OCAML_PKG_AT_LEAST([re], [1.9.0]) +AC_CHECK_OCAML_PKG_AT_LEAST([base64], [3.1.0]) AC_CHECK_OCAML_PKG([cmdliner]) AC_CHECK_OCAML_PKG([ocamlgraph]) -AC_CHECK_OCAML_PKG([cudf]) -AC_CHECK_OCAML_PKG([dose3.common]) -AC_CHECK_OCAML_PKG([dose3.algo]) -AC_CHECK_OCAML_PKG([opam-file-format]) +AC_CHECK_OCAML_PKG_AT_LEAST([cudf], [0.7]) +AC_CHECK_OCAML_PKG_AT_LEAST([dose3.common], [6.1]) +AC_CHECK_OCAML_PKG_AT_LEAST([dose3.algo], [6.1]) +AC_CHECK_OCAML_PKG_AT_LEAST([opam-file-format], [2.1.3]) AC_CHECK_OCAML_PKG([spdx_licenses]) # Optional dependencies -AC_CHECK_OCAML_PKG([mccs]) -AC_CHECK_OCAML_PKG([opam-0install-cudf]) +AC_CHECK_OCAML_PKG_AT_LEAST([mccs],[1.1+9]) +AC_CHECK_OCAML_PKG_AT_LEAST([opam-0install-cudf],[0.4]) AS_IF([test "x${with_mccs}" = "xno" && test "x$OCAML_PKG_mccs" != "xno"], [AC_MSG_ERROR([Option --without-mccs is not available without uninstalling the 'mccs' package])]) diff --git a/m4/ocaml.m4 b/m4/ocaml.m4 index 6b5da59a1f4..7746912a51a 100644 --- a/m4/ocaml.m4 +++ b/m4/ocaml.m4 @@ -224,6 +224,28 @@ AC_DEFUN([AC_CHECK_OCAML_PKG], AC_SUBST(AS_TR_SH([OCAML_PKG_$1])) ]) +AC_DEFUN([AC_CHECK_OCAML_PKG_AT_LEAST], +[dnl + AC_REQUIRE([AC_PROG_FINDLIB])dnl + + AC_MSG_CHECKING([for OCaml findlib package $1 $2 or later]) + + AS_IF([version=`$OCAMLFIND query $1 -format '%v' 2>/dev/null`],[ + AX_COMPARE_VERSION([$version],[lt],[$2],[ + AC_MSG_RESULT([no ($version installed)]) + AS_TR_SH([OCAML_PKG_$1])=no + ],[ + AS_TR_SH([OCAML_PKG_$1])=$1 + AC_MSG_RESULT([found $version]) + ]) + ],[ + AC_MSG_RESULT([no]) + AS_TR_SH([OCAML_PKG_$1])=no + ]) + + AC_SUBST(AS_TR_SH([OCAML_PKG_$1])) +]) + AC_DEFUN([AC_CHECK_OCAML_MODULE], [dnl diff --git a/master_changes.md b/master_changes.md index e2ab21695fa..877db1f2aca 100644 --- a/master_changes.md +++ b/master_changes.md @@ -100,6 +100,7 @@ users) * Add `--with-vendored-deps` to replace `make lib-ext` instruction [#4776 @dra27 - fix #4772] * Fix vendored build on mingw-w64 with g++ 11.2 [#4835 @dra27] * Switch to vendored build if spdx_licenses is missing [#4842 @dra27] + * Check versions of findlib packages in configure [#4842 @dra27] ## Infrastructure *