This commit is contained in:
hyung-hwan 2008-07-22 08:11:04 +00:00
parent cca74dbaf7
commit 6e9876f9c2
4 changed files with 285 additions and 210 deletions

457
ase/configure vendored
View File

@ -19838,7 +19838,6 @@ else
fi fi
fi fi
# Checks for the math library (is -lm needed?)
LIBM= LIBM=
case $host in case $host in
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
@ -20048,7 +20047,6 @@ esac
LIBM=$LIBM LIBM=$LIBM
# Checks for header files.
{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 { echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
if test "${ac_cv_header_stdc+set}" = set; then if test "${ac_cv_header_stdc+set}" = set; then
@ -20225,7 +20223,8 @@ fi
for ac_header in wchar.h wctype.h
for ac_header in stddef.h wchar.h wctype.h
do do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@ -20370,30 +20369,27 @@ fi
done done
# Checks for typedefs, structures, and compiler characteristics. { echo "$as_me:$LINENO: checking for wchar_t" >&5
{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; }
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_type_wchar_t+set}" = set; then
if test "${ac_cv_c_bigendian+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
# See if sys/param.h defines the BYTE_ORDER macro.
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */ /* confdefs.h. */
_ACEOF _ACEOF
cat confdefs.h >>conftest.$ac_ext cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */ /* end confdefs.h. */
#include <sys/types.h> #include <stddef.h>
#include <sys/param.h>
typedef wchar_t ac__type_new_;
int int
main () main ()
{ {
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ if ((ac__type_new_ *) 0)
&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) return 0;
bogus endian macros if (sizeof (ac__type_new_))
#endif return 0;
; ;
return 0; return 0;
} }
@ -20415,204 +20411,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test -z "$ac_c_werror_flag" || test -z "$ac_c_werror_flag" ||
test ! -s conftest.err test ! -s conftest.err
} && test -s conftest.$ac_objext; then } && test -s conftest.$ac_objext; then
# It does; now see whether it defined to BIG_ENDIAN or not. ac_cv_type_wchar_t=yes
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_bigendian=yes
else else
echo "$as_me: failed program was:" >&5 echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_bigendian=no ac_cv_type_wchar_t=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# It does not; compile a test program.
if test "$cross_compiling" = yes; then
# try to guess the endianness by grepping values into an object file
ac_cv_c_bigendian=unknown
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
int
main ()
{
_ascii (); _ebcdic ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
ac_cv_c_bigendian=yes
fi
if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
# finding both strings is unlikely to happen, but who knows?
ac_cv_c_bigendian=unknown
fi
fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
/* Are we little or big endian? From Harbison&Steele. */
union
{
long int l;
char c[sizeof (long int)];
} u;
u.l = 1;
return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_bigendian=no
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 { echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; }
case $ac_cv_c_bigendian in if test $ac_cv_type_wchar_t = yes; then
yes)
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define ASE_ENDIAN_BIG #define HAVE_WCHAR_T_IN_STDDEF_H
_ACEOF _ACEOF
;;
no)
cat >>confdefs.h <<\_ACEOF fi
#define ASE_ENDIAN_LITTLE
_ACEOF
;;
*)
cat >>confdefs.h <<\_ACEOF
#define ASE_ENDIAN_UNKNOWN
_ACEOF
;;
esac
# Checks the size of primitive data types
{ echo "$as_me:$LINENO: checking for char" >&5 { echo "$as_me:$LINENO: checking for char" >&5
echo $ECHO_N "checking for char... $ECHO_C" >&6; } echo $ECHO_N "checking for char... $ECHO_C" >&6; }
if test "${ac_cv_type_char+set}" = set; then if test "${ac_cv_type_char+set}" = set; then
@ -26781,6 +26600,246 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
if test "${ac_cv_c_bigendian+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# See if sys/param.h defines the BYTE_ORDER macro.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
bogus endian macros
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
# It does; now see whether it defined to BIG_ENDIAN or not.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_bigendian=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# It does not; compile a test program.
if test "$cross_compiling" = yes; then
# try to guess the endianness by grepping values into an object file
ac_cv_c_bigendian=unknown
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
int
main ()
{
_ascii (); _ebcdic ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
ac_cv_c_bigendian=yes
fi
if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
# finding both strings is unlikely to happen, but who knows?
ac_cv_c_bigendian=unknown
fi
fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
/* Are we little or big endian? From Harbison&Steele. */
union
{
long int l;
char c[sizeof (long int)];
} u;
u.l = 1;
return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_bigendian=no
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in
yes)
cat >>confdefs.h <<\_ACEOF
#define ASE_ENDIAN_BIG
_ACEOF
;;
no)
cat >>confdefs.h <<\_ACEOF
#define ASE_ENDIAN_LITTLE
_ACEOF
;;
*)
cat >>confdefs.h <<\_ACEOF
#define ASE_ENDIAN_UNKNOWN
_ACEOF
;;
esac
# Defines extra options # Defines extra options
# Check whether --enable-wchar was given. # Check whether --enable-wchar was given.

