diff options
author | Antoine Jacoutot <ajacoutot@openbsd.org> | 2012-08-21 09:16:00 +0000 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2012-08-21 12:25:47 +0200 |
commit | 359bb15bc83484e4de69fa8dbc9113d97817d01e (patch) | |
tree | 8f7d43ded078dccbc47c8c807710f90ef46fdc0d | |
parent | 61abcb61e8b8e988dd03cfd4553f29132a8ca38a (diff) |
Use AC_LANG_PROGRAM to detect program_invocation_short_name functionality
Were erroneusly detecting program_invocation_short_name on OpenBSD
https://bugs.freedesktop.org/show_bug.cgi?id=53706
-rw-r--r-- | configure.ac | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index a42d205..862e2c0 100644 --- a/configure.ac +++ b/configure.ac @@ -73,8 +73,13 @@ if test "$os_unix" = "yes"; then # Check if these are declared and/or available to link against AC_CHECK_DECLS([program_invocation_short_name]) - AC_LINK_IFELSE([AC_LANG_SOURCE([extern char *program_invocation_short_name; void main() { }])], - [AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, [1], [Whether program_invocation_short_name available])]) + AC_MSG_CHECKING([whether program_invocation_short_name is available]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <argp.h>]], + [[program_invocation_short_name = "test";]])], + [AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], + [Whether program_invocation_short_name available]), + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) AC_CHECK_DECLS([__progname]) AC_LINK_IFELSE([AC_LANG_SOURCE([extern char *__progname; void main() { }])], [AC_DEFINE(HAVE___PROGNAME, [1], [Whether __progname available])]) |