Changeset 10856
- Timestamp:
- 2005-11-07T13:54:47+13:00 (17 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/config.h.in
r10855 r10856 13 13 /* Define if using alloca.c. */ 14 14 #undef C_ALLOCA 15 16 /* Define if big endian */ 17 #undef WORDS_BIGENDIAN 15 18 16 19 /* Define to empty if the keyword does not work. */ -
trunk/gsdl/configure
r10181 r10856 7032 7032 fi 7033 7033 7034 7035 # check for endianness 7036 echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 7037 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 7038 if test "${ac_cv_c_bigendian+set}" = set; then 7039 echo $ECHO_N "(cached) $ECHO_C" >&6 7040 else 7041 # See if sys/param.h defines the BYTE_ORDER macro. 7042 cat >conftest.$ac_ext <<_ACEOF 7043 /* confdefs.h. */ 7044 _ACEOF 7045 cat confdefs.h >>conftest.$ac_ext 7046 cat >>conftest.$ac_ext <<_ACEOF 7047 /* end confdefs.h. */ 7048 #include <sys/types.h> 7049 #include <sys/param.h> 7050 7051 int 7052 main () 7053 { 7054 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN 7055 bogus endian macros 7056 #endif 7057 7058 ; 7059 return 0; 7060 } 7061 _ACEOF 7062 rm -f conftest.$ac_objext 7063 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 7064 (eval $ac_compile) 2>conftest.er1 7065 ac_status=$? 7066 grep -v '^ *+' conftest.er1 >conftest.err 7067 rm -f conftest.er1 7068 cat conftest.err >&5 7069 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7070 (exit $ac_status); } && 7071 { ac_try='test -z "$ac_cxx_werror_flag" 7072 || test ! -s conftest.err' 7073 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7074 (eval $ac_try) 2>&5 7075 ac_status=$? 7076 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7077 (exit $ac_status); }; } && 7078 { ac_try='test -s conftest.$ac_objext' 7079 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7080 (eval $ac_try) 2>&5 7081 ac_status=$? 7082 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7083 (exit $ac_status); }; }; then 7084 # It does; now see whether it defined to BIG_ENDIAN or not. 7085 cat >conftest.$ac_ext <<_ACEOF 7086 /* confdefs.h. */ 7087 _ACEOF 7088 cat confdefs.h >>conftest.$ac_ext 7089 cat >>conftest.$ac_ext <<_ACEOF 7090 /* end confdefs.h. */ 7091 #include <sys/types.h> 7092 #include <sys/param.h> 7093 7094 int 7095 main () 7096 { 7097 #if BYTE_ORDER != BIG_ENDIAN 7098 not big endian 7099 #endif 7100 7101 ; 7102 return 0; 7103 } 7104 _ACEOF 7105 rm -f conftest.$ac_objext 7106 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 7107 (eval $ac_compile) 2>conftest.er1 7108 ac_status=$? 7109 grep -v '^ *+' conftest.er1 >conftest.err 7110 rm -f conftest.er1 7111 cat conftest.err >&5 7112 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7113 (exit $ac_status); } && 7114 { ac_try='test -z "$ac_cxx_werror_flag" 7115 || test ! -s conftest.err' 7116 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7117 (eval $ac_try) 2>&5 7118 ac_status=$? 7119 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7120 (exit $ac_status); }; } && 7121 { ac_try='test -s conftest.$ac_objext' 7122 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7123 (eval $ac_try) 2>&5 7124 ac_status=$? 7125 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7126 (exit $ac_status); }; }; then 7127 ac_cv_c_bigendian=yes 7128 else 7129 echo "$as_me: failed program was:" >&5 7130 sed 's/^/| /' conftest.$ac_ext >&5 7131 7132 ac_cv_c_bigendian=no 7133 fi 7134 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 7135 else 7136 echo "$as_me: failed program was:" >&5 7137 sed 's/^/| /' conftest.$ac_ext >&5 7138 7139 # It does not; compile a test program. 7140 if test "$cross_compiling" = yes; then 7141 # try to guess the endianness by grepping values into an object file 7142 ac_cv_c_bigendian=unknown 7143 cat >conftest.$ac_ext <<_ACEOF 7144 /* confdefs.h. */ 7145 _ACEOF 7146 cat confdefs.h >>conftest.$ac_ext 7147 cat >>conftest.$ac_ext <<_ACEOF 7148 /* end confdefs.h. */ 7149 short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; 7150 short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; 7151 void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } 7152 short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; 7153 short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; 7154 void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } 7155 int 7156 main () 7157 { 7158 _ascii (); _ebcdic (); 7159 ; 7160 return 0; 7161 } 7162 _ACEOF 7163 rm -f conftest.$ac_objext 7164 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 7165 (eval $ac_compile) 2>conftest.er1 7166 ac_status=$? 7167 grep -v '^ *+' conftest.er1 >conftest.err 7168 rm -f conftest.er1 7169 cat conftest.err >&5 7170 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7171 (exit $ac_status); } && 7172 { ac_try='test -z "$ac_cxx_werror_flag" 7173 || test ! -s conftest.err' 7174 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7175 (eval $ac_try) 2>&5 7176 ac_status=$? 7177 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7178 (exit $ac_status); }; } && 7179 { ac_try='test -s conftest.$ac_objext' 7180 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7181 (eval $ac_try) 2>&5 7182 ac_status=$? 7183 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7184 (exit $ac_status); }; }; then 7185 if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then 7186 ac_cv_c_bigendian=yes 7187 fi 7188 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then 7189 if test "$ac_cv_c_bigendian" = unknown; then 7190 ac_cv_c_bigendian=no 7191 else 7192 # finding both strings is unlikely to happen, but who knows? 7193 ac_cv_c_bigendian=unknown 7194 fi 7195 fi 7196 else 7197 echo "$as_me: failed program was:" >&5 7198 sed 's/^/| /' conftest.$ac_ext >&5 7199 7200 fi 7201 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 7202 else 7203 cat >conftest.$ac_ext <<_ACEOF 7204 /* confdefs.h. */ 7205 _ACEOF 7206 cat confdefs.h >>conftest.$ac_ext 7207 cat >>conftest.$ac_ext <<_ACEOF 7208 /* end confdefs.h. */ 7209 int 7210 main () 7211 { 7212 /* Are we little or big endian? From Harbison&Steele. */ 7213 union 7214 { 7215 long l; 7216 char c[sizeof (long)]; 7217 } u; 7218 u.l = 1; 7219 exit (u.c[sizeof (long) - 1] == 1); 7220 } 7221 _ACEOF 7222 rm -f conftest$ac_exeext 7223 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7224 (eval $ac_link) 2>&5 7225 ac_status=$? 7226 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7227 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 7228 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7229 (eval $ac_try) 2>&5 7230 ac_status=$? 7231 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7232 (exit $ac_status); }; }; then 7233 ac_cv_c_bigendian=no 7234 else 7235 echo "$as_me: program exited with status $ac_status" >&5 7236 echo "$as_me: failed program was:" >&5 7237 sed 's/^/| /' conftest.$ac_ext >&5 7238 7239 ( exit $ac_status ) 7240 ac_cv_c_bigendian=yes 7241 fi 7242 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 7243 fi 7244 fi 7245 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 7246 fi 7247 echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 7248 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 7249 case $ac_cv_c_bigendian in 7250 yes) 7251 7252 cat >>confdefs.h <<\_ACEOF 7253 #define WORDS_BIGENDIAN 1 7254 _ACEOF 7255 ;; 7256 no) 7257 ;; 7258 *) 7259 { { echo "$as_me:$LINENO: error: unknown endianness 7260 presetting ac_cv_c_bigendian=no (or yes) will help" >&5 7261 echo "$as_me: error: unknown endianness 7262 presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} 7263 { (exit 1); exit 1; }; } ;; 7264 esac 7034 7265 7035 7266 # --------------------------------------------------------------------------- -
trunk/gsdl/configure.in
r10181 r10856 366 366 AC_SUBST(gsdlos) 367 367 368 # check for endianness 369 AC_C_BIGENDIAN 368 370 # --------------------------------------------------------------------------- 369 371 if test "$ac_cv_func_alloca" = 'no'; then
Note:
See TracChangeset
for help on using the changeset viewer.