diff options
Diffstat (limited to 'make/configure.py')
-rw-r--r-- | make/configure.py | 38 |
1 files changed, 38 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' ) |