VirtualBox

source: kBuild/vendor/grep/3.7/configure.ac

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

File size: 7.5 KB
Line 
1dnl
2dnl autoconf input file for GNU grep
3dnl
4dnl Copyright (C) 1997-2006, 2009-2021 Free Software Foundation, Inc.
5dnl
6dnl This file is part of GNU grep.
7dnl
8dnl This program is free software; you can redistribute it and/or modify
9dnl it under the terms of the GNU General Public License as published by
10dnl the Free Software Foundation; either version 3, or (at your option)
11dnl any later version.
12dnl
13dnl This program is distributed in the hope that it will be useful,
14dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16dnl GNU General Public License for more details.
17dnl
18dnl You should have received a copy of the GNU General Public License
19dnl along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21AC_INIT([GNU grep],
22 m4_esyscmd([build-aux/git-version-gen .tarball-version]),
23 [bug-grep@gnu.org])
24
25if test -n "$GREP" || test -n "$EGREP"; then
26 AC_MSG_ERROR(
27 [no working 'grep' found
28 A working 'grep' command is needed to build GNU Grep.
29 This 'grep' should support -e and long lines.
30 On Solaris 10, install the package SUNWggrp or SUNWxcu4.
31 On Solaris 11, install the package text/gnu-grep or system/xopen/xcu4.])
32fi
33
34AC_CONFIG_AUX_DIR([build-aux])
35AC_CONFIG_SRCDIR([src/grep.c])
36AC_DEFINE([GREP], 1, [We are building grep])
37AC_PREREQ([2.64])
38AC_CONFIG_MACRO_DIRS([m4])
39
40dnl Automake stuff.
41AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests
42 subdir-objects])
43AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
44
45AC_CONFIG_HEADERS([config.h:config.hin])
46
47dnl Checks for programs.
48AC_CANONICAL_HOST
49AC_PROG_AWK
50AC_PROG_INSTALL
51AC_PROG_CC
52gl_EARLY
53AC_PROG_RANLIB
54PKG_PROG_PKG_CONFIG([0.9.0])
55
56# grep never invokes mbrtowc or mbrlen on empty input,
57# so don't worry about this common bug,
58# as working around it would merely slow grep down.
59gl_cv_func_mbrtowc_empty_input='assume yes'
60
61dnl Checks for typedefs, structures, and compiler characteristics.
62AC_TYPE_SIZE_T
63AC_C_CONST
64gl_INIT
65
66# Ensure VLAs are not used.
67# Note -Wvla is implicitly added by gl_MANYWARN_ALL_GCC
68AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs])
69
70# The test suite needs to know if we have a working perl.
71# FIXME: this is suboptimal. Ideally, we would be able to call gl_PERL
72# with an ACTION-IF-NOT-FOUND argument ...
73cu_have_perl=yes
74case $PERL in *"/missing "*) cu_have_perl=no;; esac
75AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes])
76
77AC_ARG_ENABLE([gcc-warnings],
78 [AS_HELP_STRING([--enable-gcc-warnings],
79 [turn on lots of GCC warnings (for developers)])],
80 [case $enableval in
81 yes|no) ;;
82 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
83 esac
84 gl_gcc_warnings=$enableval],
85 [gl_gcc_warnings=no
86 if test "$GCC" = yes && test -d "$srcdir"/.git; then
87 AC_COMPILE_IFELSE(
88 [AC_LANG_PROGRAM([[
89 #if ! (6 < __GNUC__ + (2 <= __GNUC_MINOR__))
90 #error "--enable-gcc-warnings defaults to 'no' on older GCC"
91 #endif
92 ]])],
93 [gl_gcc_warnings=yes])
94 fi]
95)
96
97if test "$gl_gcc_warnings" = yes; then
98 gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
99 AC_SUBST([WERROR_CFLAGS])
100
101 nw=
102 # This, $nw, is the list of warnings we disable.
103 nw="$nw -Wdeclaration-after-statement" # too useful to forbid
104 nw="$nw -Waggregate-return" # anachronistic
105 nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
106 nw="$nw -Wc++-compat" # We don't care about C++ compilers
107 nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
108 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
109 nw="$nw -Wpadded" # Our structs are not padded
110 nw="$nw -Wstack-protector" # generates false alarms for useful code
111 nw="$nw -Wswitch-default" # Too many warnings for now
112 nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
113 nw="$nw -Winline" # streq.h's streq4, streq6 and strcaseeq6
114 nw="$nw -Wstrict-overflow" # regexec.c
115
116 gl_MANYWARN_ALL_GCC([ws])
117 gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
118 for w in $ws; do
119 gl_WARN_ADD([$w])
120 done
121 gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
122 gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
123 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
124 gl_WARN_ADD([-Wno-cast-function-type]) # sig-handler.h's sa_handler_t cast
125
126 # In spite of excluding -Wlogical-op above, it is enabled, as of
127 # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
128 gl_WARN_ADD([-Wno-logical-op])
129
130 AC_SUBST([WARN_CFLAGS])
131
132 AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
133 AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
134 AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE],
135 [/* Enable compile-time and run-time bounds-checking, and some warnings,
136 without upsetting glibc 2.15+. */
137 #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \
138 && defined __OPTIMIZE__ && __OPTIMIZE__)
139 # define _FORTIFY_SOURCE 2
140 #endif
141 ])
142
143 # We use a slightly smaller set of warning options for lib/.
144 # Remove the following and save the result in GNULIB_WARN_CFLAGS.
145 nw=
146 nw="$nw -Wunused-macros"
147 gl_WARN_ADD([-Wno-format-nonliteral])
148 gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
149 AC_SUBST([GNULIB_WARN_CFLAGS])
150
151 # For gnulib-tests, the set is slightly smaller still.
152 nw=
153 nw="$nw -Wstrict-prototypes"
154 # It's not worth being this picky about test programs.
155 nw="$nw -Wsuggest-attribute=const"
156 nw="$nw -Wsuggest-attribute=pure"
157 nw="$nw -Wsuggest-attribute=format"
158 nw="$nw -Wformat-truncation=2" # False alarm in strerror_r.c
159 nw="$nw -Wold-style-definition"
160
161 # Disable to avoid warnings in e.g., test-intprops.c and test-limits-h.c
162 # due to overlong expansions like this:
163 # test-intprops.c:147:5: error: string literal of length 9531 exceeds \
164 # maximum length 4095 that ISO C99 compilers are required to support
165 nw="$nw -Woverlength-strings"
166
167 gl_MANYWARN_COMPLEMENT([GNULIB_TEST_WARN_CFLAGS],
168 [$GNULIB_WARN_CFLAGS], [$nw])
169 gl_WARN_ADD([-Wno-return-type], [GNULIB_TEST_WARN_CFLAGS])
170 AC_SUBST([GNULIB_TEST_WARN_CFLAGS])
171fi
172
173# By default, argmatch should fail calling usage (EXIT_FAILURE).
174AC_DEFINE([ARGMATCH_DIE], [usage (EXIT_FAILURE)],
175 [Define to the function xargmatch calls on failures.])
176AC_DEFINE([ARGMATCH_DIE_DECL], [void usage (int _e)],
177 [Define to the declaration of the xargmatch failure function.])
178
179dnl Checks for header files.
180AC_HEADER_DIRENT
181
182dnl Checks for functions.
183AC_FUNC_CLOSEDIR_VOID
184
185AC_CHECK_FUNCS_ONCE([isascii setlocale])
186
187dnl I18N feature
188AM_GNU_GETTEXT_VERSION([0.18.2])
189AM_GNU_GETTEXT([external])
190
191dnl Some installers want to be informed if we do not use our regex.
192dnl For example, if the host platform uses dynamic linking and the installer
193dnl knows that the grep may be invoked on other hosts with buggy libraries,
194dnl then the installer should configure --with-included-regex.
195AM_CONDITIONAL([USE_INCLUDED_REGEX], [test "$ac_use_included_regex" = yes])
196if test "$ac_use_included_regex" = no; then
197 AC_MSG_WARN([Included lib/regex.c not used])
198fi
199
200gl_FUNC_PCRE
201AM_CONDITIONAL([USE_PCRE], [test $use_pcre = yes])
202
203case $host_os in
204 mingw*) suffix=w32 ;;
205 *) suffix=posix ;;
206esac
207COLORIZE_SOURCE=colorize-$suffix.c
208AC_SUBST([COLORIZE_SOURCE])
209
210AC_CONFIG_FILES([
211 Makefile
212 lib/Makefile
213 src/Makefile
214 tests/Makefile
215 po/Makefile.in
216 doc/Makefile
217 gnulib-tests/Makefile
218])
219AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette