Imported Upstream version 2.9.4
[platform/upstream/man-db.git] / configure.ac
index 1f9f099..f4fe224 100644 (file)
@@ -2,28 +2,28 @@ dnl Process this file with autoconf to produce a configure script.
 m4_pattern_forbid([^MAN_])
 
 # Initialise and check we're in the correct directory.
-AC_INIT([man-db], [2.8.2], [cjwatson@debian.org])
+AC_INIT([man-db], [2.9.4], [cjwatson@debian.org])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([1.11 -Wall -Wno-override -Werror foreign dist-xz no-dist-gzip parallel-tests])
 AM_MAINTAINER_MODE
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-AC_PREREQ([2.59])
+AM_SILENT_RULES([yes])
+AC_PREREQ([2.63])
 AC_CONFIG_SRCDIR([src/man.c])
 AC_GNU_SOURCE
-m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
-LT_INIT([disable-static])
+MAN_TAR_SORT_NAME
 
 AC_CONFIG_HEADER([config.h])
 AC_CANONICAL_HOST
 
 # Define below date and version information to be put into man pages etc.
-date=2018-02-28
+date=2021-02-08
 AC_SUBST([date])dnl
 roff_version=`echo AC_PACKAGE_VERSION | sed 's/-/\\-/g'`
 AC_SUBST([roff_version])dnl
 
 # Explicitly check for pkg-config early on, since otherwise the conditional
-# call in MAN_ARG_SYSTEMDTMPFILESDIR is problematic.
+# calls in MAN_ARG_SYSTEMDTMPFILESDIR and MAN_ARG_SYSTEMDSYSTEMUNITDIR are
+# problematic.
 PKG_PROG_PKG_CONFIG
 
 # We have to be a bit naughty here and supply options.
@@ -41,7 +41,9 @@ MAN_ARG_AUTOMATIC_UPDATE
 MAN_ARG_CATS
 MAN_ARG_OVERRIDE_DIR
 MAN_ARG_SYSTEMDTMPFILESDIR
+MAN_ARG_SYSTEMDSYSTEMUNITDIR
 MAN_ARG_MANDIRS
+MAN_ARG_MANUAL
 
 # Check $PATH for the following programs and append suitable options.
 AC_PROG_CC
@@ -59,19 +61,25 @@ case $host_os in
                CFLAGS="$CFLAGS -YPOSIX"
                ;;
 esac
-if test "$GCC" = yes
-then
-       gl_WARN_ADD([-W])
-       gl_WARN_ADD([-Wpointer-arith])
-       gl_WARN_ADD([-Wwrite-strings])
-       gl_WARN_ADD([-Wstrict-prototypes])
-       gl_WARN_ADD([-Wshadow])
-       gl_WARN_ADD([-Wformat-security])
-       gl_WARN_ADD([-Wredundant-decls])
-       gl_WARN_ADD([-Wno-missing-field-initializers])
-fi
+
+# Enable all reasonable GCC warnings.
+gl_MANYWARN_ALL_GCC([warnings])
+nw=
+nw="$nw -Wsystem-headers"
+nw="$nw -Wmissing-field-initializers"
+nw="$nw -Winline"
+gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw])
+for w in $warnings; do
+       gl_WARN_ADD([$w])
+done
+gl_WARN_ADD([-Wno-missing-field-initializers])
+# Disable use of VLAs by Gnulib to avoid tripping over -Wvla.
+AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs.])
+
 AC_PROG_INSTALL
 AC_PROG_LN_S
+AM_PROG_AR
+LT_INIT([disable-static])
 AC_CHECK_PROGS([cat], [cat])
 MAN_CHECK_PROGS([browser], [BROWSER], [use BROWSER as default web browser], [www-browser lynx elinks w3m])
 test -n "$browser" && browser="exec $browser"
@@ -190,6 +198,14 @@ then
 else
        troff="(troff not installed)"
 fi
+dnl We want to end up with "-" written as "\-" in manual pages.  This
+dnl requires additional \-escaping corresponding to the following quote
+dnl removal steps:
+dnl   1) the following sed command
+dnl   2) the following assignment
+dnl   2) sed running on the substituted version of man/replace.sin.in
+troff_as_troff_input=`echo "$troff" | sed 's/-/\\\\\\\\-/g'`
+AC_SUBST([troff_as_troff_input])
 
 if test -n "$nroff"
 then
