__deps__ := A52DEC BZIP2 LIBVPX FFMPEG FONTCONFIG FREETYPE LAME LIBASS LIBDCA \
LIBDVDREAD LIBDVDNAV LIBICONV LIBOGG LIBSAMPLERATE LIBTHEORA LIBVORBIS LIBXML2 \
- PTHREADW32 X264 X265 ZLIB LIBBLURAY FDKAAC LIBMFX
+ PTHREADW32 X264 X265 ZLIB LIBBLURAY FDKAAC LIBMFX LIBGNURX
$(eval $(call import.MODULE.defs,LIBHB,libhb,$(__deps__)))
$(eval $(call import.GCC,LIBHB))
LIBHB.GCC.l += iconv
endif
+ifneq ($(HAS.regex),1)
+LIBHB.dll.libs += $(CONTRIB.build/)lib/libregex.a
+else
+ LIBHB.GCC.l += regex
+endif
+
ifeq (1,$(FRIBIDI.enabled))
LIBHB.dll.libs += $(CONTRIB.build/)lib/libfribidi.a
else
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()
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' )
ifneq ($(HAS.libz),1)
MODULES += contrib/zlib
endif
+ifneq ($(HAS.regex),1)
+ MODULES += contrib/libgnurx
+endif
endif
ifneq (,$(filter $(BUILD.system),solaris))
ifeq (1,$(FEATURE.hwd))
TEST.GCC.D += USE_HWD
endif
- TEST.GCC.l += pthreadGC2 iconv ws2_32
+ TEST.GCC.l += pthreadGC2 iconv ws2_32 regex
TEST.GCC.D += PTW32_STATIC_LIB
TEST.GCC.args.extra.exe++ += -static
endif # (1-mingw,$(BUILD.cross)-$(BUILD.system))