meson: Test for program_invocation_name

program_invocation_name and program_invocation_short_name are both GNU
extensions. I don't believe one can exist without the other, so only
check for program_invocation_name.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
Matt Turner
2019-07-29 13:51:55 -07:00
parent 597bddad47
commit c9b86cf526
3 changed files with 10 additions and 7 deletions

View File

@@ -1035,6 +1035,13 @@ foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_crea
endif
endforeach
if cc.has_header_symbol('errno.h', 'program_invocation_name',
args : '-D_GNU_SOURCE')
pre_args += '-DHAVE_PROGRAM_INVOCATION_NAME'
elif with_tools.contains('intel')
error('Intel tools require the program_invocation_name variable')
endif
# strtod locale support
if cc.links('''
#define _GNU_SOURCE