From 035e44f3bfdd814c4b7d8240011672ed625aed8d Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 16 Nov 2018 19:07:03 +0000 Subject: Configure script checks if static libraries will be built The default Mac compiler has problems building static libraries. Since we are not yet building the GNU C Compiler as part of the pipeline, we'll have to rely on the host system's compiler. Therefore, a check is now added a the start of the configure script that will build a minimal program with the `-static' flag and if it fails, it will print a warning. Afterwards, none of the dependencies will be built with the `-static' flag. --- configure | 61 ++++++++++++++++++++++++-- reproduce/src/make/dependencies-basic.mk | 51 ++++++++++++++++++++- reproduce/src/make/dependencies-build-rules.mk | 6 ++- 3 files changed, 110 insertions(+), 8 deletions(-) diff --git a/configure b/configure index d60a34b..cc5bd88 100755 --- a/configure +++ b/configure @@ -406,8 +406,52 @@ ln -s $(pwd)/reproduce/config/gnuastro .gnuastro -# Build basic dependencies -# ------------------------ +# See if the C compiler can build static libraries +# ------------------------------------------------ +oprog=$ddir/static-test +cprog=$ddir/static-test.c +echo "#include " > $cprog +echo "int main(void) {return 0;}" >> $cprog +if [ x$CC = x ]; then CC=gcc; fi; +if $CC $cprog -o$oprog -static -ljunk &> /dev/null; then + export static_build="yes" +else + export static_build="no" +fi +rm -f $oprog $cprog +if [ $static_build = "no" ]; then + cat <