summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2016-08-25 09:28:59 +0100
committerChris Liddell <chris.liddell@artifex.com>2018-01-26 08:29:13 +0000
commitb82848bc26f47b5b5727d24f03d08eb3679c7243 (patch)
treea4d45eb9b02f7c33e56162adacf0d96fb5f6922e /ios
parent83f78ff2c85413866f0d4e549fc6a39aa72417e6 (diff)
downloadghostpdl-b82848bc26f47b5b5727d24f03d08eb3679c7243.tar.gz
Add script and arch*.h headers for ios build
This results in a "fat" libgs.a library which can be linked used either for the simulator or a "real" ios build. Really, this script just automates/simplifies the process of using our existing cross-compile support. The only slightly out of the ordinary part is combining the Intel and arm libraries into the single fat library.
Diffstat (limited to 'ios')
-rwxr-xr-xios/build_ios_gslib.sh54
-rw-r--r--ios/ios-README.txt12
-rw-r--r--ios/ios_arch-arm.h266
-rw-r--r--ios/ios_arch-x86.h183
4 files changed, 515 insertions, 0 deletions
diff --git a/ios/build_ios_gslib.sh b/ios/build_ios_gslib.sh
new file mode 100755
index 000000000..9afa15651
--- /dev/null
+++ b/ios/build_ios_gslib.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+
+if [ $# -gt 1 ]; then
+ echo "Usage: build_ios_gslib.sh [debug]"
+ exit
+fi
+
+if [ $# -eq 1 ]; then
+ if test x"$1" = x"debug"; then
+ DEBUGSTR=debug
+ fi
+fi
+
+startdir="$PWD"
+
+cd ..
+
+if [ ! -x ./configure ] ; then
+ ./autogen.sh --help
+fi
+
+export CC="$(xcrun --sdk iphonesimulator --find cc)"
+export CPP="$(xcrun --sdk iphonesimulator --find cpp)"
+export RANLIB="$(xcrun --sdk iphonesimulator --find ranlib)"
+export CFLAGS=" -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -Wno-implicit-function-declaration -arch x86_64 -arch i386"
+
+export BIGENDIAN=0
+export CCAUX=/usr/bin/gcc
+export CFLAGSAUX=" "
+
+./configure --without-x --with-arch_h=./ios/ios_arch-x86.h --host=x86_64-apple-darwin7 --build=x86_64-linux-gnu 2>&1 | tee conflog_x86.txt || exit 1
+
+make -j4 BUILDDIRPREFIX=ios_x86- GS=libgs_x86 libgs$DEBUGSTR 2>&1 | tee buildlog_x86.txt || exit 1
+
+mv Makefile Makefile.x86
+
+export CC="$(xcrun --sdk iphoneos --find cc)"
+export CPP="$(xcrun --sdk iphoneos --find cpp)"
+export CFLAGS=" -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -Wno-implicit-function-declaration -arch armv7 -arch armv7s -arch arm64"
+export RANLIB="$(xcrun --sdk iphoneos --find ranlib)"
+
+./configure --without-x --with-arch_h=./ios/ios_arch-arm.h --host=armv7-apple-darwin7 --build=x86_64-linux-gnu 2>&1 | tee conflog_arm.txt || exit 1
+
+make -j4 BUILDDIRPREFIX=ios_arm- GS=libgs_arm libgs$DEBUGSTR 2>&1 | tee buildlog_arm.txt || exit 1
+
+mv Makefile Makefile.arm
+
+cd $startdir
+
+export LIPO="$(xcrun --sdk iphoneos --find lipo)"
+
+xcrun lipo -output libgs.a -create ../ios_x86-"$DEBUGSTR"bin/libgs_x86.a ../ios_arm-"$DEBUGSTR"bin/libgs_arm.a 2>&1 | tee buildlog_uni.txt || exit 1
+
diff --git a/ios/ios-README.txt b/ios/ios-README.txt
new file mode 100644
index 000000000..f038bb192
--- /dev/null
+++ b/ios/ios-README.txt
@@ -0,0 +1,12 @@
+To build a combined armv7/arm64/i386/x86_64 Ghostscript static library for ios,
+in the ghostpdl/ios directory, run the "build_ios_gslib.sh".
+
+That script will run autogen.sh if required (if configure does not already
+exist), then call configure with the required options, and then make, first
+to build for x86_64/i386 then for armv7/arm64.
+
+The two separate builds end up in ghostpdl/ios_x86-bin and ios_arm-bin
+respectively.
+
+The script then uses the lipo utility to combine the two static library
+files into a single "fat" binary, which lands in ghostpdl/ios/libgs.a
diff --git a/ios/ios_arch-arm.h b/ios/ios_arch-arm.h
new file mode 100644
index 000000000..d7d951c77
--- /dev/null
+++ b/ios/ios_arch-arm.h
@@ -0,0 +1,266 @@
+/* Copyright (C) 2001-2012 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+ CA 94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+#ifdef __ARM64_ARCH_8__
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_LOG2_SIZEOF_PTR 3
+#define ARCH_LOG2_SIZEOF_FLOAT 2
+#define ARCH_LOG2_SIZEOF_DOUBLE 3
+
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)~(unsigned char)0 + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)~(unsigned short)0 + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Floating point ---------------- */
+
+#ifndef FLOATS_ARE_IEEE
+
+#if defined(__STDC_IEC_559__) && __STDC_IEC_559__!=0
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(FLT_RADIX) && FLT_RADIX == 2) && (defined(FLT_MANT_DIG) && FLT_MANT_DIG == 24) \
+ && (defined(FLT_MIN_EXP) && FLT_MIN_EXP == -125) && (defined(FLT_MAX_EXP) && FLT_MAX_EXP == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(__FLT_RADIX__) && __FLT_RADIX__ == 2) && (defined(__FLT_MANT_DIG__) && __FLT_MANT_DIG__ == 24) \
+ && (defined(__FLT_MIN_EXP__) && __FLT_MIN_EXP__ == -125) && (defined(__FLT_MAX_EXP__) && __FLT_MAX_EXP__ == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#else
+
+# define FLOATS_ARE_IEEE 0
+
+#endif
+
+#endif /* FLOATS_ARE_IEEE */
+
+
+#if FLOATS_ARE_IEEE == 1
+# define ARCH_FLOATS_ARE_IEEE 1
+# define ARCH_FLOAT_MANTISSA_BITS 24
+# define ARCH_DOUBLE_MANTISSA_BITS 53
+#else /* FLOATS_ARE_IEEE*/
+# define ARCH_FLOATS_ARE_IEEE 0
+/*
+ * There isn't any general way to compute the number of mantissa
+ * bits accurately, especially if the machine uses hex rather
+ * than binary exponents. Use conservative values, assuming
+ * the exponent is stored in a 16-bit word of its own.
+ */
+# define ARCH_FLOAT_MANTISSA_BITS (sizeof(float) * 8 - 17)
+# define ARCH_DOUBLE_MANTISSA_BITS (sizeof(double) * 8 - 17)
+#endif /* FLOATS_ARE_IEEE*/
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+
+#elif defined(__ARM_ARCH_7S__) /* __ARM64_ARCH_8__ */
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_LOG2_SIZEOF_PTR 2
+#define ARCH_LOG2_SIZEOF_FLOAT 2
+#define ARCH_LOG2_SIZEOF_DOUBLE 3
+
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)~(unsigned char)0 + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)~(unsigned short)0 + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Floating point ---------------- */
+
+#ifndef FLOATS_ARE_IEEE
+
+#if defined(__STDC_IEC_559__) && __STDC_IEC_559__!=0
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(FLT_RADIX) && FLT_RADIX == 2) && (defined(FLT_MANT_DIG) && FLT_MANT_DIG == 24) \
+ && (defined(FLT_MIN_EXP) && FLT_MIN_EXP == -125) && (defined(FLT_MAX_EXP) && FLT_MAX_EXP == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(__FLT_RADIX__) && __FLT_RADIX__ == 2) && (defined(__FLT_MANT_DIG__) && __FLT_MANT_DIG__ == 24) \
+ && (defined(__FLT_MIN_EXP__) && __FLT_MIN_EXP__ == -125) && (defined(__FLT_MAX_EXP__) && __FLT_MAX_EXP__ == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#else
+
+# define FLOATS_ARE_IEEE 0
+
+#endif
+
+#endif /* FLOATS_ARE_IEEE */
+
+
+#if FLOATS_ARE_IEEE == 1
+# define ARCH_FLOATS_ARE_IEEE 1
+# define ARCH_FLOAT_MANTISSA_BITS 24
+# define ARCH_DOUBLE_MANTISSA_BITS 53
+#else /* FLOATS_ARE_IEEE*/
+# define ARCH_FLOATS_ARE_IEEE 0
+/*
+ * There isn't any general way to compute the number of mantissa
+ * bits accurately, especially if the machine uses hex rather
+ * than binary exponents. Use conservative values, assuming
+ * the exponent is stored in a 16-bit word of its own.
+ */
+# define ARCH_FLOAT_MANTISSA_BITS (sizeof(float) * 8 - 17)
+# define ARCH_DOUBLE_MANTISSA_BITS (sizeof(double) * 8 - 17)
+#endif /* FLOATS_ARE_IEEE*/
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+
+#else /* __ARM_ARCH_7S__ */
+/* __ARM_ARCH_7A__ */
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_LOG2_SIZEOF_PTR 2
+#define ARCH_LOG2_SIZEOF_FLOAT 2
+#define ARCH_LOG2_SIZEOF_DOUBLE 3
+
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)~(unsigned char)0 + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)~(unsigned short)0 + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Floating point ---------------- */
+
+#ifndef FLOATS_ARE_IEEE
+
+#if defined(__STDC_IEC_559__) && __STDC_IEC_559__!=0
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(FLT_RADIX) && FLT_RADIX == 2) && (defined(FLT_MANT_DIG) && FLT_MANT_DIG == 24) \
+ && (defined(FLT_MIN_EXP) && FLT_MIN_EXP == -125) && (defined(FLT_MAX_EXP) && FLT_MAX_EXP == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(__FLT_RADIX__) && __FLT_RADIX__ == 2) && (defined(__FLT_MANT_DIG__) && __FLT_MANT_DIG__ == 24) \
+ && (defined(__FLT_MIN_EXP__) && __FLT_MIN_EXP__ == -125) && (defined(__FLT_MAX_EXP__) && __FLT_MAX_EXP__ == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#else
+
+# define FLOATS_ARE_IEEE 0
+
+#endif
+
+#endif /* FLOATS_ARE_IEEE */
+
+
+#if FLOATS_ARE_IEEE == 1
+# define ARCH_FLOATS_ARE_IEEE 1
+# define ARCH_FLOAT_MANTISSA_BITS 24
+# define ARCH_DOUBLE_MANTISSA_BITS 53
+#else /* FLOATS_ARE_IEEE*/
+# define ARCH_FLOATS_ARE_IEEE 0
+/*
+ * There isn't any general way to compute the number of mantissa
+ * bits accurately, especially if the machine uses hex rather
+ * than binary exponents. Use conservative values, assuming
+ * the exponent is stored in a 16-bit word of its own.
+ */
+# define ARCH_FLOAT_MANTISSA_BITS (sizeof(float) * 8 - 17)
+# define ARCH_DOUBLE_MANTISSA_BITS (sizeof(double) * 8 - 17)
+#endif /* FLOATS_ARE_IEEE*/
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+
+#endif /* __ARM_ARCH_7A__ */
diff --git a/ios/ios_arch-x86.h b/ios/ios_arch-x86.h
new file mode 100644
index 000000000..a27d857ff
--- /dev/null
+++ b/ios/ios_arch-x86.h
@@ -0,0 +1,183 @@
+/* Copyright (C) 2001-2012 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+ CA 94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+#if __x86_64__ == 1
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_LOG2_SIZEOF_PTR 3
+#define ARCH_LOG2_SIZEOF_FLOAT 2
+#define ARCH_LOG2_SIZEOF_DOUBLE 3
+
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)~(unsigned char)0 + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)~(unsigned short)0 + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Floating point ---------------- */
+
+#ifndef FLOATS_ARE_IEEE
+
+#if defined(__STDC_IEC_559__) && __STDC_IEC_559__!=0
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(FLT_RADIX) && FLT_RADIX == 2) && (defined(FLT_MANT_DIG) && FLT_MANT_DIG == 24) \
+ && (defined(FLT_MIN_EXP) && FLT_MIN_EXP == -125) && (defined(FLT_MAX_EXP) && FLT_MAX_EXP == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(__FLT_RADIX__) && __FLT_RADIX__ == 2) && (defined(__FLT_MANT_DIG__) && __FLT_MANT_DIG__ == 24) \
+ && (defined(__FLT_MIN_EXP__) && __FLT_MIN_EXP__ == -125) && (defined(__FLT_MAX_EXP__) && __FLT_MAX_EXP__ == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#else
+
+# define FLOATS_ARE_IEEE 0
+
+#endif
+
+#endif /* FLOATS_ARE_IEEE */
+
+
+#if FLOATS_ARE_IEEE == 1
+# define ARCH_FLOATS_ARE_IEEE 1
+# define ARCH_FLOAT_MANTISSA_BITS 24
+# define ARCH_DOUBLE_MANTISSA_BITS 53
+#else /* FLOATS_ARE_IEEE*/
+# define ARCH_FLOATS_ARE_IEEE 0
+/*
+ * There isn't any general way to compute the number of mantissa
+ * bits accurately, especially if the machine uses hex rather
+ * than binary exponents. Use conservative values, assuming
+ * the exponent is stored in a 16-bit word of its own.
+ */
+# define ARCH_FLOAT_MANTISSA_BITS (sizeof(float) * 8 - 17)
+# define ARCH_DOUBLE_MANTISSA_BITS (sizeof(double) * 8 - 17)
+#endif /* FLOATS_ARE_IEEE*/
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+
+#elif __i386__ == 1 /* __x86_64__ */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_LOG2_SIZEOF_PTR 2
+#define ARCH_LOG2_SIZEOF_FLOAT 2
+#define ARCH_LOG2_SIZEOF_DOUBLE 3
+
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)~(unsigned char)0 + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)~(unsigned short)0 + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Floating point ---------------- */
+
+#ifndef FLOATS_ARE_IEEE
+
+#if defined(__STDC_IEC_559__) && __STDC_IEC_559__!=0
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(FLT_RADIX) && FLT_RADIX == 2) && (defined(FLT_MANT_DIG) && FLT_MANT_DIG == 24) \
+ && (defined(FLT_MIN_EXP) && FLT_MIN_EXP == -125) && (defined(FLT_MAX_EXP) && FLT_MAX_EXP == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#elif (defined(__FLT_RADIX__) && __FLT_RADIX__ == 2) && (defined(__FLT_MANT_DIG__) && __FLT_MANT_DIG__ == 24) \
+ && (defined(__FLT_MIN_EXP__) && __FLT_MIN_EXP__ == -125) && (defined(__FLT_MAX_EXP__) && __FLT_MAX_EXP__ == 128)
+
+# define FLOATS_ARE_IEEE 1
+
+#else
+
+# define FLOATS_ARE_IEEE 0
+
+#endif
+
+#endif /* FLOATS_ARE_IEEE */
+
+
+#if FLOATS_ARE_IEEE == 1
+# define ARCH_FLOATS_ARE_IEEE 1
+# define ARCH_FLOAT_MANTISSA_BITS 24
+# define ARCH_DOUBLE_MANTISSA_BITS 53
+#else /* FLOATS_ARE_IEEE*/
+# define ARCH_FLOATS_ARE_IEEE 0
+/*
+ * There isn't any general way to compute the number of mantissa
+ * bits accurately, especially if the machine uses hex rather
+ * than binary exponents. Use conservative values, assuming
+ * the exponent is stored in a 16-bit word of its own.
+ */
+# define ARCH_FLOAT_MANTISSA_BITS (sizeof(float) * 8 - 17)
+# define ARCH_DOUBLE_MANTISSA_BITS (sizeof(double) * 8 - 17)
+#endif /* FLOATS_ARE_IEEE*/
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+
+#endif /* __i386__ */