skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 13ebb58f24da4ca93966993b16a3df193f70b2c3
parent c05251f11eee86d8d70a681a8a20e55caf030f70
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Fri, 12 Aug 2016 15:00:21 +0000

 Solaris fix attempt for spawn.lib detection

Diffstat:
Mconfigure | 42++++++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/configure b/configure @@ -164,26 +164,32 @@ trytypesize() { echo " ... $type_size" } +trycl () { + name=$1 + shift + if $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -c -o try$name.o src/sysdeps/try$name.c 2>/dev/null ; then + if $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null try$name.o 2>/dev/null ; then + echo 1 + elif $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null try$name.o $* 2>/dev/null ; then + echo 2 + fi + rm -f try$name.o + else + echo 0 + fi +} + tryrtlib () { echo "Checking whether system has $3..." - if $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -c -o try$2.o src/sysdeps/try$2.c 2>/dev/null ; then - if $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null try$2.o 2>/dev/null ; then - rm -f try$2.o - eval "$1=" - echo " ... yes" - return 0 - elif $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null try$2.o -lrt 2>/dev/null ; then - rm -f try$2.o - eval "$1=-lrt" - echo " ... yes, with -lrt" - rm -f try$1.o - return 0 - else - rm -f try$2.o - eval "$1=" - echo " ... no" - return 1 - fi + r=`trycl $2 -lrt` + if test $r = 1 ; then + eval "$1=" + echo " ... yes" + return 0 + elif test $r = 2 ; then + eval "$1=-lrt" + echo " ... yes, with -lrt" + return 0 else eval "$1=" echo " ... no"