Describe how to check library version in configure.in.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 19 Jan 2002 16:08:10 +0000 (16:08 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 19 Jan 2002 16:08:10 +0000 (16:08 +0000)
doc/usage.html

index 5d36b89c44c46d6dcac2f5dde82ecaca5586b8be..a87f8020b58eb3d62c1f7da2d3f938cf84af58a3 100644 (file)
         <li><a href="#Error_treatment">Error treatment</a></li>
         <li><a href="#Compatibility_mode">Compatibility mode</a></li>
                
-  </ul><li><a href="#Converting_character_sets">Converting character sets</a><br>
+  </ul><li><a href="#Converting_character_sets">Converting character sets</a></li><li><a href="#Support_for_configure.in">Support for configure.in</a><br>
   </li>
 
+
       <li><a href="interface.html">Interface details</a><br>
          </li>
          
@@ -563,9 +564,46 @@ characters can't be represented in the target character set). &nbsp;The <code>ic
                                           <pre><code>iconv_close(iconv_handle);<br></code></pre>
                                           </blockquote>
                                           </blockquote>
-                                              The example implementation mentioned above grows the output buffer dynamically and outputs
-"?" for characters that can't be converted.<br>
-                                              <br>
+                                               The example implementation
+mentioned above grows the output buffer dynamically and outputs "?" for characters
+that can't be converted.<br>
+                                              
+                                              <hr width="100%" size="2">
+                                              <h2><a name="Support_for_configure.in"></a>Support for configure.in</h2>
+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):<br>
+                                              <blockquote><code>AC_CHECK_LIB(gedcom, gedcom_parse_file,,<br>
+&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AC_MSG_ERROR(Cannot find libgedcom: Please install gedcom-parse))<br>
+AC_CACHE_CHECK(for libgedcom version, ac_cv_gedcom_version_ok,<br>
+[AC_TRY_RUN([<br>
+#include &lt;stdio.h&gt;<br>
+#include &lt;stdlib.h&gt;<br>
+#include &lt;gedcom.h&gt;<br>
+int<br>
+main()<br>
+{<br>
+if (GEDCOM_PARSE_VERSION &gt;= 1034) exit(0);<br>
+exit(1);<br>
+}],<br>
+ac_cv_gedcom_version_ok='yes',<br>
+ac_cv_gedcom_version_ok='no')])<br>
+if test "$ac_cv_gedcom_version_ok" = 'yes' ; then<br>
+&nbsp; AC_MSG_RESULT(ok)<br>
+else<br>
+&nbsp; AC_MSG_RESULT(not ok)<br>
+&nbsp; AC_MSG_ERROR(You need at least version 1.34 of gedcom-parse)<br>
+fi</code><br>
+                                                </blockquote>
+
+There are three preprocessor symbols defined for version checks in the header:<br>
+                                                <ul>
+                                                  <li><code>GEDCOM_PARSE_VERSION_MAJOR</code></li>
+                                                  <li><code>GEDCOM_PARSE_VERSION_MINOR</code></li>
+                                                  <li><code>GEDCOM_PARSE_VERSION</code><br>
+                                                  </li>
+                                                </ul>
+The last one is equal to <code>(GEDCOM_PARSE_VERSION_MAJOR * 1000) + GEDCOM_PARSE_VERSION_MINOR.</code><br>
 <hr width="100%" size="2">                           
                                    
                     <pre><font size="-1">$Id$<br>$Name$</font><br></pre>