From: Peter Verthez Date: Sun, 3 Nov 2002 10:09:57 +0000 (+0000) Subject: Use gedcom_check_version when available. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=92e0840a09f9226d81a22aae95aa7f7d10f3d316;p=gedcom-parse.git Use gedcom_check_version when available. --- diff --git a/m4/gedcom.m4 b/m4/gedcom.m4 index d233573..9c88ecf 100644 --- a/m4/gedcom.m4 +++ b/m4/gedcom.m4 @@ -4,24 +4,34 @@ dnl dnl $Id$ dnl $Name$ -dnl AM_LIB_GEDCOM_PARSER([MINIMUM-MAJOR-VERSION, [MINIMUM-MINOR-VERSION]]) +dnl AM_LIB_GEDCOM_PARSER([MINIMUM-MAJOR-VERSION, [MINIMUM-MINOR-VERSION, +dnl [MINIMUM-PATCH]]]) dnl Test for the availability of the Gedcom parser library, and check whether dnl the required minimum version is available (parameters default to 0 if -dnl not given +dnl not given) AC_DEFUN(AM_LIB_GEDCOM_PARSER, [ AC_CHECK_LIB(gedcom, gedcom_parse_file,, AC_MSG_ERROR([Cannot find libgedcom: Please install gedcom-parse])) major_version=ifelse([$1], ,0,$1) minor_version=ifelse([$2], ,0,$2) - AC_MSG_CHECKING(for libgedcom version >= $major_version.$minor_version) + patch_version=ifelse([$3], ,0,$3) + if test "$patch_version" = '0'; then + AC_MSG_CHECKING(for libgedcom version >= $major_version.$minor_version) + else + AC_MSG_CHECKING(for libgedcom version >= $major_version.$minor_version.$patch_version) + fi AC_TRY_RUN([ -#include #include #include int main() { +#ifdef GEDCOM_PARSE_VERSION_PATCH +if (gedcom_check_version($major_version, $minor_version, $patch_version)) + exit(0); +#else if (GEDCOM_PARSE_VERSION >= $major_version * 1000 + $minor_version) exit(0); +#endif exit(1); }], ac_gedcom_version_ok='yes', @@ -31,6 +41,10 @@ if test "$ac_gedcom_version_ok" = 'yes' ; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(not ok) - AC_MSG_ERROR(You need at least version $major_version.$minor_version of gedcom-parse) + if test "$patch_version" = '0'; then + AC_MSG_ERROR(You need at least version $major_version.$minor_version of gedcom-parse) + else + AC_MSG_ERROR(You need at least version $major_version.$minor_version.$patch_version of gedcom-parse) + fi fi ])