[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Check for getcwd(NULL, 0) Was: Re: Bug#636568: xerces-c: Updated patch, submitted upstream



On Wed, 2012-10-17 at 11:51 +0200, Pino Toscano wrote:

> If you assume getcwd is available, this check is pointless; if you
> don't, then you need to skip the check below is getcwd has not been
> found.

New version: (has to be indented?)

AC_CHECK_FUNC([getcwd], AC_DEFINE([HAVE_GETCWD],[1],[Define to 1 if you
have the `getcwd` function]))
if test x"$ac_cv_func_getcwd" == xyes; then
AC_MSG_CHECKING([getcwd(NULL,0)])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([
#include <unistd.h>
],[
char *result = getcwd(NULL,0);
if (result == NULL)
  return 1;
])],[
  AC_MSG_RESULT([yes])
  AC_DEFINE([HAVE_GETCWD_GLIBC], 1, [Define to 1 if you have support for
`getcwd(NULL,0)`])
],[
  AC_MSG_RESULT([no])
],[
  AC_MSG_NOTICE([cannot run test program while cross compiling])
])
fi



Reply to: