summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorbradleys <[email protected]>2014-10-15 23:32:41 +0000
committerbradleys <[email protected]>2014-10-15 23:32:41 +0000
commit5996c99f899f8a76289ae30b4b46277a4009179e (patch)
tree8298a85f55142f9716facda2073b5375a019626c /make
parent5e35f6400466af7051aba28a29c4c06738c80b55 (diff)
contrib: Add libgnurx to provide POSIX regex on Windows.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6445 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'make')
-rw-r--r--make/configure.py38
-rw-r--r--make/include/main.defs3
2 files changed, 41 insertions, 0 deletions
diff --git a/make/configure.py b/make/configure.py
index 89a1edec6..334ff07dd 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1580,6 +1580,42 @@ int main ()
iconv = LDProbe( 'static iconv', '%s -static' % Tools.gcc.pathname, '-liconv', iconv_test )
iconv.run()
+ regex_test = """
+#include <stdio.h>
+#include <regex.h>
+
+int match(regex_t *x, char *s)
+{
+ regmatch_t matches[1];
+ return regexec(x, s, 1, matches, 0);
+}
+
+int main()
+{
+ int rv;
+ regex_t exp;
+
+ rv = regcomp(&exp, "^[0-9]+$";", REG_EXTENDED);
+ if (rv != 0) {
+ return 1;
+ }
+
+ if (match(&exp, "7") != 0)
+ {
+ return 1;
+ }
+ if (match(&exp, "foo") == 0)
+ {
+ return 1;
+ }
+
+ regfree(&exp);
+ return 0;
+}
+"""
+ regex = LDProbe( 'static regex', '%s -static' % Tools.gcc.pathname, '-lregex', regex_test )
+ regex.run()
+
## cfg hook before doc prep
cfg.doc_ready()
@@ -1703,6 +1739,8 @@ int main ()
doc.add( 'HAS.libz', 1 )
if not iconv.fail:
doc.add( 'HAS.iconv', 1 )
+ if not regex.fail:
+ doc.add( 'HAS.regex', 1 )
doc.addMake( '' )
doc.addMake( '## define debug mode and optimize before other includes' )
diff --git a/make/include/main.defs b/make/include/main.defs
index 6d27f9669..445796d71 100644
--- a/make/include/main.defs
+++ b/make/include/main.defs
@@ -84,6 +84,9 @@ endif
ifneq ($(HAS.libz),1)
MODULES += contrib/zlib
endif
+ifneq ($(HAS.regex),1)
+ MODULES += contrib/libgnurx
+endif
endif
ifneq (,$(filter $(BUILD.system),solaris))