From cbd448bb7412e147fc1c22406c458c71954535cb Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 3 Dec 2018 04:51:45 +0000 Subject: Preference for shared library linking Some high-level programs like Wget and cURL need to be built in shared mode because they also include dynamic loading of libraries. Therefore, if we only build the lower-level libraries in static mode, our own build will be ignored and they will go and find the system's shared libraries to link with. Because of this, for now, we have manually set the `static_build' variable in the configure script to `no'. Also, if the downloader fails, we'll delete the output (an empty file in the case of Wget) because it interefers with a target definition. --- configure | 92 +++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 41 deletions(-) (limited to 'configure') diff --git a/configure b/configure index fc2adc7..5fddc73 100755 --- a/configure +++ b/configure @@ -502,43 +502,56 @@ ln -s $(pwd)/reproduce/config/gnuastro .gnuastro # See if the C compiler can build static libraries # ------------------------------------------------ -oprog=$depdir/static-test -cprog=$depdir/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 &> /dev/null; then - export static_build="yes" -else - export static_build="no" -fi -rm -f $oprog $cprog -if [ $printnotice = yes ] && [ $static_build = "no" ]; then - cat <" > $cprog +#echo "int main(void) {return 0;}" >> $cprog +#if [ x$CC = x ]; then CC=gcc; fi; +#if $CC $cprog -o$oprog -static &> /dev/null; then +# export static_build="yes" +#else +# export static_build="no" +#fi +#rm -f $oprog $cprog +#if [ $printnotice = yes ] && [ $static_build = "no" ]; then +# cat < /dev/null 2>/dev/null; then numthreads=$(nproc --all); else numthreads=2; fi -####################################### -#static_build=no -####################################### make -f reproduce/src/make/dependencies-basic.mk \ static_build=$static_build \ needs_ldl=$needs_ldl \ - #-j$numthreads + -j$numthreads @@ -651,7 +661,7 @@ numthreads=$($instdir/bin/nproc) ./.local/bin/make -f reproduce/src/make/dependencies.mk \ static_build=$static_build \ rpath_command=$rpath_command \ - #-j$numthreads + -j$numthreads -- cgit v1.2.1