1 # Configure template for GNU Diffutils.
3 # Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2023
4 # Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 AC_INIT([GNU diffutils],
22 m4_esyscmd([build-aux/git-version-gen .tarball-version]),
23 [bug-diffutils@gnu.org])
25 AC_CONFIG_SRCDIR([src/diff.c])
26 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CONFIG_MACRO_DIR([m4])
29 AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects
30 color-tests parallel-tests])
31 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
33 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
38 AM_MISSING_PROG([HELP2MAN], [help2man])
41 gl_USE_SYSTEM_EXTENSIONS
44 # Ensure VLAs are not used.
45 # Note -Wvla is implicitly added by gl_MANYWARN_ALL_GCC
46 AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs])
48 AC_ARG_ENABLE([gcc-warnings],
49 [AS_HELP_STRING([--enable-gcc-warnings],
50 [turn on lots of GCC warnings (for developers)])],
53 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
55 gl_gcc_warnings=$enableval],
56 [if test -d "$srcdir"/.git; then
63 if test "$gl_gcc_warnings" = yes; then
64 gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
65 AC_SUBST([WERROR_CFLAGS])
68 # This, $nw, is the list of warnings we disable.
69 nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
70 nw="$nw -Wstack-protector" # not worth working around
72 gl_MANYWARN_ALL_GCC([ws])
73 gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
77 gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
78 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
79 gl_WARN_ADD([-Wno-format-nonliteral])
81 gl_WARN_ADD([-fdiagnostics-show-option])
82 gl_WARN_ADD([-funit-at-a-time])
83 gl_WARN_ADD([-fno-common])
85 AC_SUBST([WARN_CFLAGS])
87 AC_DEFINE([GCC_LINT], [1],
88 [Define to 1 if the compiler is checking for lint.])
89 AC_DEFINE([_FORTIFY_SOURCE], [2],
90 [enable compile-time and run-time bounds-checking, and some warnings])
91 AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
93 # We use a slightly smaller set of warning options for lib/.
94 # Remove the following and save the result in GNULIB_WARN_CFLAGS.
96 nw="$nw -Wunused-macros"
97 nw="$nw -Wsuggest-attribute=pure"
98 nw="$nw -Wduplicated-branches" # Too many false alarms
100 gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
101 AC_SUBST([GNULIB_WARN_CFLAGS])
106 AC_DEFINE([DEFAULT_EDITOR_PROGRAM], ["ed"],
107 [Name of editor program, unless overridden.])
109 AC_PATH_PROG([PR_PROGRAM], [pr], [""])
110 AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR_PROGRAM"], [Name of "pr" program.])
112 AC_CHECK_MEMBERS([struct stat.st_blksize])
113 AC_CHECK_MEMBERS([struct stat.st_rdev])
118 AC_CHECK_FUNCS_ONCE([sigaction sigprocmask strcasecoll stricoll])
119 if test $ac_cv_func_sigprocmask = no; then
120 AC_CHECK_FUNCS([sigblock])
122 AC_FUNC_CLOSEDIR_VOID
125 # When .tarball-version exists, we're building from a tarball
126 # and must not make man/*.1 files depend on the generated src/version.c,
127 # because that would induce a requirement to run the help2man perl script.
128 # We are not yet prepared to make perl a build-from-tarball requirement.
129 # Hence, here we detect .tarball-version existence. When not present,
130 # we define a variable to be used in man/Makefile.am to induce the
131 # proper dependency (so that man/*.1 will be rebuilt upon any version change),
132 # but not when built from a tarball.
133 AC_SUBST([SRC_VERSION_C])
134 test -f $srcdir/.tarball-version \
136 || SRC_VERSION_C=../src/version.c
138 AM_GNU_GETTEXT([external], [need-ngettext])
139 AM_GNU_GETTEXT_VERSION([0.19.2])
140 XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
143 Makefile doc/Makefile
147 gnulib-tests/Makefile