summaryrefslogtreecommitdiff
path: root/m4/regex.m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-07-04 16:45:18 +0000
committerJim Meyering <jim@meyering.net>1998-07-04 16:45:18 +0000
commit5823a999fe2e818d168df76aff9d32b72d86c198 (patch)
tree32fd24f8d3c77e7bc819f500c892fe46fb0fc7e6 /m4/regex.m4
parent218c464b91c4fb9195c283d60685219816ecfabd (diff)
downloadcoreutils-5823a999fe2e818d168df76aff9d32b72d86c198.tar.xz
Use syscmd, ifelse, and sysval. Mainly as an exercise
to prove that this macro can be used in packages without regex.c.
Diffstat (limited to 'm4/regex.m4')
-rw-r--r--m4/regex.m422
1 files changed, 15 insertions, 7 deletions
diff --git a/m4/regex.m4 b/m4/regex.m4
index 001d203b8..073dac5b4 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,15 +1,23 @@
#serial 1
-dnl From grep.
+dnl Derived from code in GNU grep.
AC_DEFUN(jm_WITH_REGEX,
[
- AC_ARG_WITH(included-regex,
+ dnl Even packages that don't use regex.c can use this macro.
+ dnl Of course, for them it doesn't do anything.
+
+ syscmd([test -f lib/regex.c])
+ ifelse(sysval, 0,
+ [
+ AC_ARG_WITH(included-regex,
[ --without-included-regex don't compile regex (use with caution)],
- jm_with_regex=$withval,
- jm_with_regex=yes)
- if test "$jm_with_regex" = yes; then
- LIBOBJS="$LIBOBJS regex.o"
- fi
+ jm_with_regex=$withval,
+ jm_with_regex=yes)
+ if test "$jm_with_regex" = yes; then
+ LIBOBJS="$LIBOBJS regex.o"
+ fi
+ ],
+ )
]
)