summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:37:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:37:10 +0000
commitc9addba5cc770d2d231b34f6739f32c6be8690f1 (patch)
treec643da154a95a1d163137135050bb47858a1654e /m4
parentInitial commit. (diff)
downloadman-db-c9addba5cc770d2d231b34f6739f32c6be8690f1.tar.xz
man-db-c9addba5cc770d2d231b34f6739f32c6be8690f1.zip
Adding upstream version 2.12.0.upstream/2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4')
-rw-r--r--m4/man-arg-automatic-create.m413
-rw-r--r--m4/man-arg-automatic-update.m414
-rw-r--r--m4/man-arg-cache-owner.m444
-rw-r--r--m4/man-arg-cats.m414
-rw-r--r--m4/man-arg-config-file.m421
-rw-r--r--m4/man-arg-db.m416
-rw-r--r--m4/man-arg-device.m415
-rw-r--r--m4/man-arg-mandirs.m432
-rw-r--r--m4/man-arg-manual.m413
-rw-r--r--m4/man-arg-override-dir.m420
-rw-r--r--m4/man-arg-sections.m417
-rw-r--r--m4/man-arg-setuid.m432
-rw-r--r--m4/man-arg-snapdir.m417
-rw-r--r--m4/man-arg-systemdsystemunitdir.m424
-rw-r--r--m4/man-arg-systemdtmpfilesdir.m424
-rw-r--r--m4/man-arg-undoc.m417
-rw-r--r--m4/man-bdb.m461
-rw-r--r--m4/man-check-progs.m419
-rw-r--r--m4/man-compress-lib.m413
-rw-r--r--m4/man-gnu-nroff.m424
-rw-r--r--m4/man-heirloom-nroff.m433
-rw-r--r--m4/man-libseccomp.m418
-rw-r--r--m4/man-linguas.m472
-rw-r--r--m4/man-po4a.m49
-rw-r--r--m4/man-tar-sort-name.m421
-rw-r--r--m4/man-trans-subst.m412
26 files changed, 615 insertions, 0 deletions
diff --git a/m4/man-arg-automatic-create.m4 b/m4/man-arg-automatic-create.m4
new file mode 100644
index 0000000..599da2c
--- /dev/null
+++ b/m4/man-arg-automatic-create.m4
@@ -0,0 +1,13 @@
+# man-arg-automatic-create.m4 serial 1
+dnl MAN_ARG_AUTOMATIC_CREATE
+dnl Add an --enable-automatic-create option.
+
+AC_DEFUN([MAN_ARG_AUTOMATIC_CREATE],
+[
+AC_ARG_ENABLE([automatic-create],
+[AS_HELP_STRING([--enable-automatic-create], [allow man to create user databases on the fly])],
+ [if test "$enableval" = "yes"
+ then
+ AC_DEFINE([MAN_DB_CREATES], [1], [Allow man to create user databases on the fly.])
+ fi])
+])
diff --git a/m4/man-arg-automatic-update.m4 b/m4/man-arg-automatic-update.m4
new file mode 100644
index 0000000..2519bd7
--- /dev/null
+++ b/m4/man-arg-automatic-update.m4
@@ -0,0 +1,14 @@
+# man-arg-automatic-update.m4 serial 1
+dnl MAN_ARG_AUTOMATIC_UPDATE
+dnl Add a --disable-automatic-update option.
+
+AC_DEFUN([MAN_ARG_AUTOMATIC_UPDATE],
+[
+AC_ARG_ENABLE([automatic-update],
+[AS_HELP_STRING([--disable-automatic-update], [don't allow man to update databases on the fly])],
+ [if test "$enableval" = "yes"
+ then
+ AC_DEFINE([MAN_DB_UPDATES], [1], [Allow man to update databases on the fly.])
+ fi],
+ [AC_DEFINE([MAN_DB_UPDATES], [1], [Allow man to update databases on the fly.])])
+])
diff --git a/m4/man-arg-cache-owner.m4 b/m4/man-arg-cache-owner.m4
new file mode 100644
index 0000000..2997016
--- /dev/null
+++ b/m4/man-arg-cache-owner.m4
@@ -0,0 +1,44 @@
+# man-arg-cache-owner.m4 serial 3
+dnl MAN_ARG_CACHE_OWNER
+dnl Add an --enable-cache-owner option.
+
+AC_DEFUN([MAN_ARG_CACHE_OWNER],
+[
+AC_REQUIRE([gl_IDPRIV])
+AC_ARG_ENABLE([cache-owner],
+[AS_HELP_STRING([--enable-cache-owner[=ARG]], [make system-wide cache files be owned by user ARG [arg=man]])
+AS_HELP_STRING([--disable-cache-owner], [don't constrain ownership of system-wide cache files])],
+ [if test "$enableval" = "yes"
+ then
+ enableval=man
+ fi
+ if test "$enableval" = "no"
+ then
+ man_owner=
+ else
+ man_owner=$enableval
+ fi],
+ [if test "$ac_cv_func_getuid" = yes
+ then
+ man_owner=man
+ else
+ man_owner=
+ fi])
+if test "$man_owner" && test "$ac_cv_func_getuid" != yes
+then
+ AC_MSG_WARN([--enable-cache-owner is not implemented on this platform])
+ man_owner=
+fi
+if test "$man_owner"
+then
+ cache_top_owner="$man_owner"
+ AC_MSG_NOTICE([System-wide cache files will be owned by $man_owner])
+ AC_DEFINE_UNQUOTED([MAN_OWNER], ["$man_owner"],
+ [Define as the owner of system-wide cache files.])
+else
+ cache_top_owner=root
+ AC_MSG_NOTICE([System-wide cache files will have unconstrained ownership])
+fi
+AC_SUBST([man_owner])
+AC_SUBST([cache_top_owner])
+])
diff --git a/m4/man-arg-cats.m4 b/m4/man-arg-cats.m4
new file mode 100644
index 0000000..e17bd7a
--- /dev/null
+++ b/m4/man-arg-cats.m4
@@ -0,0 +1,14 @@
+# man-arg-cats.m4 serial 1
+dnl MAN_ARG_CATS
+dnl Add a --disable-cats option.
+
+AC_DEFUN([MAN_ARG_CATS],
+[
+AC_ARG_ENABLE([cats],
+[AS_HELP_STRING([--disable-cats], [don't allow man to create/update cat files])],
+ [if test "$enableval" = "yes"
+ then
+ AC_DEFINE([MAN_CATS], [1], [Allow man to create/update cat files.])
+ fi],
+ [AC_DEFINE([MAN_CATS], [1], [Allow man to create/update cat files.])])
+])
diff --git a/m4/man-arg-config-file.m4 b/m4/man-arg-config-file.m4
new file mode 100644
index 0000000..41494af
--- /dev/null
+++ b/m4/man-arg-config-file.m4
@@ -0,0 +1,21 @@
+# man-arg-config-file.m4 serial 1
+dnl MAN_ARG_CONFIG_FILE
+dnl Add a --with-config-file option.
+
+AC_DEFUN([MAN_ARG_CONFIG_FILE],
+[
+AC_ARG_WITH([config-file],
+[AS_HELP_STRING([--with-config-file=CF], [use config file CF [CF=SYSCONFDIR/man_db.conf]])],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR([--with-config-file requires an argument])
+ else
+ config_file=$withval
+ fi],
+ [: ${config_file=\$\{sysconfdir\}/man_db.conf}])
+config_file_basename=${config_file##*/}
+config_file_dirname=`AS_DIRNAME(["$config_file"])`
+AC_SUBST([config_file])
+AC_SUBST([config_file_basename])
+AC_SUBST([config_file_dirname])
+])
diff --git a/m4/man-arg-db.m4 b/m4/man-arg-db.m4
new file mode 100644
index 0000000..bb1a8db
--- /dev/null
+++ b/m4/man-arg-db.m4
@@ -0,0 +1,16 @@
+# man-arg-db.m4 serial 1
+dnl MAN_ARG_DB
+dnl Add a --with-db option.
+
+AC_DEFUN([MAN_ARG_DB],
+[
+AC_ARG_WITH([db],
+[AS_HELP_STRING([--with-db=LIBRARY], [use database library LIBRARY (db5, db4, db3, db2, db1, db, gdbm, ndbm)])],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR([--with-db requires an argument])
+ else
+ db=$withval
+ fi],
+ [: ${db=no}])
+])
diff --git a/m4/man-arg-device.m4 b/m4/man-arg-device.m4
new file mode 100644
index 0000000..d3996c2
--- /dev/null
+++ b/m4/man-arg-device.m4
@@ -0,0 +1,15 @@
+# man-arg-device.m4 serial 1
+dnl MAN_ARG_DEVICE
+dnl Add a --with-device option.
+
+AC_DEFUN([MAN_ARG_DEVICE],
+[
+AC_ARG_WITH([device],
+[AS_HELP_STRING([--with-device=DEVICE], [use nroff with the output device DEVICE])],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR([--with-device requires an argument])
+ else
+ nroff_device=" -T$withval"
+ fi])
+])
diff --git a/m4/man-arg-mandirs.m4 b/m4/man-arg-mandirs.m4
new file mode 100644
index 0000000..927dcc2
--- /dev/null
+++ b/m4/man-arg-mandirs.m4
@@ -0,0 +1,32 @@
+# man-arg-mandirs.m4 serial 1
+dnl MAN_ARG_MANDIRS
+dnl Add an --enable-mandirs option.
+
+AC_DEFUN([MAN_ARG_MANDIRS],
+[
+# Work out which manual page hierarchy scheme might be in use.
+AC_ARG_ENABLE([mandirs],
+[AS_HELP_STRING([--enable-mandirs=OS], [select manual page hierarchy organization (GNU, HPUX, IRIX, Solaris, BSD)])],
+ [AC_MSG_NOTICE([Using $enableval hierarchy organization(s)])
+ AC_DEFINE_UNQUOTED([MANDIR_LAYOUT], ["$enableval"],
+ [Define to the manual page hierarchy organization(s) in use.])
+ MANDIR_LAYOUT="$enableval"],
+ [case $host in
+ *-gnu) mandirs=GNU;;
+ *-hpux*) mandirs=HPUX;;
+ *-irix*) mandirs=IRIX;;
+ *-solaris*) mandirs=Solaris;;
+ *-*bsd*) mandirs=BSD;;
+ *) mandirs=;;
+ esac
+ if test -n "$mandirs"; then
+ AC_MSG_NOTICE([Using $mandirs hierarchy organization])
+ AC_DEFINE_UNQUOTED([MANDIR_LAYOUT], ["$mandirs"])
+ MANDIR_LAYOUT="$mandirs"
+ else
+ AC_MSG_NOTICE([Allowing any hierarchy organization])
+ AC_DEFINE([MANDIR_LAYOUT], [""])
+ MANDIR_LAYOUT=
+ fi])
+AC_SUBST([MANDIR_LAYOUT])
+])
diff --git a/m4/man-arg-manual.m4 b/m4/man-arg-manual.m4
new file mode 100644
index 0000000..a9c1d37
--- /dev/null
+++ b/m4/man-arg-manual.m4
@@ -0,0 +1,13 @@
+# man-arg-manual.m4 serial 1
+dnl MAN_ARG_MANUAL
+dnl Add a --disable-manual option.
+dnl This may be useful when cross-compiling, or to reduce the installation
+dnl size.
+
+AC_DEFUN([MAN_ARG_MANUAL],
+[
+AC_ARG_ENABLE([manual],
+[AS_HELP_STRING([--disable-manual], [don't build or install the man-db manual])],
+ [enable_manual="$enableval"], [enable_manual=yes])
+AM_CONDITIONAL([BUILD_MANUAL], [test "$enable_manual" = yes])
+])
diff --git a/m4/man-arg-override-dir.m4 b/m4/man-arg-override-dir.m4
new file mode 100644
index 0000000..a8ffc61
--- /dev/null
+++ b/m4/man-arg-override-dir.m4
@@ -0,0 +1,20 @@
+# man-arg-override-dir.m4 serial 3
+dnl MAN_ARG_OVERRIDE_DIR
+dnl Add an --enable-override-dir option.
+
+AC_DEFUN([MAN_ARG_OVERRIDE_DIR],
+[
+AC_ARG_WITH([override-dir],
+[AS_HELP_STRING([--with-override-dir=OVERRIDE], [use OVERRIDE as relative override dir inside the man path - the first directory to be searched when looking for man pages])],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR([--with-override-dir requires an argument])
+ else
+ override_dir=$withval
+ fi],
+ [: ${override_dir=""}])
+AC_SUBST([override_dir])
+AC_DEFINE_UNQUOTED(
+ [OVERRIDE_DIR], ["$override_dir"],
+ [Relative override directory inside man path.])
+])
diff --git a/m4/man-arg-sections.m4 b/m4/man-arg-sections.m4
new file mode 100644
index 0000000..20441b3
--- /dev/null
+++ b/m4/man-arg-sections.m4
@@ -0,0 +1,17 @@
+# man-arg-sections.m4 serial 3
+dnl MAN_ARG_SECTIONS
+dnl Add a --with-sections option.
+
+AC_DEFUN([MAN_ARG_SECTIONS],
+[
+AC_ARG_WITH([sections],
+[AS_HELP_STRING([--with-sections=SECTIONS], [use manual page sections SECTIONS @<:@1 n l 8 3 0 2 3type 5 4 9 6 7@:>@])],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR([--with-sections requires an argument])
+ else
+ sections="$withval"
+ fi],
+ [: ${sections=1 n l 8 3 0 2 3type 5 4 9 6 7}])
+AC_SUBST([sections])dnl
+])
diff --git a/m4/man-arg-setuid.m4 b/m4/man-arg-setuid.m4
new file mode 100644
index 0000000..1ef63d6
--- /dev/null
+++ b/m4/man-arg-setuid.m4
@@ -0,0 +1,32 @@
+# man-arg-setuid.m4 serial 3
+dnl MAN_ARG_SETUID
+dnl Add an --enable-setuid option.
+
+AC_DEFUN([MAN_ARG_SETUID],
+[
+AC_ARG_ENABLE([setuid],
+[AS_HELP_STRING([--enable-setuid], [install man setuid])
+AS_HELP_STRING([--disable-setuid], [don't install man setuid])],
+ [if test "$enableval" = "yes"
+ then
+ if test -z "$man_owner"
+ then
+ AC_MSG_ERROR([--enable-setuid is incompatible with --disable-cache-owner])
+ fi
+ man_mode="6755"
+ AC_MSG_NOTICE([Man will be installed setuid $man_owner])
+ elif test "$enableval" = "no"
+ then
+ man_mode="755"
+ AC_MSG_NOTICE([Man will not be installed setuid])
+ else
+ AC_MSG_ERROR([--enable-setuid=$enableval is no longer valid; consider --enable-cache-owner=$enableval --enable-setuid instead])
+ fi],
+ [if test -z "$man_owner"
+ then
+ man_mode="755"
+ else
+ man_mode="6755"
+ fi])
+AC_SUBST([man_mode])
+])
diff --git a/m4/man-arg-snapdir.m4 b/m4/man-arg-snapdir.m4
new file mode 100644
index 0000000..3cf666a
--- /dev/null
+++ b/m4/man-arg-snapdir.m4
@@ -0,0 +1,17 @@
+# man-arg-snapdir.m4 serial 1
+dnl MAN_ARG_SNAPDIR
+dnl Add a --with-snapdir option.
+
+AC_DEFUN([MAN_ARG_SNAPDIR],
+[
+AC_ARG_WITH([snapdir],
+[AS_HELP_STRING([--with-snapdir=DIR], [use snap system directory DIR [DIR=/snap]])],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR([--with-snapdir requires an argument])
+ else
+ snapdir="$withval"
+ fi],
+ [: ${snapdir=/snap}])
+AC_SUBST([snapdir])
+])
diff --git a/m4/man-arg-systemdsystemunitdir.m4 b/m4/man-arg-systemdsystemunitdir.m4
new file mode 100644
index 0000000..3321414
--- /dev/null
+++ b/m4/man-arg-systemdsystemunitdir.m4
@@ -0,0 +1,24 @@
+# man-arg-systemdsystemunitdir.m4 serial 3
+dnl MAN_ARG_SYSTEMDSYSTEMUNITDIR
+dnl Add a --with-systemdsystemunitdir option.
+
+AC_DEFUN([MAN_ARG_SYSTEMDSYSTEMUNITDIR],
+[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_ARG_WITH([systemdsystemunitdir],
+[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files (disable with "no")])],
+ [], [dnl
+ # The default is not prefix-sensitive, since systemd's prefix is not
+ # necessarily the same as man-db's.
+ case $host_os in
+ linux*)
+ m4_pushdef([AC_ARG_VAR])dnl No need for precious variable handling.
+ PKG_CHECK_VAR([with_systemdsystemunitdir], [systemd], [systemdsystemunitdir],
+ [], [with_systemdsystemunitdir=/lib/systemd/system])
+ m4_popdef([AC_ARG_VAR])
+ ;;
+ *) with_systemdsystemunitdir=no ;;
+ esac])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL([INSTALL_SYSTEMD_TIMER], [test "$with_systemdsystemunitdir" != "no"])
+])
diff --git a/m4/man-arg-systemdtmpfilesdir.m4 b/m4/man-arg-systemdtmpfilesdir.m4
new file mode 100644
index 0000000..ae7195f
--- /dev/null
+++ b/m4/man-arg-systemdtmpfilesdir.m4
@@ -0,0 +1,24 @@
+# man-arg-systemdtmpfilesdir.m4 serial 4
+dnl MAN_ARG_SYSTEMDTMPFILESDIR
+dnl Add a --with-systemdtmpfilesdir option.
+
+AC_DEFUN([MAN_ARG_SYSTEMDTMPFILESDIR],
+[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_ARG_WITH([systemdtmpfilesdir],
+[AS_HELP_STRING([--with-systemdtmpfilesdir=DIR], [Directory for systemd tmpfiles configuration (disable with "no")])],
+ [], [dnl
+ # The default is not prefix-sensitive, since systemd's prefix is not
+ # necessarily the same as man-db's.
+ case $host_os in
+ linux*)
+ m4_pushdef([AC_ARG_VAR])dnl No need for precious variable handling.
+ PKG_CHECK_VAR([with_systemdtmpfilesdir], [systemd], [tmpfilesdir],
+ [], [with_systemdtmpfilesdir=/usr/lib/tmpfiles.d])
+ m4_popdef([AC_ARG_VAR])
+ ;;
+ *) with_systemdtmpfilesdir=no ;;
+ esac])
+AC_SUBST([systemdtmpfilesdir], [$with_systemdtmpfilesdir])
+AM_CONDITIONAL([INSTALL_SYSTEMD_TMPFILES], [test "$with_systemdtmpfilesdir" != "no"])
+])
diff --git a/m4/man-arg-undoc.m4 b/m4/man-arg-undoc.m4
new file mode 100644
index 0000000..6c5e8a7
--- /dev/null
+++ b/m4/man-arg-undoc.m4
@@ -0,0 +1,17 @@
+# man-arg-undoc.m4 serial 1
+dnl MAN_ARG_UNDOC
+dnl Add an --enable-undoc option.
+
+AC_DEFUN([MAN_ARG_UNDOC],
+[
+AC_ARG_ENABLE([undoc],
+[AS_HELP_STRING([--enable-undoc=COMMAND], [suggest COMMAND for missing manual pages])],
+ [if test "$enableval" = "yes" || test "$enableval" = "no"
+ then
+ AC_MSG_ERROR([--enable-undoc requires an argument])
+ else
+ AC_MSG_NOTICE([Suggesting '$enableval' for missing manual pages])
+ AC_DEFINE_UNQUOTED([UNDOC_COMMAND], ["$enableval"],
+ [Define as the name of a command you want to suggest when a non-existent page is requested.])
+ fi])
+])
diff --git a/m4/man-bdb.m4 b/m4/man-bdb.m4
new file mode 100644
index 0000000..5c44d1c
--- /dev/null
+++ b/m4/man-bdb.m4
@@ -0,0 +1,61 @@
+# 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.
+dnl Contributed by Duncan Simpson <dps@io.stargate.co.uk> and hacked into a
+dnl macro by Colin Watson.
+
+AC_DEFUN([_MAN_CHECK_BDB_HEADER_LIB], [dnl
+ if test "$db" != yes
+ then
+ 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
+])
+
+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
+ 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
+ done
+ 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
diff --git a/m4/man-check-progs.m4 b/m4/man-check-progs.m4
new file mode 100644
index 0000000..633943c
--- /dev/null
+++ b/m4/man-check-progs.m4
@@ -0,0 +1,19 @@
+# man-check-progs.m4 serial 3
+dnl MAN_CHECK_PROGS(VARIABLE, WITH-ARG, HELP-STRING, PROGS-TO-CHECK-FOR)
+dnl Look for a program to use as VARIABLE. If --with-VARIABLE is given, then
+dnl set VARIABLE to the path provided there (WITH-ARG and HELP-STRING are
+dnl used for --help output). Otherwise, set VARIABLE to the first of
+dnl PROGS-TO-CHECK-FOR on the path; if none of those is found, leave
+dnl VARIABLE unchanged.
+dnl If the program was found, define HAVE_WITH-ARG.
+AC_DEFUN([MAN_CHECK_PROGS],
+[AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1=$2], [$3])],
+ [AS_IF([test "$withval" = yes || test "$withval" = no],
+ [AC_MSG_ERROR([--with-$1 requires an argument])],
+ [AC_MSG_CHECKING([for $1])
+ AC_MSG_RESULT([$withval])
+ $1="$withval"])],
+ [AC_CHECK_PROGS([$1], [$4])])
+if test -n "$$1"; then
+ AC_DEFINE([HAVE_$2], [1], [Define if you have $1.])
+fi]) # MAN_CHECK_PROGS
diff --git a/m4/man-compress-lib.m4 b/m4/man-compress-lib.m4
new file mode 100644
index 0000000..eedaadc
--- /dev/null
+++ b/m4/man-compress-lib.m4
@@ -0,0 +1,13 @@
+# man-compress-lib.m4 serial 1
+dnl MAN_COMPRESS_LIB(LIBRARY, FUNCTION)
+dnl Look for FUNCTION in LIBRARY. If it is available, define HAVE_LIBLIBRARY
+dnl and add -lLIBRARY to LIBCOMPRESS.
+AC_DEFUN([MAN_COMPRESS_LIB],
+[AC_CHECK_LIB(
+ [$1], [$2],
+ [AC_DEFINE_UNQUOTED(
+ AS_TR_CPP([HAVE_LIB$1]), [1],
+ [Define to 1 if you have the `$1' library (-l$1).])
+ LIBCOMPRESS="-l$1 $LIBCOMPRESS"])
+ AC_SUBST([LIBCOMPRESS])
+]) # MAN_COMPRESS_LIB
diff --git a/m4/man-gnu-nroff.m4 b/m4/man-gnu-nroff.m4
new file mode 100644
index 0000000..6fc0bb2
--- /dev/null
+++ b/m4/man-gnu-nroff.m4
@@ -0,0 +1,24 @@
+# man-gnu-nroff.m4 serial 3
+dnl
+dnl Check to see if nroff is GNU nroff, take nroff path as arg.
+dnl
+AC_DEFUN([MAN_PROG_GNU_NROFF],
+[AC_MSG_CHECKING([whether nroff is GNU nroff])
+
+AC_CACHE_VAL([man_cv_prog_gnu_nroff],
+ [if test `$1 <<EOF | tr -d '\n'
+\\n(.g
+EOF
+` = 1
+ then
+ man_cv_prog_gnu_nroff=yes
+ else
+ man_cv_prog_gnu_nroff=no
+ fi])
+
+if test "$man_cv_prog_gnu_nroff" = "yes"
+then
+ AC_DEFINE([GNU_NROFF], [1], [Define if nroff is GNU nroff.])
+fi
+AC_MSG_RESULT([$man_cv_prog_gnu_nroff])
+])
diff --git a/m4/man-heirloom-nroff.m4 b/m4/man-heirloom-nroff.m4
new file mode 100644
index 0000000..85144e7
--- /dev/null
+++ b/m4/man-heirloom-nroff.m4
@@ -0,0 +1,33 @@
+# man-heirloom-nroff.m4 serial 1
+dnl MAN_PROG_HEIRLOOM_NROFF(PROGRAM-NAME)
+dnl Check whether the given nroff program is from the Heirloom Documentation
+dnl Tools. We do this by testing the .X number register; it should be
+dnl non-zero, and should change to a different value if the -mg option is
+dnl used to enable groff compatibility.
+AC_DEFUN([MAN_PROG_HEIRLOOM_NROFF],
+[AC_MSG_CHECKING([whether nroff is Heirloom nroff])
+
+AC_CACHE_VAL([man_cv_prog_heirloom_nroff],
+ [man_heirloom_ext_plain=`$1 2>/dev/null <<EOF | tr -d '\n'
+\\n(.X
+EOF
+`
+ man_heirloom_ext_mg=`$1 -mg 2>/dev/null <<EOF | tr -d '\n'
+\\n(.X
+EOF
+`
+ if test "x$man_heirloom_ext_plain" != 0 && \
+ test "x$man_heirloom_ext_mg" != 0 && \
+ test "x$man_heirloom_ext_plain" != "x$man_heirloom_extflag_mg"
+ then
+ man_cv_prog_heirloom_nroff=yes
+ else
+ man_cv_prog_heirloom_nroff=no
+ fi])
+
+if test "$man_cv_prog_heirloom_nroff" = "yes"
+then
+ AC_DEFINE([HEIRLOOM_NROFF], [1], [Define if nroff is Heirloom nroff.])
+fi
+AC_MSG_RESULT([$man_cv_prog_heirloom_nroff])
+])
diff --git a/m4/man-libseccomp.m4 b/m4/man-libseccomp.m4
new file mode 100644
index 0000000..c90e3aa
--- /dev/null
+++ b/m4/man-libseccomp.m4
@@ -0,0 +1,18 @@
+# man-libseccomp.m4 serial 2
+dnl MAN_LIBSECCOMP
+dnl Add a --without-libseccomp option; check for the libseccomp library.
+AC_DEFUN([MAN_LIBSECCOMP],
+ [AC_ARG_WITH([libseccomp],
+ [AS_HELP_STRING([--without-libseccomp],
+ [do not confine subprocesses using seccomp])],
+ [],
+ [with_libseccomp=check])
+ if test "x$with_libseccomp" != "xno"; then
+ PKG_CHECK_MODULES([libseccomp], [libseccomp],
+ [AC_DEFINE([HAVE_LIBSECCOMP], [1],
+ [Define to 1 if you have the `libseccomp' library.])],
+ [if test "x$with_libseccomp" = "xyes"; then
+ AC_MSG_ERROR([--with-libseccomp given but cannot find libseccomp])
+ fi])
+ fi
+]) # MAN_LIBSECCOMP
diff --git a/m4/man-linguas.m4 b/m4/man-linguas.m4
new file mode 100644
index 0000000..973afff
--- /dev/null
+++ b/m4/man-linguas.m4
@@ -0,0 +1,72 @@
+# man-linguas.m4 serial 2
+dnl MAN_LINGUAS
+dnl Compute the set of localised manual pages to install, taking the LINGUAS
+dnl environment variable into account if set.
+
+dnl Draws somewhat on po.m4:
+
+dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([MAN_LINGUAS],
+[
+ AC_REQUIRE([AM_NLS])dnl
+ if test "$USE_NLS" = yes; then
+ # The LINGUAS file contains the set of available languages.
+ man_all_linguas=
+ if test -n "$srcdir/man/LINGUAS"; then
+ man_all_linguas=`sed -e "/^#/d" -e "s/#.*//" "$srcdir/man/LINGUAS"`
+ fi
+ if test -n "$PO4A" && test -n "$srcdir/man/LINGUAS.po4a"; then
+ man_all_linguas_po4a=`sed -e "/^#/d" -e "s/#.*//" "$srcdir/man/LINGUAS.po4a"`
+ man_all_linguas="$man_all_linguas $man_all_linguas_po4a"
+ fi
+ man_inst_linguas=
+ for presentlang in $man_all_linguas; do
+ useit=no
+ if test -n "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$man_all_linguas"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ man_inst_linguas="$man_inst_linguas $presentlang"
+ fi
+ done
+ if test -n "$PO4A"; then
+ MAN_SUBDIRS="po4a $man_inst_linguas"
+ else
+ MAN_SUBDIRS="$man_inst_linguas"
+ fi
+ else
+ MAN_SUBDIRS=
+ fi
+ AC_SUBST([MAN_SUBDIRS])
+]) # MAN_LINGUAS
diff --git a/m4/man-po4a.m4 b/m4/man-po4a.m4
new file mode 100644
index 0000000..68217a9
--- /dev/null
+++ b/m4/man-po4a.m4
@@ -0,0 +1,9 @@
+# man-po4a.m4 serial 2
+dnl MAN_PO4A
+dnl Detect the presence of po4a.
+
+AC_DEFUN([MAN_PO4A],
+[AC_CHECK_PROGS([PO4A], [po4a])
+ AC_SUBST([PO4A])
+ AM_CONDITIONAL([PO4A], [test -n "$PO4A"])
+]) # MAN_PO4A
diff --git a/m4/man-tar-sort-name.m4 b/m4/man-tar-sort-name.m4
new file mode 100644
index 0000000..00a3cab
--- /dev/null
+++ b/m4/man-tar-sort-name.m4
@@ -0,0 +1,21 @@
+# man-tar-sort-name.m4 serial 1
+dnl MAN_TAR_SORT_NAME
+dnl Use the --sort=name option of GNU tar if it is available.
+dnl Note that this only works with Automake's default tar-v7 option.
+
+AC_DEFUN([MAN_TAR_SORT_NAME],
+[
+AC_BEFORE([AM_INIT_AUTOMAKE], [$0])
+AC_MSG_CHECKING([if tar --sort=name works])
+rm -rf conftest.dir
+mkdir conftest.dir
+echo GrepMe > conftest.dir/file
+AM_RUN_LOG([${TAR-tar} chof - conftest.dir --sort=name >conftest.tar])
+if test -s conftest.tar; then
+ AC_MSG_RESULT([yes])
+ am__tar="$am__tar --sort=name"
+else
+ AC_MSG_RESULT([no])
+fi
+rm -rf conftest.dir
+])
diff --git a/m4/man-trans-subst.m4 b/m4/man-trans-subst.m4
new file mode 100644
index 0000000..6a073ac
--- /dev/null
+++ b/m4/man-trans-subst.m4
@@ -0,0 +1,12 @@
+# man-trans-subst.m4 serial 3
+dnl MAN_TRANS_SUBST(PROGRAM-NAME)
+dnl Define and substitute a shell variable TRANS_PROG to the transformed
+dnl version of PROGRAM-NAME, where PROG is PROGRAM-NAME converted to upper
+dnl case.
+dnl Also define and substitute an upper-case variant TRANS_PROG_UPPER.
+AC_DEFUN([MAN_TRANS_SUBST],
+[man_transformed=`echo "$1" | sed "$program_transform_name"`
+ man_transformed_upper=`echo "$man_transformed" | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ AC_SUBST(AS_TR_CPP([TRANS_$1]), [$man_transformed])
+ AC_SUBST(AS_TR_CPP([TRANS_$1_UPPER]), [$man_transformed_upper])
+]) # MAN_TRANS_SUBST