diff options
author | Wojciech Meyer <wojciech.meyer@gmail.com> | 2013-06-27 21:09:25 +0000 |
---|---|---|
committer | Wojciech Meyer <wojciech.meyer@gmail.com> | 2013-06-27 21:09:25 +0000 |
commit | d6d2c4b3ead43e4ef47dfcc4b67477ad1fffe54a (patch) | |
tree | 8d64df36691aaabaacb4221a76d45cdd20eb955a | |
parent | 1b39eae0aecb40c732ad43dc7916549e725568af (diff) |
configure: fix detection of non-working C compiler.
(patch by Adrien Nader!)
The test tried to do something like:
case "$foo,$bar" in
*,*) echo 1 ;;
*) echo "compiler not working" ;;
esac
However the second case cannot match because of the first one.
Instead, check the return code of the command.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13844 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rwxr-xr-x | configure | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -393,7 +393,15 @@ esac # Check the sizes of data types inf "Checking the sizes of integers and pointers..." -set `sh ./runtest sizes.c` +ret=`sh ./runtest sizes.c` + +if test "$?" -ne 0; then + err "Unable to compile the test program.\n" \ + "Make sure the C compiler '$cc' is properly installed." +fi + +set $ret + case "$2,$3" in 4,4) inf "OK, this is a regular 32 bit architecture." echo "#undef ARCH_SIXTYFOUR" >> m.h @@ -403,8 +411,6 @@ case "$2,$3" in arch64=true;; *,*) err "This architecture seems to be neither 32 bits nor 64 bits.\n" \ "OCaml won't run on this architecture.";; - *) err "Unable to compile the test program.\n" \ - "Make sure the C compiler $cc is properly installed.";; esac if test $1 != 4 && test $2 != 4 && test $4 != 4; then err "Sorry, we can't find a 32-bit integer type\n" \ |