diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2019-11-11 05:28:29 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2019-11-11 05:28:29 (GMT) |
commit | f01c24749606da01b21ba9f028ce377570da20f0 (patch) | |
tree | aace0077cb5e60a9dc8148593f68265e29722df0 | |
parent | 901987072286076ba8b4a2d3c3cb06e30ad93230 (diff) | |
download | powwow-f01c24749606da01b21ba9f028ce377570da20f0.zip powwow-f01c24749606da01b21ba9f028ce377570da20f0.tar.gz powwow-f01c24749606da01b21ba9f028ce377570da20f0.tar.bz2 |
verify pcreposix or regcomp are available if enabled
-rw-r--r-- | configure.ac | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 25cca81..8909021 100644 --- a/configure.ac +++ b/configure.ac @@ -111,15 +111,16 @@ AC_CHECK_HEADER([locale.h], [AC_CHECK_FUNC([putwc],[AC_DEFINE(USE_LOCALE)])]) if test "x${enable_regex}" = "xno"; then + AC_MSG_RESULT([Regex support disabled]) enable_regex_using="disabled" else - enable_regex_using="none" + enable_regex_using="not_found" if test "x${enable_regex}" = "xyes"; then AC_CHECK_HEADER("pcreposix.h",[ enable_regex_using="pcreposix" ], [ - AC_CHECK_FUNC(regcomp,[ + AC_CHECK_HEADER("regex.h",[ enable_regex_using="libc" ]) ]) @@ -128,15 +129,24 @@ else enable_regex_using="${enable_regex}" fi - if test "x${enable_regex_using}" = "xnone"; then + if test "x${enable_regex_using}" = "xnot_found"; then # no regex - AC_MSG_RESULT([Unable to find regex support]) + enable_regex=no + AC_MSG_RESULT([*** Unable to enable regex support]) else AC_DEFINE(USE_REGEXP) if test "x${enable_regex_using}" = "xpcreposix"; then AC_DEFINE(USE_REGEXP_PCREPOSIX) - AC_CHECK_LIB(pcreposix, regcomp) + AC_CHECK_LIB(pcreposix, regcomp + ,,AC_MSG_ERROR([*** pcreposix library not found]) + ) + elif test "x${enable_regex_using}" = "libc"; then + AC_CHECK_FUNC(regcomp + ,,AC_MSG_ERROR([*** regcomp not found in libc]) + ) + else + AC_MSG_ERROR([*** unknown regex option: $enable_regex_using]) fi fi fi @@ -157,8 +167,6 @@ AC_FUNC_MALLOC AC_OUTPUT(Makefile src/Makefile doc/powwow.doc doc/Makefile man/powwow.6.utf-8 man/Makefile) -AC_OUTPUT - cat <<EOF |