By default, don't use the included regex.c on systems
[gnulib.git] / m4 / regex.m4
1 #serial 3
2
3 dnl Derived from code in GNU grep.
4
5 AC_DEFUN(jm_WITH_REGEX,
6   [
7     AC_REQUIRE([AM_GLIBC])
8
9     dnl Even packages that don't use regex.c can use this macro.
10     dnl Of course, for them it doesn't do anything.
11
12     syscmd([test -f lib/regex.c])
13     ifelse(sysval, 0,
14       [
15         # By default, don't use the included regex.c on systems with glibc 2
16         test "$ac_cv_glibc" = yes && default=no || default=yes
17
18         AC_ARG_WITH(included-regex,
19         [  --without-included-regex don't compile regex; this is the default on
20                           systems with version 2 of the GNU C library
21                           (use with caution on other system)],
22                     jm_with_regex=$withval,
23                     jm_with_regex=$default)
24         if test "$jm_with_regex" = yes; then
25           LIBOBJS="$LIBOBJS regex.o"
26         fi
27       ],
28     )
29   ]
30 )