From e57da77bf119ca4f74bf21e2b1d2d2ab2265db72 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 19 Jan 2002 16:08:10 +0000 Subject: [PATCH] Describe how to check library version in configure.in. --- doc/usage.html | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/doc/usage.html b/doc/usage.html index 5d36b89..a87f802 100644 --- a/doc/usage.html +++ b/doc/usage.html @@ -25,9 +25,10 @@
  • Error treatment
  • Compatibility mode
  • -
  • Converting character sets
    +
  • Converting character sets
  • Support for configure.in
  • +
  • Interface details
  • @@ -563,9 +564,46 @@ characters can't be represented in the target character set).  The ic
    iconv_close(iconv_handle);
    - The example implementation mentioned above grows the output buffer dynamically and outputs -"?" for characters that can't be converted.
    -
    + The example implementation +mentioned above grows the output buffer dynamically and outputs "?" for characters +that can't be converted.
    + +
    +

    Support for configure.in

    +Programs using the GEDCOM parser library and using autoconf to configure +their sources can use the following statements in configure.in (the example +is checking for gedcom-parse, version 1.34):
    +
    AC_CHECK_LIB(gedcom, gedcom_parse_file,,
    +             AC_MSG_ERROR(Cannot find libgedcom: Please install gedcom-parse))
    +AC_CACHE_CHECK(for libgedcom version, ac_cv_gedcom_version_ok,
    +[AC_TRY_RUN([
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <gedcom.h>
    +int
    +main()
    +{
    +if (GEDCOM_PARSE_VERSION >= 1034) exit(0);
    +exit(1);
    +}],
    +ac_cv_gedcom_version_ok='yes',
    +ac_cv_gedcom_version_ok='no')])
    +if test "$ac_cv_gedcom_version_ok" = 'yes' ; then
    +  AC_MSG_RESULT(ok)
    +else
    +  AC_MSG_RESULT(not ok)
    +  AC_MSG_ERROR(You need at least version 1.34 of gedcom-parse)
    +fi

    +
    + +There are three preprocessor symbols defined for version checks in the header:
    + +The last one is equal to (GEDCOM_PARSE_VERSION_MAJOR * 1000) + GEDCOM_PARSE_VERSION_MINOR.

    $Id$
    $Name$

    -- 2.30.2