Module Name:    src
Committed By:   plunky
Date:           Thu Jun  3 19:17:22 UTC 2010

Modified Files:
        src/external/bsd/pcc: Makefile.inc
        src/external/bsd/pcc/include: config.h
        src/external/bsd/pcc/libexec/ccom: Makefile
        src/external/bsd/pcc/libexec/cpp: Makefile
        src/external/bsd/pcc/usr.bin/pcc: Makefile
Added Files:
        src/external/bsd/pcc: prepare-import.sh

Log Message:
apply build framework and config changes for pcc-100602, plus add a
prepare-import.sh script for future updates


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/pcc/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/bsd/pcc/prepare-import.sh
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pcc/include/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/pcc/libexec/ccom/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/pcc/libexec/cpp/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pcc/usr.bin/pcc/Makefile

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.10 src/external/bsd/pcc/Makefile.inc:1.11
--- src/external/bsd/pcc/Makefile.inc:1.10	Thu Feb 11 14:36:32 2010
+++ src/external/bsd/pcc/Makefile.inc	Thu Jun  3 19:17:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2010/02/11 14:36:32 plunky Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2010/06/03 19:17:22 plunky Exp $
 
 PCC_DIR:=${.PARSEDIR}
 PCC_DIST=${PCC_DIR}/dist/pcc
@@ -23,6 +23,7 @@
 libexecdir = /usr/libexec
 includedir = /usr/include
 
+CPPFLAGS+=	-DGCC_COMPAT
 CPPFLAGS+=	-DVERSSTR=${VERSSTR:Q}
 CPPFLAGS+=	-DLIBEXECDIR=\"${libexecdir}/\"
 CPPFLAGS+=	-DINCLUDEDIR=\"${includedir}/\"

Index: src/external/bsd/pcc/include/config.h
diff -u src/external/bsd/pcc/include/config.h:1.2 src/external/bsd/pcc/include/config.h:1.3
--- src/external/bsd/pcc/include/config.h:1.2	Sun Mar  7 16:27:18 2010
+++ src/external/bsd/pcc/include/config.h	Thu Jun  3 19:17:22 2010
@@ -1,4 +1,4 @@
-/* config.h.  Generated by configure.  */
+/* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Using a.out ABI */
@@ -13,30 +13,15 @@
 /* Using COFF ABI */
 /* #undef COFFABI */
 
-/* Define path to alternate preprocessor */
+/* Define path to alternate compiler */
 /* #undef COMPILER */
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define to 1 if using `alloca.c'. */
-/* #undef C_ALLOCA */
-
 /* Using ECOFF ABI */
 /* #undef ECOFFABI */
 
 /* Using ELF ABI */
 #define ELFABI 
 
-/* Define to 1 if you have `alloca', as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-/* #undef HAVE_ALLOCA_H */
-
 /* Define to 1 if you have the `basename' function. */
 #define HAVE_BASENAME 1
 
@@ -59,7 +44,7 @@
 #define HAVE_LIBGEN_H 1
 
 /* Define to 1 if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
+#define HAVE_MALLOC_H 1
 
 /* Define to 1 if you have the <memory.h> header file. */
 #define HAVE_MEMORY_H 1
@@ -88,6 +73,9 @@
 /* Define to 1 if you have the `strlcpy' function. */
 #define HAVE_STRLCPY 1
 
+/* Define to 1 if you have the `strtold' function. */
+#define HAVE_STRTOLD 1
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H 1
 
@@ -100,14 +88,17 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
 
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
 /* Define to 1 if you have the `vsnprintf' function. */
 #define HAVE_VSNPRINTF 1
 
 /* Define if host is BIG endian */
-/* #define HOST_BIG_ENDIAN */
+/* #undef HOST_BIG_ENDIAN */
 
 /* Define if host is LITTLE endian */
-/* #undef HOST_LITTLE_ENDIAN */
+/* #define HOST_LITTLE_ENDIAN  */
 
 /* lex is flex */
 #define ISFLEX 1
@@ -116,7 +107,7 @@
 /* #undef LIBDIR */
 
 /* Define path to alternate linker */
-/* #undefine LINKER */
+/* #undef LINKER */
 
 /* Using Mach-O ABI */
 /* #undef MACHOABI */
@@ -128,7 +119,7 @@
 #define PACKAGE_NAME "pcc"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "pcc 0.9.9 [20090902]"
