Xrasher/3rdparty/libogg/wscript
Alibek Omarov 0181e640c9 3rdparty: wscript: set explicit names for correct dependency calc of generated files
This helps avoid issue when the bzip2 or libogg are compiled before header is
generated for them.
In theory, we shouldn't do that, but I guess dependency calculation through
include directives doesn't work when the file doesn't exist.
2024-12-02 21:07:30 +03:00

54 lines
1.5 KiB
Python

#! /usr/bin/env python
# encoding: utf-8
def options(opt):
pass
def configure(conf):
if not conf.path.find_dir('libogg') or not conf.path.find_dir('libogg/src'):
conf.fatal('Can\'t find libogg submodule. Run `git submodule update --init --recursive`.')
return
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'
])
bld(
features = 'subst',
name = 'libogg_config_types',
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',
use = 'libogg_config_types',
includes = ['libogg/include/'],
export_includes = ['libogg/include/']
)