By convention, configure
is a POSIX shell script that is created from a configure.ac
or configure.in
template file by the GNU autoconf
program - either at install time or before distribution by the software's maintainer.
The error message
configure: error: working directory cannot be determined
comes from a standard autoconf macro named _AC_INIT_DIRCHECK
and defined in /usr/share/autoconf/autoconf/general.m4
:
AC_DEFUN([_AC_INIT_DIRCHECK],
[m4_divert_push([PARSE_ARGS])dnl
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
AC_MSG_ERROR([working directory cannot be determined])
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
AC_MSG_ERROR([pwd does not report name of working directory])
You may find more detailed information about the cause of the error in the config.log
file. Alternatively, you can run the same code in a non-interactive POSIX shell as follows:
/bin/sh -c '
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .`
'
echo $?
or broken down into its individual parts like
/bin/sh -c 'ac_pwd=`pwd` && test -n "$ac_pwd"'; echo $?
One possibility for failure is that the working directory does not have the executable bit set:
$ chmod -x .
$ /bin/sh -c '
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .`
'
/bin/sh: 1: cd: can't cd to /home/steeldriver/src/unrealircd