From 79ed96217458d0e2a1ef742b0c9ffd858d030a61 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 2 Nov 2002 09:05:26 +0000 Subject: [PATCH] Autoconf/automake macro for the Gedcom parser library. --- m4/.cvsignore | 1 + m4/Makefile.am | 4 ++++ m4/gedcom.m4 | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 m4/.cvsignore create mode 100644 m4/Makefile.am create mode 100644 m4/gedcom.m4 diff --git a/m4/.cvsignore b/m4/.cvsignore new file mode 100644 index 0000000..70845e0 --- /dev/null +++ b/m4/.cvsignore @@ -0,0 +1 @@ +Makefile.in diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 0000000..a8d4f3a --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1,4 @@ +## Process this file with automake to produce Makefile.in +# $Id$ +# $Name$ +EXTRA_DIST = gedcom.m4 diff --git a/m4/gedcom.m4 b/m4/gedcom.m4 new file mode 100644 index 0000000..d233573 --- /dev/null +++ b/m4/gedcom.m4 @@ -0,0 +1,36 @@ +dnl Autoconf/automake macros for the Gedcom parser library +dnl Peter Verthez +dnl +dnl $Id$ +dnl $Name$ + +dnl AM_LIB_GEDCOM_PARSER([MINIMUM-MAJOR-VERSION, [MINIMUM-MINOR-VERSION]]) +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 +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) + AC_TRY_RUN([ +#include +#include +#include +int +main() +{ +if (GEDCOM_PARSE_VERSION >= $major_version * 1000 + $minor_version) exit(0); +exit(1); +}], +ac_gedcom_version_ok='yes', +ac_gedcom_version_ok='no', +ac_gedcom_version_ok='no') +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) +fi +]) -- 2.30.2