Ignore grep unit test
[product/upstream/grep.git] / configure.ac
1 dnl
2 dnl autoconf input file for ``GNU grep''
3 dnl
4 dnl Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5 dnl 2005, 2006 the Free Software Foundation, Inc.
6 dnl
7 dnl This file is part of GNU grep.
8 dnl
9 dnl GNU grep is free software; you can redistribute it and/or modify
10 dnl it under the terms of the GNU General Public License as published by
11 dnl the Free Software Foundation; either version 2 of the License, or
12 dnl (at your option) any later version.
13 dnl
14 dnl GNU grep is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 dnl GNU General Public License for more details.
18 dnl
19 dnl You should have received a copy of the GNU General Public License along
20 dnl with this program; if not, write to the Free Software Foundation, Inc.,
21 dnl 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
22 dnl
23 dnl Authors:
24 dnl Alain Magloire <alainm@gnu.org>
25 dnl Bernhard Rosenkraenzer <bero@arklinux.org>
26 dnl Stepan Kasal <kasal@gnu.org>
27 dnl
28
29 AC_INIT(GNU grep, 2.5.2, bug-grep@gnu.org, grep)
30 AC_CONFIG_SRCDIR(src/grep.c)
31 AC_DEFINE(GREP, 1, [We are building grep])
32 AC_PREREQ(2.53)
33
34 dnl Automake stuff.
35 AM_INIT_AUTOMAKE(dist-bzip2)
36 AM_CONFIG_HEADER(config.h:config.hin)
37
38 dnl Check for arguments
39 AC_ARG_ENABLE(perl-regexp,
40  [  --disable-perl-regexp           disable perl-regexp],
41  [case "${enableval}" in
42   yes) testpcre=yes ;;
43   no)  testpcre=no ;;
44   *)   AC_MSG_ERROR(bad value ${enableval} for --disable-perl-regexp) ;;
45  esac],[testpcre=yes])
46
47 dnl Checks for programs.
48 AC_CANONICAL_HOST
49 AC_PROG_AWK
50 AC_PROG_CC
51 AC_PROG_INSTALL
52 AC_PROG_RANLIB
53
54 dnl Checks for typedefs, structures, and compiler characteristics.
55 AC_SYS_LARGEFILE
56 AM_C_PROTOTYPES
57 AC_TYPE_SIZE_T
58 AC_CHECK_TYPE(ssize_t, int)
59 AC_C_CONST
60 jm_AC_TYPE_UINTMAX_T
61
62 dnl Checks for header files.
63 AC_HEADER_STDC
64 AC_CHECK_HEADERS(string.h stdlib.h sys/param.h memory.h unistd.h libintl.h)
65 AC_CHECK_HEADERS(wctype.h wchar.h)
66 AC_HEADER_DIRENT
67 AC_HEADER_STAT
68
69 dnl Checks for functions.
70 AC_FUNC_ALLOCA
71 AC_FUNC_CLOSEDIR_VOID
72 AC_FUNC_MMAP
73
74 dnl getpagesize is checked for by AC_FUNC_MMAP.
75 AC_CHECK_FUNCS(btowc isascii iswctype mbrlen memmove setmode strerror wcrtomb wcscoll wctype)
76 # We can use mbrtowc only if we have mbstate_t.
77 AC_FUNC_MBRTOWC
78 # Yet we need a mbstate_t stub in every case.
79 AC_MBSTATE_T
80 AC_REPLACE_FUNCS(memchr stpcpy strtoul atexit fnmatch)
81 jm_AC_PREREQ_XSTRTOUMAX
82
83 dnl Replace this with jm_CHECK_DECLS once autoconf 2.15 is out.
84 jm_CHECK_DECLARATIONS([#include <stdlib.h>], [strtoul strtoull])
85 test $jm_cv_func_decl_strtoul != yes
86 AC_DEFINE_UNQUOTED([HAVE_DECL_STRTOUL], $?,
87   [Define if <stdlib.h> declares strtoul.])
88 test $jm_cv_func_decl_strtoull != yes
89 AC_DEFINE_UNQUOTED([HAVE_DECL_STRTOULL], $?,
90   [Define if <stdlib.h> declares strtoull.])
91
92 dnl for VC++
93 case "$ac_cv_prog_CC" in
94  cl*)  AC_DEFINE([alloca], _alloca, [Define if your compiler is broken]) ;;
95  *)    ;;
96 esac
97
98 dnl I18N feature
99 ALL_LINGUAS="af be bg ca cs da de el eo es et eu fi fr ga gl he hr hu id it ja ko nb nl no pl pt_BR pt ro ru rw sl sr sv tr uk vi zh_TW"
100 AM_GNU_GETTEXT
101
102 dnl DOS file name convention
103 dnl sets HAVE_DOS_FILE_NAMES
104 AC_DOSFILE
105
106 dnl check for the environ separator
107 dnl sets SEP
108 AM_SEP
109
110 dnl OS specifics
111 dnl sets {EXE,OBJ}EXT
112 AC_EXEEXT
113 dnl Invoke the (capitalized) ac_objext macro without spelling its name.
114 dnl This works around a bug in automake 1.4 with ansi2knr.
115 dnl Automake looks for (capitalized) ac_objext by grepping for it,
116 dnl so it won't find it in this file.
117 ifelse(,, [AC][_OBJEXT])
118
119 dnl some folks ask for this, that's fine by me
120 dnl hope they know what they're doing ...
121 dnl if glibc2 regex is not included
122
123 dnl Many GNU/Linux people have different
124 dnl glibc versions with buggy regex.
125 jm_INCLUDED_REGEX(lib/regex.c)
126
127 dnl Many people on non-GNU/Linux systems don't have getopt
128 AC_CHECK_FUNC(getopt_long,
129   [
130     AC_ARG_WITH(included-getopt,
131       [  --with-included-getopt  Use the included getopt rather than glibc's],
132       with_getopt=$withval,
133       with_getopt=$no)
134     if test "x$with_getopt" = xyes; then
135       AC_LIBOBJ(getopt)
136       AC_LIBOBJ(getopt1)
137     fi
138   ],
139   [
140     AC_LIBOBJ(getopt)
141     AC_LIBOBJ(getopt1)
142   ])
143
144 dnl Some installers want to be informed if we do not use our regex.
145 dnl For example, if the host platform uses dynamic linking and the installer
146 dnl knows that the grep may be invoked on other hosts with buggy libraries,
147 dnl then the installer should configure --with-included-regex.
148 if test "$jm_with_regex" = no; then
149         AC_MSG_WARN(Included lib/regex.c not used)
150 fi
151
152 dnl These are the prerequisite macros for GNU's error.c file.
153 AC_FUNC_STRERROR_R
154 jm_PREREQ_ERROR
155
156 dnl Determine whether malloc accepts 0 as its argument.
157 dnl If it doesn't, arrange to use the replacement function.
158 jm_FUNC_MALLOC
159 jm_FUNC_REALLOC
160
161 # support for pcre
162 if test x"$testpcre" = x"yes"; then
163         if pcre-config --cflags >/dev/null 2>&1; then
164                 CFLAGS="$CFLAGS `pcre-config --cflags`"
165                 LIBS="$LIBS `pcre-config --libs`"
166         fi
167         AC_CHECK_LIB(pcre, pcre_exec)
168 fi
169
170 AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])