]> git.sur5r.net Git - i3/i3/commitdiff
Unconditionally depend on libpcre >= 8.10 (#2472)
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Tue, 27 Sep 2016 02:04:13 +0000 (19:04 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2016 02:04:13 +0000 (19:04 -0700)
Even Debian oldstable has 8.30, so let’s get rid of conditional
compilation where we don’t actually need it.

common.mk
debian/control
src/regex.c

index 2bd879d45a709241bd73b10c0fa879d6d87d5f6b..7df415eba09612195eb39d5d37fc8b0adceb9ce9 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -135,8 +135,8 @@ LIBEV_LIBS   := $(call ldflags_for_lib, libev,ev)
 
 # libpcre
 PCRE_CFLAGS := $(call cflags_for_lib, libpcre)
 
 # libpcre
 PCRE_CFLAGS := $(call cflags_for_lib, libpcre)
-ifeq ($(shell $(PKG_CONFIG) --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
-I3_CPPFLAGS += -DPCRE_HAS_UCP=1
+ifneq ($(shell $(PKG_CONFIG) --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
+$(error "libpcre >= 8.10 not found")
 endif
 PCRE_LIBS   := $(call ldflags_for_lib, libpcre,pcre)
 
 endif
 PCRE_LIBS   := $(call ldflags_for_lib, libpcre,pcre)
 
index 6b1530b8ccfe3443f68c008c0f3086a519225303..c1e655d8079aa1d2ef7268ec13c8c4e493cc06c6 100644 (file)
@@ -20,7 +20,7 @@ Build-Depends: debhelper (>= 9),
                pkg-config,
                libev-dev (>= 1:4.04),
                libyajl-dev (>= 2.0.4),
                pkg-config,
                libev-dev (>= 1:4.04),
                libyajl-dev (>= 2.0.4),
-               libpcre3-dev,
+               libpcre3-dev (>= 1:8.10),
                libstartup-notification0-dev (>= 0.10),
                libcairo2-dev,
                libpango1.0-dev,
                libstartup-notification0-dev (>= 0.10),
                libcairo2-dev,
                libpango1.0-dev,
index 24846981fbf16b945c5d7e90a9e4b62c26f2f66e..12c0b67f01175a6ac616e03ffd6c50714dfc8726 100644 (file)
@@ -28,11 +28,9 @@ struct regex *regex_new(const char *pattern) {
     struct regex *re = scalloc(1, sizeof(struct regex));
     re->pattern = sstrdup(pattern);
     int options = PCRE_UTF8;
     struct regex *re = scalloc(1, sizeof(struct regex));
     re->pattern = sstrdup(pattern);
     int options = PCRE_UTF8;
-#ifdef PCRE_HAS_UCP
     /* We use PCRE_UCP so that \B, \b, \D, \d, \S, \s, \W, \w and some POSIX
      * character classes play nicely with Unicode */
     options |= PCRE_UCP;
     /* We use PCRE_UCP so that \B, \b, \D, \d, \S, \s, \W, \w and some POSIX
      * character classes play nicely with Unicode */
     options |= PCRE_UCP;
-#endif
     while (!(re->regex = pcre_compile2(pattern, options, &errorcode, &error, &offset, NULL))) {
         /* If the error is that PCRE was not compiled with UTF-8 support we
          * disable it and try again */
     while (!(re->regex = pcre_compile2(pattern, options, &errorcode, &error, &offset, NULL))) {
         /* If the error is that PCRE was not compiled with UTF-8 support we
          * disable it and try again */