On Thu, Oct 06, 2016 at 03:25:00PM -0400, Rich Felker wrote: > > No, I think that is the exact purpose of configure.ac and autoconf. > > > > It would be neat if we could auto-fallback during the build. Rich > > suggested always compiling compat/regex.c, and just having it be a noop > > at the preprocessor level. I'm not sure if that would work, though, > > because we'd have to include the system "regex.h" to know if we have > > REG_STARTEND, at which point it is potentially too late to compile our > > own regex routines (we're potentially going to conflict with the system > > declarations). > > If you have autoconf testing for REG_STARTEND at configure time then > compat/regex.c can #include "config.h" and test for HAVE_REG_STARTEND > rather than for REG_STARTEND, or something like that. Right, that part is easy; we do not even have to touch compat/regex.c, because we already have such a knob in the Makefile (NO_REGEX), and autoconf just needs to tweak that knob. My question was whether we could do it without running a separate compile (via autoconf or via the Makefile), and I think the answer is "no". -Peff