2007-08-17 20:56:15 +00:00
|
|
|
# We need to be careful to avoid having the reference to
|
|
|
|
# program_invocation_name optimized out. We do that by
|
|
|
|
# returning the value.
|
|
|
|
|
2007-07-18 18:30:50 +00:00
|
|
|
AC_DEFUN([AC_PROGRAM_INVOCATION_NAME],
|
|
|
|
[AC_CACHE_CHECK(
|
|
|
|
for program_invocation_name,
|
|
|
|
ac_cv_have_program_invocation_name,
|
2023-06-21 14:37:51 +00:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char* program_invocation_name;]], [[return *program_invocation_name;]])],[ac_cv_have_program_invocation_name=yes],[ac_cv_have_program_invocation_name=no])
|
2007-07-18 18:30:50 +00:00
|
|
|
)
|
|
|
|
if test "$ac_cv_have_program_invocation_name" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME, 1,
|
|
|
|
[define if libc has program_invocation_name])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|