Debut portage Cray T3E
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1992 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
19d79cd6ac
commit
840152fd2d
|
@ -38,7 +38,7 @@ struct lexing_table {
|
|||
value lex_check;
|
||||
};
|
||||
|
||||
#ifdef ARCH_BIG_ENDIAN
|
||||
#if defined(ARCH_BIG_ENDIAN) || SIZEOF_SHORT != 2
|
||||
#define Short(tbl,n) \
|
||||
(*((unsigned char *)((tbl) + (n) * 2)) + \
|
||||
(*((schar *)((tbl) + (n) * 2 + 1)) << 8))
|
||||
|
|
|
@ -55,8 +55,16 @@ typedef unsigned int tag_t; /* Actually, an unsigned char */
|
|||
typedef unsigned long color_t;
|
||||
typedef unsigned long mark_t;
|
||||
|
||||
typedef int int32; /* Not portable, but checked by autoconf. */
|
||||
typedef unsigned int uint32; /* Seems like a reasonable assumption anyway. */
|
||||
#if SIZEOF_INT == 4
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
#elif SIZEOF_LONG == 4
|
||||
typedef long int32;
|
||||
typedef unsigned long uint32;
|
||||
#elif SIZEOF_SHORT == 4
|
||||
typedef short int32;
|
||||
typedef unsigned short uint32;
|
||||
#endif
|
||||
|
||||
/* Longs vs blocks. */
|
||||
#define Is_long(x) (((x) & 1) != 0)
|
||||
|
|
|
@ -57,7 +57,7 @@ struct parser_env { /* Mirrors parser_env in ../stdlib/parsing.ml */
|
|||
value errflag;
|
||||
};
|
||||
|
||||
#ifdef ARCH_BIG_ENDIAN
|
||||
#if defined(ARCH_BIG_ENDIAN) || SIZEOF_SHORT != 2
|
||||
#define Short(tbl,n) \
|
||||
(*((unsigned char *)((tbl) + (n) * 2)) + \
|
||||
(*((schar *)((tbl) + (n) * 2 + 1)) << 8))
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("%d %d %d\n", sizeof(int), sizeof(long), sizeof(long *));
|
||||
printf("%d %d %d %d\n",
|
||||
sizeof(int), sizeof(long), sizeof(long *), sizeof(short));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -39,3 +39,10 @@
|
|||
/* Define ARCH_CODE32 if, on a 64-bit machine, code pointers fit in 32 bits,
|
||||
i.e. the code segment resides in the low 4G of the addressing space.
|
||||
ARCH_CODE32 is ignored on 32-bit machines. */
|
||||
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* Define SIZEOF_INT, SIZEOF_LONG and SIZEOF_SHORT to the sizes in byte
|
||||
of the C types "int", "long" and "short", respectively. */
|
||||
|
|
|
@ -187,32 +187,37 @@ esac
|
|||
|
||||
echo "Checking the sizes of integers and pointers..."
|
||||
set `sh ./runtest sizes.c`
|
||||
case "$1,$2,$3" in
|
||||
4,4,4) echo "OK, this is a regular 32 bit architecture."
|
||||
echo "#undef ARCH_SIXTYFOUR" >> m.h;;
|
||||
4,8,8) echo "Wow! A 64 bit architecture!"
|
||||
echo "#define ARCH_SIXTYFOUR" >> m.h
|
||||
case "$bytecc,$host" in
|
||||
gcc,alpha-*-osf*) echo "#define ARCH_CODE32" >> m.h;;
|
||||
*) echo "#undef ARCH_CODE32" >> m.h;;
|
||||
esac;;
|
||||
8,*,*) echo "Wow! A 64 bit architecture!"
|
||||
echo "Unfortunately, Objective Caml does not handle the case"
|
||||
echo "sizeof(int) = 8."
|
||||
echo "Objective Caml won't run on this architecture."
|
||||
exit 2;;
|
||||
*,*,8) echo "Wow! A 64 bit architecture!"
|
||||
echo "Unfortunately, Objective Caml cannot work in the case"
|
||||
echo "sizeof(long) != sizeof(long *)."
|
||||
echo "Objective Caml won't run on this architecture."
|
||||
exit 2;;
|
||||
*,*,*) echo "This architecture seems to be neither 32 bits nor 64 bits."
|
||||
echo "Objective Caml won't run on this architecture."
|
||||
exit 2;;
|
||||
*) echo "Unable to compile the test program."
|
||||
echo "Make sure the C compiler $cc is properly installed."
|
||||
exit 2;;
|
||||
case "$2,$3" in
|
||||
4,4) echo "OK, this is a regular 32 bit architecture."
|
||||
echo "#undef ARCH_SIXTYFOUR" >> m.h;;
|
||||
8,8) echo "Wow! A 64 bit architecture!"
|
||||
echo "#define ARCH_SIXTYFOUR" >> m.h
|
||||
case "$bytecc,$host" in
|
||||
gcc,alpha-*-osf*) echo "#define ARCH_CODE32" >> m.h;;
|
||||
*) echo "#undef ARCH_CODE32" >> m.h;;
|
||||
esac;;
|
||||
*,8) echo "Wow! A 64 bit architecture!"
|
||||
echo "Unfortunately, Objective Caml cannot work in the case"
|
||||
echo "sizeof(long) != sizeof(long *)."
|
||||
echo "Objective Caml won't run on this architecture."
|
||||
exit 2;;
|
||||
*,*) echo "This architecture seems to be neither 32 bits nor 64 bits."
|
||||
echo "Objective Caml won't run on this architecture."
|
||||
exit 2;;
|
||||
*) echo "Unable to compile the test program."
|
||||
echo "Make sure the C compiler $cc is properly installed."
|
||||
exit 2;;
|
||||
esac
|
||||
if test $1 != 4 && test $2 != 4 && test $4 != 4; then
|
||||
echo "Sorry, we can't find a 32-bit integer type"
|
||||
echo "(sizeof(short) = $4, sizeof(int) = $1, sizeof(long) = $2)"
|
||||
echo "Objective Caml won't run on this architecture."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "#define SIZEOF_INT $1" >> m.h
|
||||
echo "#define SIZEOF_LONG $2" >> m.h
|
||||
echo "#define SIZEOF_SHORT $4" >> m.h
|
||||
|
||||
# Determine endianness
|
||||
|
||||
|
|
Loading…
Reference in New Issue