This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Configure error building cygwin


All,

Discussions of various configure-related errors on the list today
reminded me of something I ran into last week when trying to rebuild
the cygwin DLL.

After syncing with CVS, the configure stage of a clean rebuild
results in the following error.  Source has been checked out
into src, configure is being run from a newly created obj directory
via bash -x '../src/configure':

  + CONFIGURED_MAKEINFO=makeinfo
  + test -n makeinfo
  + echo makeinfo
  makeinfo
  + test -n makeinfo
  + break
  + test -n makeinfo
  + test -r ../src/.gdbinit
  + we_are_ok=no
  + echo 'int main () { return 0; }'
  + gcc -o conftest -g -O2 conftest.c
  + test 0 = 0
  + test -s conftest
  + test -s conftest.exe
  + echo '*** The command '\''gcc -o conftest -g -O2   conftest.c'\'' failed.'
  *** The command 'gcc -o conftest -g -O2   conftest.c' failed.
  + echo '*** You must set the environment variable CC to a working compiler.'
  *** You must set the environment variable CC to a working compiler.
  + rm -f conftest.c
  cc1: conftest.c: No such file or directory
  + exit 1

The configure snippet that's failing is:

  # Make sure that the compiler is able to generate an executable.  If it
  # can't, we are probably in trouble.  We don't care whether we can run the
  # executable--we might be using a cross compiler--we only care whether it
  # can be created.  At this point the main configure script has set CC.
  we_are_ok=no
  echo "int main () { return 0; }" > conftest.c
  ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
  if test $? = 0 ; then
    if test -s conftest || test -s conftest.exe ; then
      we_are_ok=yes
    fi
  fi 
  case $we_are_ok in
    no)
      echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
      echo 1>&2 "*** You must set the environment variable CC to a working compiler." 
      rm -f conftest*
      exit 1
      ;;
  esac
  rm -f conftest*

It appears that the test for the existance of conftest.exe is failing.
However, after the configure script exists, conftest.exe exists in the
obj directory, and has size > 0:

  bash-2.05b$ ls -la
  total 27
  drwxr-xr-x    2 sam.robb Domain U     4096 Aug 30 13:14 .
  drwxr-xr-x    4 sam.robb Domain U     4096 Aug 30 13:07 ..
  -rw-r--r--    1 sam.robb Domain U        1 Aug 30 13:14 confdefs.h
  -rw-r--r--    1 sam.robb Domain U        0 Aug 30 13:14 config.cache
  -rw-r--r--    1 sam.robb Domain U     2409 Aug 30 13:14 config.log
  -rw-r--r--    1 sam.robb Domain U       26 Aug 30 13:14 conftest.c
  -rwxr-xr-x    1 sam.robb Domain U    13656 Aug 30 13:14 conftest.exe

At this point, trying the same test as the configure script succeeds:

  bash-2.05b$ we_are_ok=no ; \
  >   if test -s conftest || test -s conftest.exe ; then \
  >   we_are_ok=yes ; \
  >   fi ; \
  >   echo $we_are_ok 
  yes

It smells like a race condition of some sort.  Then again, I may be
completely wrong.  If there's any interest at all in this, I'd be
happy to dig further (strace, etc.) - the problem is very repeatable
on my development machine.

-Samrobb

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]