summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2013-07-27 20:22:00 +0000
committerStef Walter <stef@thewalter.net>2013-07-29 10:41:59 +0200
commitcdb1a88ba117d92991298445e5db51b6e1f5ce3c (patch)
treec3748c1e71bcd06610446ecc47dffd378d1f76c2
parent68beea0bca786730019df002fa625986a4d65d91 (diff)
do not assume dead code existence in autoconf checks
when compiler optimize source, it removes dead code so a linkage error in these cases are not visisble. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> https://bugs.freedesktop.org/show_bug.cgi?id=67413
-rw-r--r--configure.ac4
1 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 64f39c6..e57272b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,9 +100,9 @@ if test "$os_unix" = "yes"; then
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_CHECK_DECLS([__progname])
- AC_LINK_IFELSE([AC_LANG_SOURCE([extern char *__progname; void main() { }])],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char *__progname;]], [[__progname=(char*)0;]])],
[AC_DEFINE(HAVE___PROGNAME, [1], [Whether __progname available])])
- AC_LINK_IFELSE([AC_LANG_SOURCE([extern int __libc_enable_secure; void main() { }])],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int __libc_enable_secure;]], [[__libc_enable_secure = 0;]])],
[AC_DEFINE(HAVE___LIBC_ENABLE_SECURE, [1], [Whether __libc_enable_secure available])])
fi