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
ret = os_get_process_name(cmdline, 63);
if (ret == FALSE)
strcpy(cmdline, nstr);
-#if defined(__GLIBC__) || defined(__CYGWIN__)
+#if defined(HAVE_PROGRAM_INVOCATION_NAME)
if (!strcmp(cmdline, "shader_runner")) {
const char *name;
/* hack to get better testname */
#undef GET_PROGRAM_NAME
-#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
-# if !defined(__GLIBC__) || (__GLIBC__ < 2)
-/* These aren't declared in any libc5 header */
-extern char *program_invocation_name, *program_invocation_short_name;
-# endif
+#if defined(__linux__) && defined(HAVE_PROGRAM_INVOCATION_NAME)
static const char *
__getProgramName()
{
return program_invocation_name;
}
# define GET_PROGRAM_NAME() __getProgramName()
-#elif defined(__CYGWIN__)
+#elif defined(HAVE_PROGRAM_INVOCATION_NAME)
# define GET_PROGRAM_NAME() program_invocation_short_name
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
# include <osreldate.h>