You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2021/10/14 20:21:48 UTC
svn commit: r1894268 - /santuario/xml-security-cpp/trunk/configure.ac
Author: scantor
Date: Thu Oct 14 20:21:47 2021
New Revision: 1894268
URL: http://svn.apache.org/viewvc?rev=1894268&view=rev
Log:
SANTUARIO-549 - configure getcwd(NULL, 0) test fails when cross compiling
https://issues.apache.org/jira/browse/SANTUARIO-549
Modified:
santuario/xml-security-cpp/trunk/configure.ac
Modified: santuario/xml-security-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/configure.ac?rev=1894268&r1=1894267&r2=1894268&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/configure.ac (original)
+++ santuario/xml-security-cpp/trunk/configure.ac Thu Oct 14 20:21:47 2021
@@ -74,14 +74,18 @@ AC_CHECK_FUNCS([strcasecmp])
# Check whether getcwd can dynamically allocate memory.
AC_MSG_CHECKING([whether 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([XSEC_HAVE_GETCWD_DYN], [1],
- [Define to 1 if getcwd(NULL, 0) works])],
- [AC_MSG_RESULT(no)])
+AC_CACHE_VAL([xml_cv_func_getcwd_null],
+[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+ #include <unistd.h>
+ char *cwd = getcwd(NULL, 0);
+ return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;]])],
+ [xml_cv_func_getcwd_null=yes],
+ [xml_cv_func_getcwd_null=no])])
+AC_MSG_RESULT([$xml_cv_func_getcwd_null])
+if test $xml_cv_func_getcwd_null = yes; then
+AC_DEFINE([XSEC_HAVE_GETCWD_DYN], [1],
+ [Define to 1 if getcwd(NULL, 0) works])
+fi
AC_LANG(C++)