summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2016-01-25 10:59:23 +0000
committerChris Liddell <chris.liddell@artifex.com>2016-10-21 15:35:19 +0100
commitc3c4bf022a631be939ebb4bf6f59e41514cb1e48 (patch)
tree357d89915f8284818673570e58a200846dab0c11 /arch
parent0845a1c90f7a22a5b50fddbf7809d985b98290cd (diff)
downloadghostpdl-c3c4bf022a631be939ebb4bf6f59e41514cb1e48.tar.gz
Bug 696508: improve configure cross compile support
This is a squashing of the commits on the branch: CCAUX-configure This allows CCAUX and related settings to be set on the configure command line, or in the environment. Also, using configure to guess at creating an arch.h file which gets used rather than genarch generating one. A couple of things in that file will not be as accurate as using genarch, but those are rare, and almost certainly for outdated systems (such as whether floats use IEEE representation). Better documentation to follow, but as an example, building for Android would work with: ./configure --host=arm-linux-gnu --build=x86_64-linux-gnu \ CC=/opt/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc \ CFLAGS="--sysroot=/home/cliddell/bin/android-ndk-r10e/platforms/android-18/arch-arm -MMD -MP -MF -fpic \ -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp \ -mfpu=vfpv3-d16 -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstack" LDFLAGS=" \ --sysroot=/home/cliddell/bin/android-ndk-r10e/platforms/android-18/arch-arm -MMD -MP -MF -fpic -ffunction-sections \ -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb \ -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstack" CCAUX=gcc CFLAGSAUX=" "
Diffstat (limited to 'arch')
-rw-r--r--arch/arch_autoconf.h.in97
1 files changed, 97 insertions, 0 deletions
diff --git a/arch/arch_autoconf.h.in b/arch/arch_autoconf.h.in
new file mode 100644
index 000000000..7d0c8d4e7
--- /dev/null
+++ b/arch/arch_autoconf.h.in
@@ -0,0 +1,97 @@
+/* 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.
+*/
+
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD @ARCH_ALIGN_SHORT_MOD@
+#define ARCH_ALIGN_INT_MOD @ARCH_ALIGN_INT_MOD@
+#define ARCH_ALIGN_LONG_MOD @ARCH_ALIGN_LONG_MOD@
+#define ARCH_ALIGN_PTR_MOD @ARCH_ALIGN_PTR_MOD@
+#define ARCH_ALIGN_FLOAT_MOD @ARCH_ALIGN_FLOAT_MOD@
+#define ARCH_ALIGN_DOUBLE_MOD @ARCH_ALIGN_DOUBLE_MOD@
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR @ARCH_LOG2_SIZEOF_CHAR@
+#define ARCH_LOG2_SIZEOF_SHORT @ARCH_LOG2_SIZEOF_SHORT@
+#define ARCH_LOG2_SIZEOF_INT @ARCH_LOG2_SIZEOF_INT@
+#define ARCH_LOG2_SIZEOF_LONG @ARCH_LOG2_SIZEOF_LONG@
+#define ARCH_LOG2_SIZEOF_LONG_LONG @ARCH_LOG2_SIZEOF_LONG_LONG@
+#define ARCH_LOG2_SIZEOF_PTR @ARCH_LOG2_SIZEOF_PTR@
+#define ARCH_LOG2_SIZEOF_FLOAT @ARCH_LOG2_SIZEOF_FLOAT@
+#define ARCH_LOG2_SIZEOF_DOUBLE @ARCH_LOG2_SIZEOF_DOUBLE@
+
+#define ARCH_SIZEOF_PTR @ARCH_SIZEOF_PTR@
+#define ARCH_SIZEOF_FLOAT @ARCH_SIZEOF_FLOAT@
+#define ARCH_SIZEOF_DOUBLE @ARCH_SIZEOF_DOUBLE@
+
+ /* ---------------- 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 @ARCH_IS_BIG_ENDIAN@
+#define ARCH_PTRS_ARE_SIGNED @ARCH_PTRS_ARE_SIGNED@
+#define ARCH_DIV_NEG_POS_TRUNCATES @ARCH_DIV_NEG_POS_TRUNCATES@
+#define ARCH_ARITH_RSHIFT @ARCH_ARITH_RSHIFT@
+#define ARCH_SIZEOF_GX_COLOR_INDEX @ARCH_SIZEOF_GX_COLOR_INDEX@