summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2011-01-10 22:12:31 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2011-01-10 22:12:31 +0000
commita7b6445cc39983fb33466529a904fe749d3d6885 (patch)
treed1bd8b474cbabe3d3ac5d5a222edd9d4c21b14b0 /configure.ac
parent96fe3b26c18e3b38f8af789df632dea9e7e7fcdc (diff)
Better __progname check.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 9 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 70d51e5e..d50dde90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.11 2011-01-10 22:00:47 nicm Exp $
+# $Id: configure.ac,v 1.12 2011-01-10 22:12:31 nicm Exp $
# Miscellaneous autofoo bullshit.
AC_INIT(tmux, 1.5)
@@ -282,10 +282,16 @@ fi
# Look for __progname.
AC_MSG_CHECKING(for __progname)
-AC_COMPILE_IFELSE(
+AC_LINK_IFELSE(
[
+ #include <stdio.h>
+ #include <stdlib.h>
extern char *__progname;
- int main(void) { const char *cp = __progname; }
+ int main(void) {
+ const char *cp = __progname;
+ printf("%s\n", cp);
+ exit(0);
+ }
],
[AC_DEFINE(HAVE___PROGNAME) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no)