From db322d5bfef46f3b7ad11d3c8b26f45f5ec1dc1a Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 7 Jul 2019 22:27:20 +0100 Subject: Compiler checks added to the configure script To build the software, we need a C/C++ compiler. But until now at configure time there was no check on this. As a result, when the system didn't have them, the user would only learn in a crash of the programs. With this commit, some checks have been added at configure time to do basic checks and inform the user if necessary. --- .file-metadata | Bin 6157 -> 6106 bytes configure | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/.file-metadata b/.file-metadata index 46a481f..d8ef27e 100644 Binary files a/.file-metadata and b/.file-metadata differ diff --git a/configure b/configure index 5e089c1..61e8469 100755 --- a/configure +++ b/configure @@ -710,6 +710,45 @@ ln -s $topdir/reproduce/software/config/gnuastro .gnuastro +# Check for C/C++ compilers +# ------------------------- +# +# To build the software, we'll need some basic tools (the compilers in +# particular) to be present. +hascc=0; +if type cc > /dev/null 2>/dev/null; then + if type c++ > /dev/null 2>/dev/null; then hascc=1; fi +else + if type gcc > /dev/null 2>/dev/null; then + if type g++ > /dev/null 2>/dev/null; then hascc=1; fi + else + if type clang > /dev/null 2>/dev/null; then + if type clang++ > /dev/null 2>/dev/null; then hascc=1; fi + fi + fi +fi +if [ $hascc = 0 ]; then + cat < /dev/null 2>/dev/null; then hasfc=1; fi + + if [ $hasfc = 0 ]; then + cat <