diff options
-rw-r--r-- | libhb/module.defs | 4 | ||||
-rw-r--r-- | make/configure.py | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/libhb/module.defs b/libhb/module.defs index 6ca0d2fbc..ca80e56fa 100644 --- a/libhb/module.defs +++ b/libhb/module.defs @@ -82,6 +82,10 @@ ifeq (1,$(COMPAT.strtok_r)) LIBHB.GCC.D += HB_NEED_STRTOK_R endif +ifeq (1,$(HAS.strerror_r)) + LIBHB.GCC.D += HAS_STRERROR_R +endif + ## required for <libdvdread/*.h> ifneq (,$(filter $(BUILD.arch),ppc ppc64)) LIBHB.GCC.D += WORDS_BIGENDIAN diff --git a/make/configure.py b/make/configure.py index e75ca2872..3efb6848b 100644 --- a/make/configure.py +++ b/make/configure.py @@ -1726,6 +1726,23 @@ int main () strtok_r = LDProbe( 'static strtok_r', '%s -static' % Tools.gcc.pathname, '', strtok_r_test ) strtok_r.run() + strerror_r_test = """ +#include <string.h> + +int main() +{ + /* some implementations fail if buf is less than 80 characters + so size it appropriately */ + char errstr[128]; + /* some implementations fail if err == 0 */ + strerror_r(1, errstr, 127); + return 0; +} +""" + + strerror_r = LDProbe( 'strerror_r', '%s' % Tools.gcc.pathname, '', strerror_r_test ) + strerror_r.run() + ## cfg hook before doc prep cfg.doc_ready() @@ -1858,6 +1875,10 @@ int main () doc.add( 'HAS.regex', 1 ) if strtok_r.fail: doc.add( 'COMPAT.strtok_r', 1 ) + else: + doc.addBlank() + if not strerror_r.fail: + doc.add( 'HAS.strerror_r', 1 ) doc.addMake( '' ) doc.addMake( '## define debug mode and optimize before other includes' ) |