Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/pcc apply build framework and config changes fo...



details:   https://anonhg.NetBSD.org/src/rev/e95f20606059
branches:  trunk
changeset: 755381:e95f20606059
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Jun 03 19:17:22 2010 +0000

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

diffstat:

 external/bsd/pcc/Makefile.inc          |   3 +-
 external/bsd/pcc/include/config.h      |  52 +++++++-------------
 external/bsd/pcc/libexec/ccom/Makefile |   9 +--
 external/bsd/pcc/libexec/cpp/Makefile  |   4 +-
 external/bsd/pcc/prepare-import.sh     |  82 ++++++++++++++++++++++++++++++++++
 external/bsd/pcc/usr.bin/pcc/Makefile  |   3 +-
 6 files changed, 108 insertions(+), 45 deletions(-)

diffs (truncated from 305 to 300 lines):

diff -r 95a0638ebd52 -r e95f20606059 external/bsd/pcc/Makefile.inc
--- a/external/bsd/pcc/Makefile.inc     Thu Jun 03 19:07:59 2010 +0000
+++ b/external/bsd/pcc/Makefile.inc     Thu Jun 03 19:17:22 2010 +0000
@@ -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}/\"
diff -r 95a0638ebd52 -r e95f20606059 external/bsd/pcc/include/config.h
--- a/external/bsd/pcc/include/config.h Thu Jun 03 19:07:59 2010 +0000
+++ b/external/bsd/pcc/include/config.h Thu Jun 03 19:17:22 2010 +0000
@@ -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, greg@sparky Wed Aug 13 22:19:18 EST 2008" */
+/* #define VERSSTR "pcc 0.9.9 for i386-unknown-netbsdelf5.99.29, plunky@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 */
diff -r 95a0638ebd52 -r e95f20606059 external/bsd/pcc/libexec/ccom/Makefile
--- a/external/bsd/pcc/libexec/ccom/Makefile    Thu Jun 03 19:07:59 2010 +0000
+++ b/external/bsd/pcc/libexec/ccom/Makefile    Thu Jun 03 19:17:22 2010 +0000
@@ -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
diff -r 95a0638ebd52 -r e95f20606059 external/bsd/pcc/libexec/cpp/Makefile
--- a/external/bsd/pcc/libexec/cpp/Makefile     Thu Jun 03 19:07:59 2010 +0000
+++ b/external/bsd/pcc/libexec/cpp/Makefile     Thu Jun 03 19:17:22 2010 +0000
@@ -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>
 
diff -r 95a0638ebd52 -r e95f20606059 external/bsd/pcc/prepare-import.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/pcc/prepare-import.sh        Thu Jun 03 19:17:22 2010 +0000
@@ -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:anonymous%pcc.ludd.ltu.se@localhost:/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."
diff -r 95a0638ebd52 -r e95f20606059 external/bsd/pcc/usr.bin/pcc/Makefile
--- a/external/bsd/pcc/usr.bin/pcc/Makefile     Thu Jun 03 19:07:59 2010 +0000
+++ b/external/bsd/pcc/usr.bin/pcc/Makefile     Thu Jun 03 19:17:22 2010 +0000
@@ -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,"        \



Home | Main Index | Thread Index | Old Index