diff options
author | Nils Schimmelmann <nschimme@gmail.com> | 2019-05-21 06:58:11 (GMT) |
---|---|---|
committer | Nils Schimmelmann <nschimme@gmail.com> | 2019-06-29 17:25:52 (GMT) |
commit | 4e2ea4ccc948e867ec3781ce2eaeca491c6b9912 (patch) | |
tree | ad8106689f3b9014c697f0649438282a64797452 | |
parent | c9ab529d933f2ad070b0a898f87cc083365d533c (diff) | |
download | powwow-4e2ea4ccc948e867ec3781ce2eaeca491c6b9912.zip powwow-4e2ea4ccc948e867ec3781ce2eaeca491c6b9912.tar.gz powwow-4e2ea4ccc948e867ec3781ce2eaeca491c6b9912.tar.bz2 |
Allow the regular expression engine to be replaced with PCRE POSIX
-rw-r--r-- | cmd2.c | 4 | ||||
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | list.c | 4 | ||||
-rw-r--r-- | main.c | 7 |
4 files changed, 29 insertions, 3 deletions
@@ -26,7 +26,9 @@ #include <unistd.h> #include <errno.h> -#ifdef USE_REGEXP +#ifdef USE_PCREPOSIX +# include <pcreposix.h> +#elif defined(USE_REGEXP) # include <regex.h> #endif diff --git a/configure.ac b/configure.ac index a6b3fcd..bc51bdd 100644 --- a/configure.ac +++ b/configure.ac @@ -13,6 +13,16 @@ AC_ARG_ENABLE(vt100, AS_IF([ test "${enable_vt100}" = yes ], [ AC_DEFINE(USE_VT100) ]) +AC_ARG_ENABLE(pcreposix, + AC_HELP_STRING([--enable-pcreposix], + [Use PCRE POSIX library for regular expressions [[default=no]]]), + , + [enable_pcreposix="no"] +) +AS_IF([ test "${enable_pcreposix}" = yes ], + [ AC_DEFINE(USE_PCREPOSIX) ]) + + AC_ARG_ENABLE(sort, AC_HELP_STRING([--enable-sort], [Sort aliases and actions [[default=no]]]), @@ -99,6 +109,12 @@ AC_CHECK_HEADERS([stdlib.h unistd.h]) AC_CHECK_HEADER([locale.h], [AC_CHECK_FUNC([putwc],[AC_DEFINE(USE_LOCALE)])]) +if test "x${enable_pcreposix}" == "xyes"; then + AC_CHECK_HEADER([pcreposix.h], + [AC_CHECK_FUNC([regcomp], [AC_CHECK_LIB(pcreposix,regcomp)])], + [AC_MSG_ERROR([*** pcreposix libraries not found])], []) +fi + AC_ARG_WITH([plugindir], AC_HELP_STRING([--with-plugindir=DIR], [Plugin installation directory [[default=LIBDIR/powwow]]])], @@ -128,6 +144,7 @@ Data directory: $(eval eval eval echo "${datadir}/${PACKAGE}") Plugin directory: $(eval eval eval echo "${plugindir}") enable-vt100: ${enable_vt100} +enable-pcreposix: ${enable_pcreposix} enable-sort: ${enable_sort} enable-noshell: ${enable_noshell} enable-ansibug: ${enable_ansibug} @@ -18,7 +18,9 @@ #include <sys/types.h> #include <sys/time.h> -#ifdef USE_REGEXP +#ifdef USE_PCREPOSIX +# include <pcreposix.h> +#elif defined(USE_REGEXP) # include <regex.h> #endif @@ -75,7 +75,9 @@ extern int errno; extern int select(); -#ifdef USE_REGEXP +#ifdef USE_PCREPOSIX +# include <pcreposix.h> +#elif defined(USE_REGEXP) # include <regex.h> #endif @@ -437,6 +439,9 @@ void printver(void) #else " no regexp," #endif +#ifdef USE_PCREPOSIX + " pcreposix," +#endif #ifdef USE_LOCALE " locale," #endif |