void-packages/srcpkgs/kyua-testers/patches/0001-Cache-configure-result-of-getcwd-NULL-0-test.patch

50 lines
1.4 KiB
Diff
Raw Normal View History

2013-11-03 07:37:55 +00:00
From d993fe52e4bc78284950fcaa620088f58f3d35ea Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Sun, 3 Nov 2013 08:33:31 +0100
Subject: [PATCH] Cache configure result of getcwd(NULL,0) test.
This is the last configure test that must be cached for a proper
cross compilation.
---
configure.ac | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index cf11933..f0c1484 100644
--- configure.ac
+++ configure.ac
@@ -56,17 +56,20 @@ KYUA_GETOPT
KYUA_LAST_SIGNO
AC_CHECK_FUNCS([putenv setenv unsetenv])
-
-AC_MSG_CHECKING([whether getcwd(NULL, 0) works])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
+AC_CACHE_CHECK(
+ [whether getcwd(NULL, 0) works],
+ [kyua_cv_getcwd_null_0_works], [
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
#include <unistd.h>],
- [char *cwd = getcwd(NULL, 0);
- return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;])],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_GETCWD_DYN], [1],
- [Define to 1 if getcwd(NULL, 0) works])],
- [AC_MSG_RESULT(no)])
-
+ [char *cwd = getcwd(NULL, 0);
+ return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;])],
+ [kyua_cv_getcwd_null_0_works=yes],
+ [kyua_cv_getcwd_null_0_works=no])
+])
+if test "${kyua_cv_getcwd_null_0_works}" = yes; then
+ AC_DEFINE([HAVE_GETCWD_DYN], [1],
+ [Define to 1 if getcwd(NULL, 0) works])
+fi
AC_PROG_RANLIB
--
1.8.4.1