From: Peter Verthez Date: Sun, 3 Nov 2002 10:20:03 +0000 (+0000) Subject: Documenting new m4 macro for configure.in support. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=cf04c144fa910f52d44ef33d2fa9a03f912efa2e;p=gedcom-parse.git Documenting new m4 macro for configure.in support. --- diff --git a/doc/usage.html b/doc/usage.html index ee3d2d4..dc2e70a 100644 --- a/doc/usage.html +++ b/doc/usage.html @@ -681,37 +681,30 @@ handle needs to be closed (when the program exits):

-

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_MSG_CHECKING(for libgedcom version)
- AC_TRY_RUN([
- #include <stdio.h>
- #include <stdlib.h>
- #include <gedcom.h>
- int
- main()
- {
- if (GEDCOM_PARSE_VERSION >= 1034) 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 1.34 of gedcom-parse)
- fi

-
- There are three preprocessor symbols defined for version checks in the - header:
+

Support for configure.in

There +is a macro available for use in configure.in for applications that are using +autoconf to configure their sources.  The following macro checks whether +the Gedcom parser library is available and whether its version is high enough:
+
AM_LIB_GEDCOM_PARSER([major,[minor,[patch]]])
+
+All the arguments are optional and default to 0.  E.g. to check for +version 1.34, you would put in configure.in the following statement:
+
AM_LIB_GEDCOM_PARSER(1,34)
+
+To be able to use this macro in the sources of your application, you have three options:
+ +
+There are three preprocessor symbols defined for version checks in the + header (but their direct use is deprecated: please use the macro above):
The last one is equal to (GEDCOM_PARSE_VERSION_MAJOR * 1000) + GEDCOM_PARSE_VERSION_MINOR.
+
@@ -733,4 +727,5 @@ handle needs to be closed (when the program exits):



+
\ No newline at end of file