From 4581755f9b2a72c3f7374d929ba1521f2b90f74b Mon Sep 17 00:00:00 2001 From: SNMetamorph Date: Mon, 2 Dec 2024 13:32:59 +0400 Subject: [PATCH] 3rdparty: libogg: added generating of config_types.h --- 3rdparty/libogg/wscript | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/3rdparty/libogg/wscript b/3rdparty/libogg/wscript index 1fba1d6e..c1411046 100644 --- a/3rdparty/libogg/wscript +++ b/3rdparty/libogg/wscript @@ -9,24 +9,44 @@ def configure(conf): conf.fatal('Can\'t find libogg submodule. Run `git submodule update --init --recursive`.') return - # Check for required headers - if conf.check_cc(header_name='inttypes.h', mandatory = False): - conf.define('INCLUDE_INTTYPES_H', 1) - elif conf.check_cc(header_name='sys/types.h', mandatory = False): - conf.define('INCLUDE_SYS_TYPES_H', 1) - elif conf.check_cc(header_name='stdint.h', mandatory = False): - conf.define('INCLUDE_STDINT_H', 1) + conf.env.INCLUDE_INTTYPES_H = 0 + conf.env.INCLUDE_SYS_TYPES_H = 0 + conf.env.INCLUDE_STDINT_H = 0 + if conf.check_cc(header_name='inttypes.h', mandatory = False): + conf.env.INCLUDE_INTTYPES_H = 1 + elif conf.check_cc(header_name='sys/types.h', mandatory = False): + conf.env.INCLUDE_SYS_TYPES_H = 1 + elif conf.check_cc(header_name='stdint.h', mandatory = False): + conf.env.INCLUDE_STDINT_H = 1 + + conf.define('INCLUDE_INTTYPES_H', conf.env.INCLUDE_INTTYPES_H) + conf.define('INCLUDE_SYS_TYPES_H', conf.env.INCLUDE_SYS_TYPES_H) + conf.define('INCLUDE_STDINT_H', conf.env.INCLUDE_STDINT_H) def build(bld): sources = bld.path.ant_glob([ 'libogg/src/*.c' ]) - includes = ['libogg/include/'] + + bld( + features = 'subst', + source = 'libogg/include/ogg/config_types.h.in', + target = 'libogg/include/ogg/config_types.h', + INCLUDE_INTTYPES_H = bld.env.INCLUDE_INTTYPES_H, + INCLUDE_SYS_TYPES_H = bld.env.INCLUDE_SYS_TYPES_H, + INCLUDE_STDINT_H = bld.env.INCLUDE_STDINT_H, + SIZE16 = 'int16_t', + USIZE16 = 'uint16_t', + SIZE32 = 'int32_t', + USIZE32 = 'uint32_t', + SIZE64 = 'int64_t', + USIZE64 = 'uint64_t' + ) bld.stlib( source = sources, target = 'libogg', - includes = includes, + includes = ['libogg/include/'], export_includes = ['libogg/include/'] )