]> mj.ucw.cz Git - libucw.git/commitdiff
Config: Regularized configuration of regex libs
authorMartin Mares <mj@ucw.cz>
Sat, 11 Feb 2012 19:04:50 +0000 (20:04 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 11 Feb 2012 19:04:50 +0000 (20:04 +0100)
ucw/default.cfg
ucw/libucw.pc
ucw/perl/UCW/Configure/C.pm
ucw/perl/UCW/Configure/LibUCW.pm
ucw/regex.c

index 75fb63532b16f3a7d5d1b1033e136a61b354b349..ff970e0971e2439ccfdcf092891ca146ce1351e2 100644 (file)
@@ -59,5 +59,9 @@ Set("CONFIG_UCW_FB_DIRECT");
 # Use epoll (needs support in libc and kernel, default: auto-detect)
 # Set("CONFIG_UCW_EPOLL");
 
+# Which regular expression library should be used? If none is selected, we use BSD regex from libc.
+UnSet("CONFIG_UCW_POSIX_REGEX");
+UnSet("CONFIG_UCW_PCRE");
+
 # Return success
 1;
index f55aafbc5930afa526b3b5d12f1687e7bba8423c..b84b783d470d6d106033701c72211f9432d78847 100644 (file)
@@ -9,7 +9,7 @@ threads=-lpthread
 threads=
 #endif
 
-#ifdef CONFIG_PCRE
+#ifdef CONFIG_UCW_PCRE
 regex=-lpcre
 #else
 regex=
index 88dbfd52b7e1c31f4825679e42971d30f76c4c41..ccd20cbf62497ab1a96368c8a8cd0844de23fcc6 100644 (file)
@@ -261,10 +261,6 @@ if (IsSet("CONFIG_DARWIN")) {
        } else {
                UnSet("CONFIG_UCW_DIRECT_IO");
        }
-       if (!IsSet("CONFIG_POSIX_REGEX") && !IsSet("CONFIG_PCRE")) {
-               Set("CONFIG_POSIX_REGEX" => 1);
-               Warn "BSD regex library on Darwin isn't compatible, using POSIX regex.\n";
-       }
 }
 
 ### Compiling test programs ###
index 81c9459815cee200a796e43c06de599f3fd5f564..8349eb687c0b3e58533a37308a49f6d6c34e6cd4 100644 (file)
@@ -66,6 +66,14 @@ int main(void)
 FINIS
 });
 
+# Darwin does not support BSD regexes, fix up
+if (IsSet("CONFIG_DARWIN")) {
+       if (!IsSet("CONFIG_UCW_POSIX_REGEX") && !IsSet("CONFIG_UCW_PCRE")) {
+               Set("CONFIG_UCW_POSIX_REGEX" => 1);
+               Warn "BSD regex library on Darwin isn't compatible, using POSIX regex.\n";
+       }
+}
+
 PostConfig {
        AtWrite {
                UCW::Configure::C::ConfigHeader("ucw/autoconf.h", [
index 6ead4648e9f8e270e77c232bd4a62211b67c2403..7b89818e9a2b0abbb7fac160afb95837022e6aff 100644 (file)
@@ -16,7 +16,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifdef CONFIG_POSIX_REGEX
+#ifdef CONFIG_UCW_POSIX_REGEX
 
 /* POSIX regular expression library */
 
@@ -104,7 +104,7 @@ rx_subst(regex *r, const char *by, const char *src, char *dest, uns destlen)
   return 1;
 }
 
-#elif defined(CONFIG_PCRE)
+#elif defined(CONFIG_UCW_PCRE)
 
 /* PCRE library */