Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5805)
+++ ChangeLog	(revision 5806)
@@ -4,4 +4,5 @@
 	* Removed unused checks in configure. Improves build speed slightly.
 	* Re-ported to OpenBSD.
+	* Made build system tests return correct error codes.
 
 v. 1.0beta8 - Mon Dec 10 2012 12:42 CET
Index: build-system/configure.tests
===================================================================
--- build-system/configure.tests	(revision 5779)
+++ build-system/configure.tests	(revision 5806)
@@ -48,4 +48,5 @@
  VERSION=`head -n 1 ChangeLog | cut -d' ' -f2`
  echo "$VERSION"
+ return 0
 }
 
@@ -54,4 +55,5 @@
  BUILD_STAMP="`date -u +'%F %X'` (`id -un`@`uname -n`)"
  echo "$BUILD_STAMP"
+ return 0
 }
 
@@ -61,4 +63,5 @@
  then
   echo $CC
+  return 0
  else
   CC=$(which gcc cc 2> /dev/null | grep ^/ | head -n 1)
@@ -69,4 +72,5 @@
   fi
   echo $CC
+  return 0
  fi
 }
@@ -77,4 +81,5 @@
  then
   echo $RANLIB
+  return 0
  else
   _guess=`echo $CC | sed 's/[gp]*cc\(-.*\)*//'`
@@ -83,6 +88,8 @@
   then
    echo 'none'
+   return 1
   fi
   echo $RANLIB
+  return 0
  fi
 }
@@ -94,6 +101,8 @@
  then
   echo $PKG_CONFIG
+  return 0
  else
   echo no
+  return 1
  fi
 }
@@ -103,4 +112,5 @@
  SYSNAME=$(uname -s)
  echo "$SYSNAME"
+ return 0
 }
 
@@ -141,6 +151,8 @@
   fi
   echo "$SYSNAME"
+  return 0
  else
   echo no
+  return 1
  fi
 }
@@ -155,7 +167,9 @@
   echo yes
   Wextra=true
+  return 0
  else
   echo no
   Wextra=false
+  return 1
  fi
 }
@@ -167,7 +181,9 @@
   echo "cp_v=-v" >&4
   echo yes
+  return 0
  else
   echo "cp_v=" >&4
   echo no
+  return 1
  fi
 }
@@ -220,8 +236,10 @@
    echo "$BIN_FORMAT"
    echo "BIN FORMAT() IS '$BIN_FORMAT'" >&5
+   return 0
   else
    BIN_FORMAT=unknown
    echo 'unknown'
    echo "BIN FORMAT() NOT KNOWN" >&5
+   return 1
   fi
  else
@@ -229,4 +247,5 @@
   echo 'unknown'
   echo "BIN FORMAT() NOT KNOWN" >&5
+  return 1
  fi
 }
@@ -245,4 +264,5 @@
  echo "LINK_DEPS=$LINK_DEPS" >&4
  echo "checking for linkage model... $LINK_DEPS"
+ return 0
 }
 
@@ -434,4 +454,5 @@
    eval "libname_$envname=true"
   fi
+  return 0
  else
   [ "$subdir" != '' ] && \
@@ -441,4 +462,5 @@
   echo "LIB($name) SETS libname_$envname=false" >&5
   eval "libname_$envname=false"
+  return 1
  fi
  echo >&5
@@ -460,8 +482,10 @@
   echo "TOOL($NAME) WILL BE RUNTIME DETECTED" >&5
   echo "#define $DEF "\""$1"\" >&3
+  return 0
  elif $MINIMAL
  then
   echo "disabled by user (minimalstic build)"
   echo "TOOL($NAME) IS DISABLED BY USER" >&5
+  return 1
  else
 
@@ -472,8 +496,10 @@
    echo 'no'
    echo "TOOL($NAME) NOT FOUND" >&5
+   return 1
   else
    echo $LIST
    echo "#define $DEF "\""$LIST"\" >&3
    echo "TOOL($NAME) IS AT $LIST" >&5
+   return 0
   fi
  fi
@@ -563,10 +589,11 @@
   echo "FUNCTION($NAME) IS OK" >&5
   echo "yes$_info"
+  return 0
  else
   eval funcname_$_funcname=false
   echo "FUNCTION($NAME) IS NOT OK" >&5
   echo "no$_info"
- fi
-
+  return 1
+ fi
 }
 
@@ -659,7 +686,9 @@
   echo "CONST($NAME) IS OK" >&5
   echo yes
+  return 0
  else
   echo "CONST($NAME) IS NOT OK" >&5
   echo no
+  return 1
  fi
 }
@@ -736,5 +765,4 @@
   echo ' return 0;'
   echo '}'
-
  } > $TF_C
 
@@ -754,7 +782,9 @@
   echo "VAR($NAME) IS OK" >&5
   echo yes
+  return 0
  else
   echo "VAR($NAME) IS NOT OK" >&5
   echo no
+  return 1
  fi
 }
@@ -787,4 +817,5 @@
  fi
 
+ return 0
 }
 
@@ -839,7 +870,9 @@
   echo 'ok'
   echo "TYPE($NAME) IS OK" >&5
+  return 0
  else
   echo 'not found'
   echo "TYPE($NAME) NOT FOUND" >&5
+  return 1
  fi
 }
@@ -885,4 +918,5 @@
  echo "#define $DEF $R" >&3
  printf "$RS\n" "$R"
+ return 0
 }
 
@@ -891,8 +925,10 @@
  test_lib_defmake ${ROAR_BUILDSYSTEM_DEFPREFIX}HAVE_LIBWS2_32     %            WinSockP1     ws2_32     -- winsock2.h
  echo 'NETLIBS += $(lib_wsock32) $(lib_ws2_32)' >&4
+ return 0
 }
 
 test_netlibs() {
  test_winsock
+ return 0
 }
 
@@ -909,4 +945,5 @@
   echo 'pthread=$(opt_pthread)' >&4
   echo yes
+  return 0
  else
   echo 'opt_pthread=' >&4
@@ -914,4 +951,5 @@
   echo no
   test_lib_defmake ${ROAR_BUILDSYSTEM_DEFPREFIX}HAVE_LIBPTHREAD    %            libpthread    pthread    -- pthread.h
+  return $?
  fi
 }
