summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-01-01 18:51:47 +0000
committerColin Watson <cjwatson@debian.org>2022-01-01 18:51:48 +0000
commit88c3b67f57809ee0a168afa881b0e3c4220e616e (patch)
tree00f319d5be6acc0b6b5ff2f2ded3c0046b1263c8 /m4
parentccbf60a3d992a8d51352ae24af4a6f7e300cc4f4 (diff)
Fix warnings with Autoconf >= 2.70
* configure.ac (AC_PROG_LEX): Add noyywrap argument (new in Autoconf 2.70, but ignored in previous versions). * m4/man-bdb.m4 (MAN_CHECK_BDB): Autoconf 2.70 warns about non-literal arguments to AC_CHECK_HEADERS. Refactor loops so that the header and library names are visible to m4.
Diffstat (limited to 'm4')
-rw-r--r--m4/man-bdb.m492
1 files changed, 49 insertions, 43 deletions
diff --git a/m4/man-bdb.m4 b/m4/man-bdb.m4
index 71c7b73f..5c44d1cb 100644
--- a/m4/man-bdb.m4
+++ b/m4/man-bdb.m4
@@ -1,55 +1,61 @@
-# man-bdb.m4 serial 5
+# man-bdb.m4 serial 6
dnl MAN_CHECK_BDB(WITH-DB, HEADERS, LIBS, [ACTION-IF-FOUND])
dnl Helper to check Berkeley DB linkage when particular header files and
-dnl libraries are included. ACTION-IF-FOUND may contain $head and $lib.
+dnl libraries are included.
dnl Contributed by Duncan Simpson <dps@io.stargate.co.uk> and hacked into a
dnl macro by Colin Watson.
-AC_DEFUN([MAN_CHECK_BDB], [dnl
-man_bdb_requested=no
-for trydb in $1
-do
- if test "$db" = "$trydb"
+AC_DEFUN([_MAN_CHECK_BDB_HEADER_LIB], [dnl
+ if test "$db" != yes
then
- man_bdb_requested=yes
+ AS_VAR_PUSHDEF([man_tr_bdb], [man_cv_bdb_header_$1_lib_$2])dnl
+ man_saved_LIBS="$LIBS"
+ LIBS="$LIBS -l$2"
+ AC_CACHE_CHECK([for dbopen from <$1> in -l$2], man_tr_bdb,
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <$1>]],
+ [[dbopen("foo", 0, 0, 0, (void *) 0)]])],
+ [AS_VAR_SET([man_tr_bdb], [yes])],
+ [AS_VAR_SET([man_tr_bdb], [no])])
+ ])
+ AS_VAR_IF([man_tr_bdb], [yes],
+ [$3
+ AC_DEFINE_UNQUOTED([BDB_H], [<$1>],
+ [Define if you have, and want to use, Berkeley database header files.])
+ AC_DEFINE_UNQUOTED([BTREE], [1],
+ [Define if you have, and want to use, the Berkeley database library.])
+ AC_SUBST([DBTYPE], [btree])
+ DBLIBS="-l$2"
+ db=yes],
+ [db=no])
+ LIBS="$man_saved_LIBS"
+ AS_VAR_POPDEF([man_tr_bdb])dnl
fi
-done
-if test "$db" = no || test "$man_bdb_requested" = yes
-then
- for head in $2
- do
- AC_CHECK_HEADERS([$head], [got=yes], [got=no])
+])
+
+AC_DEFUN([_MAN_CHECK_BDB_HEADER], [dnl
+ if test "$db" != yes
+ then
+ AC_CHECK_HEADERS([$1], [got=yes], [got=no])
if test "$got" = "yes"
then
- for lib in $3
- do
- AS_VAR_PUSHDEF([man_tr_bdb], [man_cv_bdb_header_${head}_lib_${lib}])dnl
- man_saved_LIBS="$LIBS"
- LIBS="$LIBS -l$lib"
- AC_CACHE_CHECK([for dbopen from <${head}> in -l${lib}], man_tr_bdb,
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <$head>]],
- [[dbopen("foo", 0, 0, 0, (void *) 0)]])],
- [AS_VAR_SET([man_tr_bdb], [yes])],
- [AS_VAR_SET([man_tr_bdb], [no])])
- ])
- AS_VAR_IF([man_tr_bdb], [yes],
- [$4
- AC_DEFINE_UNQUOTED([BDB_H], [<$head>],
- [Define if you have, and want to use, Berkeley database header files.])
- AC_DEFINE_UNQUOTED([BTREE], [1],
- [Define if you have, and want to use, the Berkeley database library.])
- AC_SUBST([DBTYPE], [btree])
- DBLIBS="-l$lib"
- db=yes],
- [db=no])
- LIBS="$man_saved_LIBS"
- AS_VAR_POPDEF([man_tr_bdb])dnl
- test "$db" = "yes" && break
- done
+ m4_map_args_w([$2], [_MAN_CHECK_BDB_HEADER_LIB([$1], ], [, [$3])])
+ fi
+ fi
+])
+
+AC_DEFUN([MAN_CHECK_BDB], [dnl
+ man_bdb_requested=no
+ for trydb in $1
+ do
+ if test "$db" = "$trydb"
+ then
+ man_bdb_requested=yes
fi
- test "$db" = "yes" && break
done
-fi[]dnl
+ if test "$db" = no || test "$man_bdb_requested" = yes
+ then
+ m4_map_args_w([$2], [_MAN_CHECK_BDB_HEADER(], [, [$3], [$4])])
+ fi[]dnl
])# MAN_CHECK_BDB