Skip to content

Commit

Permalink
engine: wscript: improve execinfo and GNU backtrace() check
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Feb 2, 2025
1 parent d0464ef commit 0cb034a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion engine/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ from copy import copy

top = '.'

EXECINFO_TEST = '''#include <execinfo.h>
int main(int argc, char **argv)
{
backtrace(0, 0);
backtrace_symbols(0, 0);
return 0;
}
'''

def options(opt):
grp = opt.add_option_group('Engine options')

Expand Down Expand Up @@ -111,7 +120,7 @@ def configure(conf):
if hasattr(conf.options, 'DLLEMU'):
conf.define_cond('XASH_DLL_LOADER', conf.options.DLLEMU)

conf.check_cc(header_name='execinfo.h', mandatory=False, define_name='HAVE_EXECINFO')
conf.check_cc(fragment=EXECINFO_TEST, msg='Checking for glibc backtrace()', mandatory=False, define_name='HAVE_EXECINFO')

conf.define('ENGINE_DLL', 1)
conf.define_cond('XASH_ENGINE_TESTS', conf.options.ENGINE_TESTS)
Expand Down

0 comments on commit 0cb034a

Please sign in to comment.