|
Packit |
33f14e |
# Configure template for GNU Diffutils.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2017
|
|
Packit |
33f14e |
# Free Software Foundation, Inc.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# This program is free software: you can redistribute it and/or modify
|
|
Packit |
33f14e |
# it under the terms of the GNU General Public License as published by
|
|
Packit |
33f14e |
# the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
33f14e |
# (at your option) any later version.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# This program is distributed in the hope that it will be useful,
|
|
Packit |
33f14e |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
33f14e |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
33f14e |
# GNU General Public License for more details.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# You should have received a copy of the GNU General Public License
|
|
Packit |
33f14e |
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_PREREQ(2.61)
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_INIT([GNU diffutils],
|
|
Packit |
33f14e |
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
|
Packit |
33f14e |
[bug-diffutils@gnu.org])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_CONFIG_SRCDIR([src/diff.c])
|
|
Packit |
33f14e |
AC_CONFIG_AUX_DIR([build-aux])
|
|
Packit |
33f14e |
AC_CONFIG_MACRO_DIR([m4])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects
|
|
Packit |
33f14e |
color-tests parallel-tests])
|
|
Packit |
33f14e |
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_CONFIG_HEADER([lib/config.h:lib/config.hin])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_PROG_AWK
|
|
Packit |
33f14e |
AC_PROG_CC
|
|
Packit |
33f14e |
AM_PROG_CC_C_O
|
|
Packit |
33f14e |
AM_MISSING_PROG([HELP2MAN], [help2man])
|
|
Packit |
33f14e |
AC_PROG_RANLIB
|
|
Packit |
33f14e |
gl_EARLY
|
|
Packit |
33f14e |
gl_USE_SYSTEM_EXTENSIONS
|
|
Packit |
33f14e |
gl_INIT
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_ARG_ENABLE([gcc-warnings],
|
|
Packit |
33f14e |
[AS_HELP_STRING([--enable-gcc-warnings],
|
|
Packit |
33f14e |
[turn on lots of GCC warnings (for developers)])],
|
|
Packit |
33f14e |
[case $enableval in
|
|
Packit |
33f14e |
yes|no) ;;
|
|
Packit |
33f14e |
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
|
|
Packit |
33f14e |
esac
|
|
Packit |
33f14e |
gl_gcc_warnings=$enableval],
|
|
Packit |
33f14e |
[if test -d "$srcdir"/.git; then
|
|
Packit |
33f14e |
gl_gcc_warnings=yes
|
|
Packit |
33f14e |
else
|
|
Packit |
33f14e |
gl_gcc_warnings=no
|
|
Packit |
33f14e |
fi]
|
|
Packit |
33f14e |
)
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
if test "$gl_gcc_warnings" = yes; then
|
|
Packit |
33f14e |
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
|
Packit |
33f14e |
AC_SUBST([WERROR_CFLAGS])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
nw=
|
|
Packit |
33f14e |
# This, $nw, is the list of warnings we disable.
|
|
Packit |
33f14e |
nw="$nw -Wdeclaration-after-statement" # too useful to forbid
|
|
Packit |
33f14e |
nw="$nw -Waggregate-return" # anachronistic
|
|
Packit |
33f14e |
nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
|
|
Packit |
33f14e |
nw="$nw -Wc++-compat" # We don't care about C++ compilers
|
|
Packit |
33f14e |
nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
|
|
Packit |
33f14e |
nw="$nw -Wtraditional" # Warns on #elif which we use often
|
|
Packit |
33f14e |
nw="$nw -Wcast-qual" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wconversion" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
|
|
Packit |
33f14e |
nw="$nw -Wsign-conversion" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wtraditional-conversion" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wunreachable-code" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wpadded" # Our structs are not padded
|
|
Packit |
33f14e |
nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
|
|
Packit |
33f14e |
nw="$nw -Wlogical-op" # any use of fwrite provokes this
|
|
Packit |
33f14e |
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
|
|
Packit |
33f14e |
nw="$nw -Wvla" # warnings in gettext.h
|
|
Packit |
33f14e |
nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
|
|
Packit |
33f14e |
nw="$nw -Wswitch-enum" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wswitch-default" # Too many warnings for now
|
|
Packit |
33f14e |
nw="$nw -Wstack-protector" # not worth working around
|
|
Packit |
33f14e |
# things I might fix soon:
|
|
Packit |
33f14e |
nw="$nw -Wfloat-equal" # sort.c, seq.c
|
|
Packit |
33f14e |
nw="$nw -Wmissing-format-attribute" # copy.c
|
|
Packit |
33f14e |
nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
|
|
Packit |
33f14e |
nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
|
|
Packit |
33f14e |
nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c
|
|
Packit |
33f14e |
nw="$nw -Wformat-extra-args" # sdiff.c
|
|
Packit |
33f14e |
# ?? -Wstrict-overflow
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
gl_MANYWARN_ALL_GCC([ws])
|
|
Packit |
33f14e |
gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
|
|
Packit |
33f14e |
for w in $ws; do
|
|
Packit |
33f14e |
gl_WARN_ADD([$w])
|
|
Packit |
33f14e |
done
|
|
Packit |
33f14e |
gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
|
|
Packit |
33f14e |
gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
|
|
Packit |
33f14e |
gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
|
|
Packit |
33f14e |
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
|
|
Packit |
33f14e |
gl_WARN_ADD([-Wno-format-nonliteral])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# In spite of excluding -Wlogical-op above, it is enabled, as of
|
|
Packit |
33f14e |
# gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
|
|
Packit |
33f14e |
gl_WARN_ADD([-Wno-logical-op])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
gl_WARN_ADD([-fdiagnostics-show-option])
|
|
Packit |
33f14e |
gl_WARN_ADD([-funit-at-a-time])
|
|
Packit |
33f14e |
gl_WARN_ADD([-fno-common])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_SUBST([WARN_CFLAGS])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
|
|
Packit |
33f14e |
AC_DEFINE([_FORTIFY_SOURCE], [2],
|
|
Packit |
33f14e |
[enable compile-time and run-time bounds-checking, and some warnings])
|
|
Packit |
33f14e |
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# We use a slightly smaller set of warning options for lib/.
|
|
Packit |
33f14e |
# Remove the following and save the result in GNULIB_WARN_CFLAGS.
|
|
Packit |
33f14e |
nw=
|
|
Packit |
33f14e |
nw="$nw -Wunused-macros"
|
|
Packit |
33f14e |
nw="$nw -Wmissing-prototypes"
|
|
Packit |
33f14e |
nw="$nw -Wold-style-definition"
|
|
Packit |
33f14e |
nw="$nw -Wsuggest-attribute=pure"
|
|
Packit |
33f14e |
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
|
|
Packit |
33f14e |
AC_SUBST([GNULIB_WARN_CFLAGS])
|
|
Packit |
33f14e |
fi
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_C_INLINE
|
|
Packit |
33f14e |
AC_C_VARARRAYS
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_DEFINE([DEFAULT_EDITOR_PROGRAM], ["ed"],
|
|
Packit |
33f14e |
[Name of editor program, unless overridden.])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_PATH_PROG([PR_PROGRAM], [pr], [""])
|
|
Packit |
33f14e |
AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR_PROGRAM"], [Name of "pr" program.])
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_CHECK_MEMBERS([struct stat.st_blksize])
|
|
Packit |
33f14e |
AC_CHECK_MEMBERS([struct stat.st_rdev])
|
|
Packit |
33f14e |
AC_HEADER_DIRENT
|
|
Packit |
33f14e |
AC_HEADER_SYS_WAIT
|
|
Packit |
33f14e |
AC_TYPE_PID_T
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_CHECK_FUNCS_ONCE([sigaction sigprocmask strcasecoll stricoll])
|
|
Packit |
33f14e |
if test $ac_cv_func_sigprocmask = no; then
|
|
Packit |
33f14e |
AC_CHECK_FUNCS([sigblock])
|
|
Packit |
33f14e |
fi
|
|
Packit |
33f14e |
AC_FUNC_CLOSEDIR_VOID
|
|
Packit |
33f14e |
AC_FUNC_FORK
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
# When .tarball-version exists, we're building from a tarball
|
|
Packit |
33f14e |
# and must not make man/*.1 files depend on the generated src/version.c,
|
|
Packit |
33f14e |
# because that would induce a requirement to run the help2man perl script.
|
|
Packit |
33f14e |
# We are not yet prepared to make perl a build-from-tarball requirement.
|
|
Packit |
33f14e |
# Hence, here we detect .tarball-version existence. When not present,
|
|
Packit |
33f14e |
# we define a variable to be used in man/Makefile.am to induce the
|
|
Packit |
33f14e |
# proper dependency (so that man/*.1 will be rebuilt upon any version change),
|
|
Packit |
33f14e |
# but not when built from a tarball.
|
|
Packit |
33f14e |
AC_SUBST([SRC_VERSION_C])
|
|
Packit |
33f14e |
test -f $srcdir/.tarball-version \
|
|
Packit |
33f14e |
&& SRC_VERSION_C= \
|
|
Packit |
33f14e |
|| SRC_VERSION_C=../src/version.c
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AM_GNU_GETTEXT([external], [need-ngettext])
|
|
Packit |
33f14e |
AM_GNU_GETTEXT_VERSION([0.19.2])
|
|
Packit |
33f14e |
XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
AC_CONFIG_FILES([
|
|
Packit |
33f14e |
Makefile doc/Makefile
|
|
Packit |
33f14e |
lib/Makefile
|
|
Packit |
33f14e |
src/Makefile
|
|
Packit |
33f14e |
tests/Makefile
|
|
Packit |
33f14e |
gnulib-tests/Makefile
|
|
Packit |
33f14e |
man/Makefile
|
|
Packit |
33f14e |
po/Makefile.in
|
|
Packit |
33f14e |
])
|
|
Packit |
33f14e |
AC_OUTPUT
|