Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

./configure always checks whether the build environment is sane...

I can't help but wonder what exactly a insane build environment is. What errors can this check raise?

share|improve this question
8  
    
You may check config.log for what actual commands are run there or programs compiled. – myaut Apr 22 at 0:20

1 Answer 1

up vote 31 down vote accepted

This comes from automake, specifically from its AM_SANITY_CHECK macro, which is called from AM_INIT_AUTOMAKE, which is normally called early in configure.ac. The gist of this macro is:

  • Check that the path to the source directory doesn't contain certain “unsafe” characters which can be hard to properly include in shell scripts makefiles.
  • Check that ls appears to work.
  • Check that a new file created in the build directory is newer than the configure file. If it isn't (typically because the clock on the build system is not set correctly), the build process is likely to fail because build processes usually rely on generated files having a more recent timestamp than the source files they are generated from.
share|improve this answer
    
Why ls specifically? Is it only to test that basic executables are available and functional or is ls itself somehow used in the make process? – terdon Apr 22 at 14:19
2  
@terdon Some automake templates use ls. The AM_SANITY_CHECK macro itself uses ls to check the relative times of configure and a temporary file (it doesn't use test -nt because not all shells have it). – Gilles Apr 22 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.