Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pcc provide endian information at build time ra...



details:   https://anonhg.NetBSD.org/src/rev/5fa02b92efed
branches:  trunk
changeset: 752025:5fa02b92efed
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Feb 11 14:18:45 2010 +0000

description:
provide endian information at build time rather than embedding it
in the config.h file.

diffstat:

 external/bsd/pcc/Makefile.inc |  17 ++++++++++++++++-
 external/bsd/pcc/config.h     |   9 ---------
 2 files changed, 16 insertions(+), 10 deletions(-)

diffs (47 lines):

diff -r 1b04d6c03838 -r 5fa02b92efed external/bsd/pcc/Makefile.inc
--- a/external/bsd/pcc/Makefile.inc     Thu Feb 11 14:10:22 2010 +0000
+++ b/external/bsd/pcc/Makefile.inc     Thu Feb 11 14:18:45 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.7 2010/02/05 18:41:25 plunky Exp $
+#      $NetBSD: Makefile.inc,v 1.8 2010/02/11 14:18:45 plunky Exp $
 
 PCC_DIR:=${.PARSEDIR}
 PCC_DIST=${PCC_DIR}/dist/pcc
@@ -30,6 +30,21 @@
 CPPFLAGS+=     -Dmach_${TARGMACH}
 CPPFLAGS+=     -I${PCC_DIR}
 
+.include <bsd.endian.mk>
+
+# We only build binaries from here where the pcc host and target architectures
+# will be the same. For a cross-compiler, use the tools/pcc build.
+#
+.if ${TARGET_ENDIANNESS} == "1234"
+CPPFLAGS+=     -DHOST_LITTLE_ENDIAN
+CPPFLAGS+=     -DTARGET_LITTLE_ENDIAN
+.elif ${TARGET_ENDIANNESS} == "4321"
+CPPFLAGS+=     -DHOST_BIG_ENDIAN
+CPPFLAGS+=     -DTARGET_BIG_ENDIAN
+.else
+ERROR!= echo "ERROR: Unknown TARGET_ENDIANNESS" >&2;echo
+.endif
+
 .if exists(${.CURDIR}/../../../Makefile.inc)
 .include "${.CURDIR}/../../../Makefile.inc"
 .endif
diff -r 1b04d6c03838 -r 5fa02b92efed external/bsd/pcc/config.h
--- a/external/bsd/pcc/config.h Thu Feb 11 14:10:22 2010 +0000
+++ b/external/bsd/pcc/config.h Thu Feb 11 14:18:45 2010 +0000
@@ -1,12 +1,3 @@
-#include <sys/endian.h>
-#if BYTE_ORDER == BIG_ENDIAN
-#define HOST_BIG_ENDIAN
-#define TARGET_BIG_ENDIAN
-#else
-#define HOST_LITTLE_ENDIAN
-#define TARGET_LITTLE_ENDIAN
-#endif
-
 /* config.h.  Generated by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 



Home | Main Index | Thread Index | Old Index