Changeset 5285:8d3f14f63bbe in roaraudio


Ignore:
Timestamp:
11/22/11 13:03:04 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

test for h_errno

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r5281 r5285  
    10751075} 
    10761076 
     1077test_var_defmake () { 
     1078 DEF="$1" 
     1079 NAME="$2" 
     1080 shift; 
     1081 shift; 
     1082 echo -n "checking for global variable $NAME... " 
     1083 
     1084 TYPE="$1" 
     1085 VAR="$2" 
     1086 shift; 
     1087 shift; 
     1088 
     1089 LIBS='' 
     1090 
     1091 while [ "$1" != '--' ] 
     1092 do 
     1093  case "$1" in 
     1094   'c'|'-lc') 
     1095    :; # no need to do anything 
     1096   ;; 
     1097   '-'*) 
     1098    LIBS="$LIBS $1" 
     1099   ;; 
     1100   *) 
     1101    LIBS="-l$1" 
     1102   ;; 
     1103  esac 
     1104  shift; 
     1105 done 
     1106 
     1107 shift; # skip '--' 
     1108 
     1109 echo "TEST VAR: $NAME" >&5 
     1110 
     1111 { 
     1112  while [ "$1" != '' ] 
     1113  do 
     1114   _h="$1"; 
     1115   shift; 
     1116   _envname=`echo "$_h" | to_escaped` 
     1117   eval "_t=\$libname_$_envname" 
     1118   echo "LIB($name) DEPENDS ON $_h($_envname) with state '$_t'" >&5 
     1119   if [ "$_t" = 'false' ] 
     1120   then 
     1121    echo "// not including <$_h> as it was tested as not present" 
     1122   else 
     1123    echo "#include <$_h>" 
     1124   fi 
     1125  done 
     1126 
     1127  case "$TYPE" in 
     1128   ':int') 
     1129    _type='int' 
     1130   ;; 
     1131   ':float') 
     1132    _type='float' 
     1133   ;; 
     1134   ':ptr') 
     1135    _type='void *' 
     1136   ;; 
     1137   *) 
     1138    _type="$TYPE" 
     1139   ;; 
     1140  esac 
     1141 
     1142  echo 'int main (void) {' 
     1143  echo " $_type x;" 
     1144  echo " x = ($_type)$VAR;" 
     1145  echo " $VAR = x;" 
     1146  echo ' return 0;' 
     1147  echo '}' 
     1148 
     1149 } > $TF_C 
     1150 
     1151 echo "--- BEGIN OF CODE BLOCK ---" >&5 
     1152 cat $TF_C >&5 
     1153 echo "--- END OF CODE BLOCK ---" >&5 
     1154 
     1155 echo "VAR($NAME) HAS COMPILER/LINKER OUTPUT:" >&5 
     1156 echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5 
     1157 $CCTF $LIBS >&5 2>&5; 
     1158 R=$? 
     1159 echo "--- END OF CHILD OUTPUT BLOCK ---" >&5 
     1160 
     1161 if [ "$R" = '0' ] 
     1162 then 
     1163  echo "#define $DEF" >&3 
     1164  echo "VAR($NAME) IS OK" >&5 
     1165  echo yes 
     1166 else 
     1167  echo "VAR($NAME) IS NOT OK" >&5 
     1168  echo no 
     1169 fi 
     1170} 
     1171 
    10771172test_version () { 
    10781173 DEF="$1" 
     
    17561851 
    17571852 
     1853test_var_defmake   ROAR_HAVE_VAR_H_ERRNO h_errno int h_errno -- netdb.h 
     1854 
    17581855echo -n 'checking for basic IO calls... ' 
    17591856 
Note: See TracChangeset for help on using the changeset viewer.