]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/bacula-macros/libdb.m4
Add Ingres configuration
[bacula/bacula] / bacula / autoconf / bacula-macros / libdb.m4
1 dnl # Copyright © 2008 Tim Toolan <toolan@ele.uri.edu>
2 dnl #
3 dnl # Copying and distribution of this file, with or without modification,
4 dnl # are permitted in any medium without royalty provided the copyright notice
5 dnl # and this notice are preserved.
6
7 dnl #########################################################################
8 AC_DEFUN([AX_PATH_BDB], [
9   dnl # Used to indicate success or failure of this function.
10   ax_path_bdb_ok=no
11
12   # Add --with-bdb-dir option to configure.
13   AC_ARG_WITH([bdb-dir],
14     [AC_HELP_STRING([--with-bdb-dir=DIR],
15                     [Berkeley DB installation directory])])
16
17   # Check if --with-bdb-dir was specified.
18   if test "x$with_bdb_dir" = "x" ; then
19     # No option specified, so just search the system.
20     AX_PATH_BDB_NO_OPTIONS([$1], [HIGHEST], [
21       ax_path_bdb_ok=yes
22     ])
23    else
24      # Set --with-bdb-dir option.
25      ax_path_bdb_INC="$with_bdb_dir/include"
26      ax_path_bdb_LIB="$with_bdb_dir/lib"
27
28      dnl # Save previous environment, and modify with new stuff.
29      ax_path_bdb_save_CPPFLAGS="$CPPFLAGS"
30      CPPFLAGS="-I$ax_path_bdb_INC $CPPFLAGS"
31
32      ax_path_bdb_save_LDFLAGS=$LDFLAGS
33      LDFLAGS="-L$ax_path_bdb_LIB $LDFLAGS"
34
35      # Check for specific header file db.h
36      AC_MSG_CHECKING([db.h presence in $ax_path_bdb_INC])
37      if test -f "$ax_path_bdb_INC/db.h" ; then
38        AC_MSG_RESULT([yes])
39        # Check for library
40        AX_PATH_BDB_NO_OPTIONS([$1], [ENVONLY], [
41          ax_path_bdb_ok=yes
42          BDB_CPPFLAGS="-I$ax_path_bdb_INC"
43          BDB_LDFLAGS="-L$ax_path_bdb_LIB"
44        ])
45      else
46        AC_MSG_RESULT([no])
47        AC_MSG_NOTICE([no usable Berkeley DB not found])
48      fi
49
50      dnl # Restore the environment.
51      CPPFLAGS="$ax_path_bdb_save_CPPFLAGS"
52      LDFLAGS="$ax_path_bdb_save_LDFLAGS"
53
54   fi
55
56   dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
57   if test "$ax_path_bdb_ok" = "yes" ; then
58     m4_ifvaln([$2],[$2],[:])dnl
59     m4_ifvaln([$3],[else $3])dnl
60   fi
61
62 ]) dnl AX_PATH_BDB
63
64 dnl #########################################################################
65 dnl Check for berkeley DB of at least MINIMUM-VERSION on system.
66 dnl
67 dnl The OPTION argument determines how the checks occur, and can be one of:
68 dnl
69 dnl   HIGHEST -  Check both the environment and the default installation
70 dnl              directories for Berkeley DB and choose the version that
71 dnl              is highest. (default)
72 dnl   ENVFIRST - Check the environment first, and if no satisfactory
73 dnl              library is found there check the default installation
74 dnl              directories for Berkeley DB which is /usr/local/BerkeleyDB*
75 dnl   ENVONLY -  Check the current environment only.
76 dnl
77 dnl Requires AX_PATH_BDB_PATH_GET_VERSION, AX_PATH_BDB_PATH_FIND_HIGHEST,
78 dnl          AX_PATH_BDB_ENV_CONFIRM_LIB, AX_PATH_BDB_ENV_GET_VERSION, and
79 dnl          AX_COMPARE_VERSION macros.
80 dnl
81 dnl Result: sets ax_path_bdb_no_options_ok to yes or no
82 dnl         sets BDB_LIBS, BDB_CPPFLAGS, BDB_LDFLAGS, BDB_VERSION
83 dnl
84 dnl AX_PATH_BDB_NO_OPTIONS([MINIMUM-VERSION], [OPTION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
85 AC_DEFUN([AX_PATH_BDB_NO_OPTIONS], [
86   dnl # Used to indicate success or failure of this function.
87   ax_path_bdb_no_options_ok=no
88
89   # Values to add to environment to use Berkeley DB.
90   BDB_VERSION=''
91   BDB_LIBS=''
92   BDB_CPPFLAGS=''
93   BDB_LDFLAGS=''
94
95   # Check cross compilation here.
96   if test "x$cross_compiling" = "xyes" ; then
97     # If cross compiling, can't use AC_RUN_IFELSE so do these tests.
98     # The AC_PREPROC_IFELSE confirms that db.h is preprocessable,
99     # and extracts the version number from it.
100     AC_MSG_CHECKING([for db.h])
101
102     AS_VAR_PUSHDEF([HEADER_VERSION],[ax_path_bdb_no_options_HEADER_VERSION])dnl
103     HEADER_VERSION=''
104     AC_PREPROC_IFELSE([
105       AC_LANG_SOURCE([[
106 #include <db.h>
107 AX_PATH_BDB_STUFF DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH
108       ]])
109     ],[
110       # Extract version from preprocessor output.
111       HEADER_VERSION=`eval "$ac_cpp conftest.$ac_ext" 2> /dev/null \
112         | grep AX_PATH_BDB_STUFF | sed 's/[[^0-9,]]//g;s/,/./g;1q'`
113     ],[])
114
115     if test "x$HEADER_VERSION" = "x" ; then
116       AC_MSG_RESULT([no])
117     else
118       AC_MSG_RESULT([$HEADER_VERSION])
119
120       # Check that version is high enough.
121       AX_COMPARE_VERSION([$HEADER_VERSION],[ge],[$1],[
122         # get major and minor version numbers
123         AS_VAR_PUSHDEF([MAJ],[ax_path_bdb_no_options_MAJOR])dnl
124         MAJ=`echo $HEADER_VERSION | sed 's,\..*,,'`
125         AS_VAR_PUSHDEF([MIN],[ax_path_bdb_no_options_MINOR])dnl
126         MIN=`echo $HEADER_VERSION | sed 's,^[[0-9]]*\.,,;s,\.[[0-9]]*$,,'`
127
128         dnl # Save LIBS.
129         ax_path_bdb_no_options_save_LIBS="$LIBS"
130
131         # Check that we can link with the library.
132         AC_SEARCH_LIBS([db_version],
133           [db db-$MAJ.$MIN db$MAJ.$MIN db$MAJ$MIN db-$MAJ db$MAJ],[
134             # Sucessfully found library.
135             ax_path_bdb_no_options_ok=yes
136             BDB_VERSION=$HEADER_VERSION
137
138             # Extract library from LIBS
139             ax_path_bdb_no_options_LEN=` \
140               echo "x$ax_path_bdb_no_options_save_LIBS" \
141               | awk '{print(length)}'`
142             BDB_LIBS=`echo "x$LIBS " \
143               | sed "s/.\{$ax_path_bdb_no_options_LEN\}\$//;s/^x//;s/ //g"`
144         ],[])
145
146         dnl # Restore LIBS
147         LIBS="$ax_path_bdb_no_options_save_LIBS"
148
149         AS_VAR_POPDEF([MAJ])dnl
150         AS_VAR_POPDEF([MIN])dnl
151       ])
152     fi
153
154     AS_VAR_POPDEF([HEADER_VERSION])dnl
155   else
156     # Not cross compiling.
157     # Check version of Berkeley DB in the current environment.
158     AX_PATH_BDB_ENV_GET_VERSION([
159       AX_COMPARE_VERSION([$ax_path_bdb_env_get_version_VERSION],[ge],[$1],[
160         # Found acceptable version in current environment.
161         ax_path_bdb_no_options_ok=yes
162         BDB_VERSION="$ax_path_bdb_env_get_version_VERSION"
163         BDB_LIBS="$ax_path_bdb_env_get_version_LIBS"
164       ])
165     ])
166
167     # Determine if we need to search /usr/local/BerkeleyDB*
168     ax_path_bdb_no_options_DONE=no
169     if test "x$2" = "xENVONLY" ; then
170       ax_path_bdb_no_options_DONE=yes
171     elif test "x$2" = "xENVFIRST" ; then
172       ax_path_bdb_no_options_DONE=$ax_path_bdb_no_options_ok
173     fi
174
175     if test "$ax_path_bdb_no_options_DONE" = "no" ; then
176       # Check for highest in /usr/local/BerkeleyDB*
177       AX_PATH_BDB_PATH_FIND_HIGHEST([
178         if test "$ax_path_bdb_no_options_ok" = "yes" ; then
179         # If we already have an acceptable version use this if higher.
180           AX_COMPARE_VERSION(
181              [$ax_path_bdb_path_find_highest_VERSION],[gt],[$BDB_VERSION])
182         else
183           # Since we didn't have an acceptable version check if this one is.
184           AX_COMPARE_VERSION(
185              [$ax_path_bdb_path_find_highest_VERSION],[ge],[$1])
186         fi
187       ])
188
189       dnl # If result from _AX_COMPARE_VERSION is true we want this version.
190       if test "$ax_compare_version" = "true" ; then
191         ax_path_bdb_no_options_ok=yes
192         BDB_LIBS="-ldb"
193         if test "x$ax_path_bdb_path_find_highest_DIR" != x ; then
194           BDB_CPPFLAGS="-I$ax_path_bdb_path_find_highest_DIR/include"
195           BDB_LDFLAGS="-L$ax_path_bdb_path_find_highest_DIR/lib"
196         fi
197         BDB_VERSION="$ax_path_bdb_path_find_highest_VERSION"
198       fi
199     fi
200   fi
201
202   dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
203   if test "$ax_path_bdb_no_options_ok" = "yes" ; then
204     AC_MSG_NOTICE([using Berkeley DB version $BDB_VERSION])
205     AC_DEFINE([HAVE_DB_H],[1],
206               [Define to 1 if you have the <db.h> header file.])
207     m4_ifvaln([$3],[$3])dnl
208   else
209     AC_MSG_NOTICE([no Berkeley DB version $1 or higher found])
210     m4_ifvaln([$4],[$4])dnl
211   fi
212 ]) dnl AX_PATH_BDB_NO_OPTIONS
213
214 dnl #########################################################################
215 dnl Check the default installation directory for Berkeley DB which is
216 dnl of the form /usr/local/BerkeleyDB* for the highest version.
217 dnl
218 dnl Result: sets ax_path_bdb_path_find_highest_ok to yes or no,
219 dnl         sets ax_path_bdb_path_find_highest_VERSION to version,
220 dnl         sets ax_path_bdb_path_find_highest_DIR to directory.
221 dnl
222 dnl AX_PATH_BDB_PATH_FIND_HIGHEST([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
223 AC_DEFUN([AX_PATH_BDB_PATH_FIND_HIGHEST], [
224   dnl # Used to indicate success or failure of this function.
225   ax_path_bdb_path_find_highest_ok=no
226
227   AS_VAR_PUSHDEF([VERSION],[ax_path_bdb_path_find_highest_VERSION])dnl
228   VERSION=''
229
230   ax_path_bdb_path_find_highest_DIR=''
231
232   # find highest verison in default install directory for Berkeley DB
233   AS_VAR_PUSHDEF([CURDIR],[ax_path_bdb_path_find_highest_CURDIR])dnl
234   AS_VAR_PUSHDEF([CUR_VERSION],[ax_path_bdb_path_get_version_VERSION])dnl
235
236   for CURDIR in `ls -d /usr/local/BerkeleyDB* 2> /dev/null`
237   do
238     AX_PATH_BDB_PATH_GET_VERSION([$CURDIR],[
239       AX_COMPARE_VERSION([$CUR_VERSION],[gt],[$VERSION],[
240         ax_path_bdb_path_find_highest_ok=yes
241         ax_path_bdb_path_find_highest_DIR="$CURDIR"
242         VERSION="$CUR_VERSION"
243       ])
244     ])
245   done
246
247   AS_VAR_POPDEF([VERSION])dnl
248   AS_VAR_POPDEF([CUR_VERSION])dnl
249   AS_VAR_POPDEF([CURDIR])dnl
250
251   dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
252   if test "$ax_path_bdb_path_find_highest_ok" = "yes" ; then
253     m4_ifvaln([$1],[$1],[:])dnl
254     m4_ifvaln([$2],[else $2])dnl
255   fi
256
257 ]) dnl AX_PATH_BDB_PATH_FIND_HIGHEST
258
259 dnl #########################################################################
260 dnl Checks for Berkeley DB in specified directory's lib and include
261 dnl subdirectories.
262 dnl
263 dnl Result: sets ax_path_bdb_path_get_version_ok to yes or no,
264 dnl         sets ax_path_bdb_path_get_version_VERSION to version.
265 dnl
266 dnl AX_PATH_BDB_PATH_GET_VERSION(BDB-DIR, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
267 AC_DEFUN([AX_PATH_BDB_PATH_GET_VERSION], [
268   dnl # Used to indicate success or failure of this function.
269   ax_path_bdb_path_get_version_ok=no
270
271   # Indicate status of checking for Berkeley DB header.
272   AC_MSG_CHECKING([in $1/include for db.h])
273   ax_path_bdb_path_get_version_got_header=no
274   test -f "$1/include/db.h" && ax_path_bdb_path_get_version_got_header=yes
275   AC_MSG_RESULT([$ax_path_bdb_path_get_version_got_header])
276
277   # Indicate status of checking for Berkeley DB library.
278   AC_MSG_CHECKING([in $1/lib for library -ldb])
279
280   ax_path_bdb_path_get_version_VERSION=''
281
282   if test -d "$1/include" && test -d "$1/lib" &&
283      test "$ax_path_bdb_path_get_version_got_header" = "yes" ; then
284     dnl # save and modify environment
285     ax_path_bdb_path_get_version_save_CPPFLAGS="$CPPFLAGS"
286     CPPFLAGS="-I$1/include $CPPFLAGS"
287
288     ax_path_bdb_path_get_version_save_LIBS="$LIBS"
289     LIBS="$LIBS -ldb"
290
291     ax_path_bdb_path_get_version_save_LDFLAGS="$LDFLAGS"
292     LDFLAGS="-L$1/lib $LDFLAGS"
293
294     # Compile and run a program that compares the version defined in
295     # the header file with a version defined in the library function
296     # db_version.
297     AC_RUN_IFELSE([
298       AC_LANG_SOURCE([[
299 #include <stdio.h>
300 #include <db.h>
301 int main(int argc,char **argv)
302 {
303   int major,minor,patch;
304   (void) argv;
305   db_version(&major,&minor,&patch);
306   if (argc > 1)
307     printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH);
308   if (DB_VERSION_MAJOR == major && DB_VERSION_MINOR == minor &&
309       DB_VERSION_PATCH == patch)
310     return 0;
311   else
312     return 1;
313 }
314       ]])
315     ],[
316       # Program compiled and ran, so get version by adding argument.
317       ax_path_bdb_path_get_version_VERSION=`./conftest$ac_exeext x`
318       ax_path_bdb_path_get_version_ok=yes
319     ],[],[])
320
321     dnl # restore environment
322     CPPFLAGS="$ax_path_bdb_path_get_version_save_CPPFLAGS"
323     LIBS="$ax_path_bdb_path_get_version_save_LIBS"
324     LDFLAGS="$ax_path_bdb_path_get_version_save_LDFLAGS"
325   fi
326
327   dnl # Finally, execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
328   if test "$ax_path_bdb_path_get_version_ok" = "yes" ; then
329     AC_MSG_RESULT([$ax_path_bdb_path_get_version_VERSION])
330     m4_ifvaln([$2],[$2])dnl
331   else
332     AC_MSG_RESULT([no])
333     m4_ifvaln([$3],[$3])dnl
334   fi
335 ]) dnl AX_PATH_BDB_PATH_GET_VERSION
336
337 #############################################################################
338 dnl Checks if version of library and header match specified version.
339 dnl Only meant to be used by AX_PATH_BDB_ENV_GET_VERSION macro.
340 dnl
341 dnl Requires AX_COMPARE_VERSION macro.
342 dnl
343 dnl Result: sets ax_path_bdb_env_confirm_lib_ok to yes or no.
344 dnl
345 dnl AX_PATH_BDB_ENV_CONFIRM_LIB(VERSION, [LIBNAME])
346 AC_DEFUN([AX_PATH_BDB_ENV_CONFIRM_LIB], [
347   dnl # Used to indicate success or failure of this function.
348   ax_path_bdb_env_confirm_lib_ok=no
349
350   dnl # save and modify environment to link with library LIBNAME
351   ax_path_bdb_env_confirm_lib_save_LIBS="$LIBS"
352   LIBS="$LIBS $2"
353
354   # Compile and run a program that compares the version defined in
355   # the header file with a version defined in the library function
356   # db_version.
357   AC_RUN_IFELSE([
358     AC_LANG_SOURCE([[
359 #include <stdio.h>
360 #include <db.h>
361 int main(int argc,char **argv)
362 {
363   int major,minor,patch;
364   (void) argv;
365   db_version(&major,&minor,&patch);
366   if (argc > 1)
367     printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH);
368   if (DB_VERSION_MAJOR == major && DB_VERSION_MINOR == minor &&
369       DB_VERSION_PATCH == patch)
370     return 0;
371   else
372     return 1;
373 }
374     ]])
375   ],[
376     # Program compiled and ran, so get version by giving an argument,
377     # which will tell the program to print the output.
378     ax_path_bdb_env_confirm_lib_VERSION=`./conftest$ac_exeext x`
379
380     # If the versions all match up, indicate success.
381     AX_COMPARE_VERSION([$ax_path_bdb_env_confirm_lib_VERSION],[eq],[$1],[
382       ax_path_bdb_env_confirm_lib_ok=yes
383     ])
384   ],[],[])
385
386   dnl # restore environment
387   LIBS="$ax_path_bdb_env_confirm_lib_save_LIBS"
388
389 ]) dnl AX_PATH_BDB_ENV_CONFIRM_LIB
390
391 #############################################################################
392 dnl Finds the version and library name for Berkeley DB in the
393 dnl current environment.  Tries many different names for library.
394 dnl
395 dnl Requires AX_PATH_BDB_ENV_CONFIRM_LIB macro.
396 dnl
397 dnl Result: set ax_path_bdb_env_get_version_ok to yes or no,
398 dnl         set ax_path_bdb_env_get_version_VERSION to the version found,
399 dnl         and ax_path_bdb_env_get_version_LIBNAME to the library name.
400 dnl
401 dnl AX_PATH_BDB_ENV_GET_VERSION([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
402 AC_DEFUN([AX_PATH_BDB_ENV_GET_VERSION], [
403   dnl # Used to indicate success or failure of this function.
404   ax_path_bdb_env_get_version_ok=no
405
406   ax_path_bdb_env_get_version_VERSION=''
407   ax_path_bdb_env_get_version_LIBS=''
408
409   AS_VAR_PUSHDEF([HEADER_VERSION],[ax_path_bdb_env_get_version_HEADER_VERSION])dnl
410   AS_VAR_PUSHDEF([TEST_LIBNAME],[ax_path_bdb_env_get_version_TEST_LIBNAME])dnl
411
412   # Indicate status of checking for Berkeley DB library.
413   AC_MSG_CHECKING([for db.h])
414
415   # Compile and run a program that determines the Berkeley DB version
416   # in the header file db.h.
417   HEADER_VERSION=''
418   AC_RUN_IFELSE([
419     AC_LANG_SOURCE([[
420 #include <stdio.h>
421 #include <db.h>
422 int main(int argc,char **argv)
423 {
424   (void) argv;
425   if (argc > 1)
426     printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH);
427   return 0;
428 }
429     ]])
430   ],[
431     # Program compiled and ran, so get version by adding an argument.
432     HEADER_VERSION=`./conftest$ac_exeext x`
433     AC_MSG_RESULT([$HEADER_VERSION])
434   ],[AC_MSG_RESULT([no])],[AC_MSG_RESULT([no])])
435
436   # Have header version, so try to find corresponding library.
437   # Looks for library names in the order:
438   #   nothing, db, db-X.Y, dbX.Y, dbXY, db-X, dbX
439   # and stops when it finds the first one that matches the version
440   # of the header file.
441   if test "x$HEADER_VERSION" != "x" ; then
442     AC_MSG_CHECKING([for library containing Berkeley DB $HEADER_VERSION])
443
444     AS_VAR_PUSHDEF([MAJOR],[ax_path_bdb_env_get_version_MAJOR])dnl
445     AS_VAR_PUSHDEF([MINOR],[ax_path_bdb_env_get_version_MINOR])dnl
446
447     # get major and minor version numbers
448     MAJOR=`echo $HEADER_VERSION | sed 's,\..*,,'`
449     MINOR=`echo $HEADER_VERSION | sed 's,^[[0-9]]*\.,,;s,\.[[0-9]]*$,,'`
450
451     # see if it is already specified in LIBS
452     TEST_LIBNAME=''
453     AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
454
455     if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
456       # try format "db"
457       TEST_LIBNAME='-ldb'
458       AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
459     fi
460
461     if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
462       # try format "db-X.Y"
463       TEST_LIBNAME="-ldb-${MAJOR}.$MINOR"
464       AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
465     fi
466
467     if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
468       # try format "dbX.Y"
469       TEST_LIBNAME="-ldb${MAJOR}.$MINOR"
470       AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
471     fi
472
473     if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
474       # try format "dbXY"
475       TEST_LIBNAME="-ldb$MAJOR$MINOR"
476       AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
477     fi
478
479     if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
480       # try format "db-X"
481       TEST_LIBNAME="-ldb-$MAJOR"
482       AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
483     fi
484
485     if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
486       # try format "dbX"
487       TEST_LIBNAME="-ldb$MAJOR"
488       AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
489     fi
490
491     dnl # Found a valid library.
492     if test "$ax_path_bdb_env_confirm_lib_ok" = "yes" ; then
493       if test "x$TEST_LIBNAME" = "x" ; then
494         AC_MSG_RESULT([none required])
495       else
496         AC_MSG_RESULT([$TEST_LIBNAME])
497       fi
498       ax_path_bdb_env_get_version_VERSION="$HEADER_VERSION"
499       ax_path_bdb_env_get_version_LIBS="$TEST_LIBNAME"
500       ax_path_bdb_env_get_version_ok=yes
501     else
502       AC_MSG_RESULT([no])
503     fi
504
505     AS_VAR_POPDEF([MAJOR])dnl
506     AS_VAR_POPDEF([MINOR])dnl
507   fi
508
509   AS_VAR_POPDEF([HEADER_VERSION])dnl
510   AS_VAR_POPDEF([TEST_LIBNAME])dnl
511
512   dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
513   if test "$ax_path_bdb_env_confirm_lib_ok" = "yes" ; then
514     m4_ifvaln([$1],[$1],[:])dnl
515     m4_ifvaln([$2],[else $2])dnl
516   fi
517
518 ]) dnl BDB_ENV_GET_VERSION
519