about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-08-12 15:00:21 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-08-12 15:00:21 +0000
commit13ebb58f24da4ca93966993b16a3df193f70b2c3 (patch)
tree1286a354b9be251999212f599b2e1d096ae0dd7c /configure
parentc05251f11eee86d8d70a681a8a20e55caf030f70 (diff)
downloadskalibs-13ebb58f24da4ca93966993b16a3df193f70b2c3.tar.gz
skalibs-13ebb58f24da4ca93966993b16a3df193f70b2c3.tar.xz
skalibs-13ebb58f24da4ca93966993b16a3df193f70b2c3.zip
Solaris fix attempt for spawn.lib detection
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure42
1 files changed, 24 insertions, 18 deletions
diff --git a/configure b/configure
index abaa7fd..12f627b 100755
--- 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"