+#define PACKAGE_STRING "pcc 0.9.9 [20100603]"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "pcc"
@@ -151,14 +142,6 @@
 /* Define path to alternate preprocessor */
 #define PREPROCESSOR "pcpp"
 
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
-	STACK_DIRECTION > 0 => grows toward higher addresses
-	STACK_DIRECTION < 0 => grows toward lower addresses
-	STACK_DIRECTION = 0 => direction of growth unknown */
-/* #undef STACK_DIRECTION */
-
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
@@ -174,18 +157,21 @@
 /* Target OS */
 #define TARGOS netbsd
 
+/* Target OS version */
+#define TARGOSVER 5
+
 /* Enable thread-local storage (TLS). */
 /* #undef TLS */
 
 /* Version string */
-/* #define VERSSTR "pcc 0.9.9 for i386-pc-netbsdelf, g...@sparky Wed Aug 13 22:19:18 EST 2008" */
+/* #define VERSSTR "pcc 0.9.9 for i386-unknown-netbsdelf5.99.29, plu...@galant Thu Jun  3 19:37:55 BST 2010" */
 
 /* Size of wide character type */
 #define WCHAR_SIZE 4
 
 /* Type to use for wide characters */
-#define WCHAR_TYPE UNSIGNED
+#define WCHAR_TYPE INT
 
 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
    `char[]'. */
-#define YYTEXT_POINTER 1
+/* #undef YYTEXT_POINTER */

Index: src/external/bsd/pcc/libexec/ccom/Makefile
diff -u src/external/bsd/pcc/libexec/ccom/Makefile:1.5 src/external/bsd/pcc/libexec/ccom/Makefile:1.6
--- src/external/bsd/pcc/libexec/ccom/Makefile:1.5	Fri Feb  5 08:37:48 2010
+++ src/external/bsd/pcc/libexec/ccom/Makefile	Thu Jun  3 19:17:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2010/02/05 08:37:48 plunky Exp $
+#	$NetBSD: Makefile,v 1.6 2010/06/03 19:17:22 plunky Exp $
 
 WARNS?=	2
 
@@ -13,7 +13,7 @@
 SRCS=   cgram.y
 SRCS+=	scan.l
 SRCS+=	optim.c pftn.c trees.c inline.c symtabs.c
-SRCS+=	gcc_compat.c init.c local.c code.c stabs.c
+SRCS+=	gcc_compat.c init.c local.c code.c stabs.c builtins.c
 SRCS+=	match.c reader.c optim2.c regs.c local2.c order.c table.c
 SRCS+=	common.c main.c external.c
 
@@ -23,17 +23,12 @@
 YHEADER=
 
 CPPFLAGS+=	-DPCC_DEBUG
-CPPFLAGS+=	-DGCC_COMPAT
 CPPFLAGS+=	-I${.OBJDIR}
 CPPFLAGS+=	-I${PCC_DIST}/mip
 CPPFLAGS+=	-I${PCC_DIST}/os/${TARGOS}
 CPPFLAGS+=	-I${PCC_DIST}/arch/${TARGMACH}
 CPPFLAGS+=	-I${PCC_DIST}/cc/ccom
 
-COPTS.scan.c+= -Wno-error
-COPTS.cgram.c+=-Wno-uninitialized
-COPTS.local.c+=-Wno-unused
-
 DPSRCS=	external.c external.h
 
 external.c external.h: mkext.c table.c common.c

Index: src/external/bsd/pcc/libexec/cpp/Makefile
diff -u src/external/bsd/pcc/libexec/cpp/Makefile:1.7 src/external/bsd/pcc/libexec/cpp/Makefile:1.8
--- src/external/bsd/pcc/libexec/cpp/Makefile:1.7	Sun Mar  7 16:27:18 2010
+++ src/external/bsd/pcc/libexec/cpp/Makefile	Thu Jun  3 19:17:22 2010
@@ -1,6 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2010/03/07 16:27:18 plunky Exp $
-
-WARNS?=	2
+#	$NetBSD: Makefile,v 1.8 2010/06/03 19:17:22 plunky Exp $
 
 .include <bsd.init.mk>
 

Index: src/external/bsd/pcc/usr.bin/pcc/Makefile
diff -u src/external/bsd/pcc/usr.bin/pcc/Makefile:1.4 src/external/bsd/pcc/usr.bin/pcc/Makefile:1.5
--- src/external/bsd/pcc/usr.bin/pcc/Makefile:1.4	Sun Mar  7 12:05:09 2010
+++ src/external/bsd/pcc/usr.bin/pcc/Makefile	Thu Jun  3 19:17:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2010/03/07 12:05:09 plunky Exp $
+#	$NetBSD: Makefile,v 1.5 2010/06/03 19:17:22 plunky Exp $
 
 WARNS?=	2
 
@@ -20,6 +20,7 @@
 pcc.1:	cc.1
 	${TOOL_SED} -e "s,Nm cc,Nm pcc,"	\
 		    -e "s,Dt CC,Dt PCC,"	\
+		    -e "s,Xr cpp,Xr pcpp,"	\
 		    ${.ALLSRC} > ${.TARGET}
 
 CLEANFILES+=	pcc.1

Added files:

Index: src/external/bsd/pcc/prepare-import.sh
diff -u /dev/null src/external/bsd/pcc/prepare-import.sh:1.1
--- /dev/null	Thu Jun  3 19:17:22 2010
+++ src/external/bsd/pcc/prepare-import.sh	Thu Jun  3 19:17:22 2010
@@ -0,0 +1,82 @@
+#!/bin/sh -x
+#
+#	prepare pcc distribution for import
+#
+# pcc can be built as part of the toolchain by setting
+#
+#	HAVE_PCC=yes
+#
+# and as a native binary for a release build by setting
+#
+#	MKPCC=yes
+#	MKPCCCMDS=yes
+#
+
+#
+# TODO
+# - some files only have NetBSD tags to start with, they end up with none
+
+set -e
+
+if [ ! -d work -o ! -d work/pcc -o ! -d work/pcc-libs ]; then
+	echo "checkout or unpack pcc and pcc-libs to work/ first, eg"
+	echo ""
+	echo "    cvs -d :pserver:[email protected]:/cvsroot -f checkout -P -d work -N pcc pcc-libs"
+	echo ""
+	exit 1
+fi
+
+echo "====> Removing pcc CVS directories..."
+find work -type d -name CVS | xargs rm -Rf
+
+echo "====> Fixing file and directory permissions..."
+find work -type d -exec chmod u=rwx,go=rx {} \;
+find work -type f -exec chmod u=rw,go=r {} \;
+
+echo "====> Fixing RCS tags..."
+# fix existing RCS tags, and insert blank NetBSD tags
+for f in $(grep -RL '\$(NetBSD|Id).*\$' work); do
+    sed -e '/\$NetBSD\$/d'				\
+	-e 's,\$\(NetBSD[[:>:]].*\)\$,\1,'		\
+	-e 's,\(.*\)\$\(Id[[:>:]].*\)\$\(.*\),\1\2\3	\
+\1\$NetBSD\$\3,'					\
+	< ${f} > ${f}_tmp
+    mv ${f}_tmp ${f}
+done
+
+echo "====> Creating pcc \"config.h\" file..."
+mkdir work/tmp
+cd work/tmp
+sh ../pcc/configure
+cd ../..
+#
+# comment out items we provide at build time from Makefile.inc
+# modify the PACKAGE_STRING to include the checkout date
+# define PREPROCESSOR as pcpp to avoid conflicts with GCC
+#
+sed -e "s,^\(#define[[:space:]]*VERSSTR[[:>:]].*\)\$,/* \1 */,"					\
+    -e "s,^\(#define[[:space:]]*HOST_BIG_ENDIAN[[:>:]].*\)\$,/* \1 */,"				\
+    -e "s,^\(#define[[:space:]]*HOST_LITTLE_ENDIAN[[:>:]].*\)\$,/* \1 */,"			\
+    -e "s,^\(#define[[:space:]]*TARGET_BIG_ENDIAN[[:>:]].*\)\$,/* \1 */,"			\
+    -e "s,^\(#define[[:space:]]*TARGET_LITTLE_ENDIAN[[:>:]].*\)\$,/* \1 */,"			\
+    -e "s,^\(#define[[:space:]]*PACKAGE_STRING[[:>:]].*\".*\)\(\".*\)\$,\1 [$(date +%Y%m%d)]\2,"\
+    -e "s,^\(.*[[:<:]]PREPROCESSOR[[:>:]].*\)\$,#define PREPROCESSOR \"pcpp\","			\
+    < work/tmp/config.h > work/config.h
+
+echo "====> Replacing pcc sources..."
+rm -Rf dist/pcc dist/pcc-libs
+mv work/pcc work/pcc-libs dist
+if cmp -s work/config.h include/config.h; then :; else
+    echo "====> Updating include/config.h..."
+    mv work/config.h include/config.h
+fi
+
+echo "====> Done."
+rm -Rf work
+
+echo ""
+echo "after testing, use the following command to import from the dist directory,"
+echo ""
+echo "    cvs import src/external/bsd/pcc/dist ragge pcc-$(date +%y%m%d)"
+echo ""
+echo "providing a ChangeLog in the commit message."

Reply via email to