@@ -311,10 +327,14 @@ if test -n "$lzip"
 then
        unlzip="$lzip -dc"
 fi
-if test -n "$gzip" || test -n "$compress" || test -n "$bzip2" || test -n "$xz" || test -n "$lzip" || test -n "$lzma"
+MAN_CHECK_PROGS([zstd], [ZSTD], [use ZSTD as LZ77/entropy-coding compression utility], [zstd])
+if test -n "$zstd"
+then
+       unzstd="$zstd -dc"
+fi
+if test -n "$compressor"
 then
        AC_DEFINE([COMP_CAT], [1], [Define if you have compressors and want to support compressed cat files.])
-       AC_DEFINE([COMP_SRC], [1], [Define if you have compressors and want to support compressed manual source.])
 fi
 AC_SUBST([compressor])
 AC_SUBST([compress_ext])
@@ -324,6 +344,7 @@ AC_SUBST([bunzip2])
 AC_SUBST([unlzma])
 AC_SUBST([unxz])
 AC_SUBST([unlzip])
+AC_SUBST([unzstd])
 MAN_COMPRESS_LIB([z], [gzopen])
 dnl To add more decompressors just follow the scheme above.
 
@@ -331,13 +352,17 @@ dnl To add more decompressors just follow the scheme above.
 AC_ISC_POSIX
 dnl AC_PROG_LEX calls AC_TRY_LINK: must come after above 3
 AC_PROG_LEX
+if test "$LEX" = ":" && (test ! -e src/lexgrog.c || test ! -e src/zsoelim.c)
+then
+       AC_MSG_ERROR([flex is required when building from revision control])
+fi
 gl_INIT
-AC_CHECK_HEADERS([fcntl.h sys/file.h linux/fiemap.h])
-AC_CHECK_FUNCS([lchown posix_fadvise])
+AC_CHECK_HEADERS([sys/file.h linux/fiemap.h])
+AC_CHECK_FUNCS([posix_fadvise])
 
 # Internationalization support.
 AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.18.1])
+AM_GNU_GETTEXT_VERSION([0.18.3])
 AC_SUBST([LINGUAS])
 AM_ICONV
 MAN_PO4A
@@ -445,6 +470,7 @@ MAN_TRANS_SUBST([apropos])
 MAN_TRANS_SUBST([catman])
 MAN_TRANS_SUBST([lexgrog])
 MAN_TRANS_SUBST([man])
+MAN_TRANS_SUBST([man-recode])
 MAN_TRANS_SUBST([manconv])
 MAN_TRANS_SUBST([mandb])
 MAN_TRANS_SUBST([manpath])
@@ -455,10 +481,10 @@ MAN_TRANS_SUBST([zsoelim])
 AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = xyes])
 
 # Are Gnulib translations available?
-AM_CONDITIONAL([HAVE_GNULIB_PO], [test -f "$srcdir/gnulib/po/POTFILES.in"])
+AM_CONDITIONAL([HAVE_GNULIB_PO], [test -f "$srcdir/gl/po/POTFILES.in"])
 
 AC_CONFIG_FILES([Makefile
-       gnulib/lib/Makefile
+       gl/lib/Makefile
        init/Makefile
        init/systemd/Makefile
        lib/Makefile
@@ -477,7 +503,9 @@ AC_CONFIG_FILES([Makefile
        man/ja/Makefile
        man/nl/Makefile
        man/pl/Makefile
+       man/pt/Makefile
        man/pt_BR/Makefile
+       man/ro/Makefile
        man/ru/Makefile
        man/sr/Makefile
        man/sv/Makefile
@@ -490,7 +518,7 @@ AC_CONFIG_FILES([Makefile
        include/comp_src.h
        include/manconfig.h
        po/Makefile.in])
-if test -f "$srcdir/gnulib/po/Makefile.in.in"; then
-       AC_CONFIG_FILES([gnulib/po/Makefile.in])
+if test -f "$srcdir/gl/po/Makefile.in.in"; then
+       AC_CONFIG_FILES([gl/po/Makefile.in])
 fi
 AC_OUTPUT