View File

@ -68,21 +68,21 @@ else
fi fi
fi fi
# Checks for the math library (is -lm needed?) dnl Checks for the math library (is -lm needed?)
AC_CHECK_LIBM AC_CHECK_LIBM
AC_SUBST(LIBM, $LIBM) AC_SUBST(LIBM, $LIBM)
# Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([wchar.h wctype.h]) AC_CHECK_HEADERS([stddef.h wchar.h wctype.h])
# Checks for typedefs, structures, and compiler characteristics. AC_CHECK_TYPE([wchar_t],
AC_C_BIGENDIAN( [AC_DEFINE([HAVE_WCHAR_T_IN_STDDEF_H],
[AC_DEFINE([ASE_ENDIAN_BIG],[],[Big Endian])], [],[wchar_t is available in stddef.h])],
[AC_DEFINE([ASE_ENDIAN_LITTLE],[],[Little Endian])], [],
[AC_DEFINE([ASE_ENDIAN_UNKNOWN],[],[Unknown Endian])]) [#include <stddef.h>])
# Checks the size of primitive data types dnl Checks the size of primitive data types
AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(int)
@ -120,6 +120,10 @@ AC_DEFINE_UNQUOTED(ASE_PKGNAME,"${PACKAGE}", [package_name])
AC_DEFINE_UNQUOTED(ASE_PKGVERSION,"${VERSION}", [package version]) AC_DEFINE_UNQUOTED(ASE_PKGVERSION,"${VERSION}", [package version])
AC_DEFINE_UNQUOTED(ASE_PKGAUTHOR,"${PACKAGE_BUGREPORT}", [author's email address]) AC_DEFINE_UNQUOTED(ASE_PKGAUTHOR,"${PACKAGE_BUGREPORT}", [author's email address])
AC_C_BIGENDIAN(
[AC_DEFINE([ASE_ENDIAN_BIG],[],[Big Endian])],
[AC_DEFINE([ASE_ENDIAN_LITTLE],[],[Little Endian])],
[AC_DEFINE([ASE_ENDIAN_UNKNOWN],[],[Unknown Endian])])
# Defines extra options # Defines extra options
AC_ARG_ENABLE([wchar], [AC_HELP_STRING([--enable-wchar], AC_ARG_ENABLE([wchar], [AC_HELP_STRING([--enable-wchar],

View File

@ -78,6 +78,9 @@
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H #undef HAVE_STDINT_H
@ -102,6 +105,9 @@
/* Define to 1 if you have the <wchar.h> header file. */ /* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H #undef HAVE_WCHAR_H
/* wchar_t is available in stddef.h */
#undef HAVE_WCHAR_T_IN_STDDEF_H
/* Define to 1 if you have the <wctype.h> header file. */ /* Define to 1 if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H #undef HAVE_WCTYPE_H

View File

@ -1,5 +1,5 @@
/* /*
* $Id: types.h 279 2008-07-21 05:27:34Z baconevi $ * $Id: types.h 281 2008-07-21 14:11:04Z baconevi $
* *
* {License} * {License}
*/ */
@ -270,6 +270,12 @@ typedef int ase_mcint_t;
typedef int ase_wchar_t; typedef int ase_wchar_t;
#endif #endif
typedef int ase_wcint_t; typedef int ase_wcint_t;
#elif defined(__linux) && (ASE_SIZEOF_INT == 4)
typedef int ase_wchar_t;
typedef int ase_wcint_t;
#elif defined(__linux) && (ASE_SIZEOF_LONG == 4)
typedef long ase_wchar_t;
typedef long ase_wcint_t;
#elif ASE_SIZEOF_LONG == 4 #elif ASE_SIZEOF_LONG == 4
typedef long ase_wchar_t; typedef long ase_wchar_t;
typedef long ase_wcint_t; typedef long ase_wcint_t;