Module Name: src Committed By: plunky Date: Thu Feb 11 14:18:45 UTC 2010
Modified Files: src/external/bsd/pcc: Makefile.inc config.h Log Message: provide endian information at build time rather than embedding it in the config.h file. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/pcc/Makefile.inc cvs rdiff -u -r1.6 -r1.7 src/external/bsd/pcc/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/pcc/Makefile.inc diff -u src/external/bsd/pcc/Makefile.inc:1.7 src/external/bsd/pcc/Makefile.inc:1.8 --- src/external/bsd/pcc/Makefile.inc:1.7 Fri Feb 5 18:41:25 2010 +++ src/external/bsd/pcc/Makefile.inc Thu Feb 11 14:18:45 2010 @@ -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 Index: src/external/bsd/pcc/config.h diff -u src/external/bsd/pcc/config.h:1.6 src/external/bsd/pcc/config.h:1.7 --- src/external/bsd/pcc/config.h:1.6 Fri Feb 5 17:18:31 2010 +++ src/external/bsd/pcc/config.h Thu Feb 11 14:18:45 2010 @@ -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. */