Use syscmd, ifelse, and sysval. Mainly as an exercise
[gnulib.git] / m4 / regex.m4
1 #serial 1
2
3 dnl Derived from code in GNU grep.
4
5 AC_DEFUN(jm_WITH_REGEX,
6   [
7     dnl Even packages that don't use regex.c can use this macro.
8     dnl Of course, for them it doesn't do anything.
9
10     syscmd([test -f lib/regex.c])
11     ifelse(sysval, 0,
12       [
13         AC_ARG_WITH(included-regex,
14             [  --without-included-regex don't compile regex (use with caution)],
15                     jm_with_regex=$withval,
16                     jm_with_regex=yes)
17         if test "$jm_with_regex" = yes; then
18           LIBOBJS="$LIBOBJS regex.o"
19         fi
20       ],
21     )
22   ]
23 )