Index: uspace/app/cpp
===================================================================
--- uspace/app/cpp	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
+++ uspace/app/cpp	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -0,0 +1,1 @@
+/home/jirkazr/HelenOS_pcc/uspace/app/pcc/cc/cpp
Index: uspace/app/pcc/cc/cpp/Makefile
===================================================================
--- uspace/app/pcc/cc/cpp/Makefile	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
+++ uspace/app/pcc/cc/cpp/Makefile	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2011 Jiri Zarevucky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# TODO: prefer libcompat headers to libc
+
+ARCH = i386  # FIXME: figure out the real arch
+
+USPACE_PREFIX = ../../../..
+LIBS = $(LIBCOMPAT_PREFIX)/libcompat.a
+MIPDIR = ../../mip
+ARCHDIR = ../../arch/$(ARCH)
+EXTRA_CFLAGS = -I$(LIBCOMPAT_PREFIX) -I$(MIPDIR) -I$(ARCHDIR)
+EXTRA_CLEAN = y.tab.c y.tab.h
+DEFS = -DCPP_DEBUG -Dfree=free
+BINARY = cpp
+
+YACC = yacc
+
+SOURCES = \
+	y.tab.c \
+	cpp.c \
+	token.c \
+	$(MIPDIR)/compat.c
+
+y.tab.c:
+	$(YACC) -d cpy.y
+
+include $(USPACE_PREFIX)/Makefile.common
+
Index: uspace/app/pcc/cc/cpp/config.h
===================================================================
--- uspace/app/pcc/cc/cpp/config.h	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
+++ uspace/app/pcc/cc/cpp/config.h	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -0,0 +1,1 @@
+/home/jirkazr/HelenOS_pcc/uspace/app/pcc/config.h
Index: uspace/app/pcc/cc/cpp/cpp.c
===================================================================
--- uspace/app/pcc/cc/cpp/cpp.c	(revision f5c80460a9886faf736b47c8926a4dae299030cc)
+++ uspace/app/pcc/cc/cpp/cpp.c	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -37,9 +37,9 @@
 #include <sys/wait.h>
 #endif
-#include <sys/stat.h>
+#include <compat/sys/stat.h>
 
 #include <fcntl.h>
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#include <compat/unistd.h>
 #endif
 #include <stdio.h>
@@ -47,5 +47,5 @@
 #include <stdlib.h>
 #include <string.h>
-#include <time.h>
+#include <compat/time.h>
 #include <ctype.h>
 
@@ -403,5 +403,5 @@
 	usch *osp;
 	usch *fn, *safefn;
-	int c, it;
+	int c;
 
 	if (flslvl)
@@ -437,5 +437,5 @@
 		if (c != '\n')
 			goto bad;
-		it = SYSINC;
+		(void) SYSINC;
 		safefn = fn;
 	} else {
@@ -870,5 +870,4 @@
 	usch *t;
 	usch *sb = stringbuf;
-	int dummy;
 
 	flbuf();
@@ -878,6 +877,6 @@
 		write (2, t, strlen((char *)t));
 	}
-	dummy = write (2, s, strlen((char *)s));
-	dummy = write (2, "\n", 1);
+	write (2, s, strlen((char *)s));
+	write (2, "\n", 1);
 	stringbuf = sb;
 }
@@ -887,5 +886,4 @@
 {
 	usch *t;
-	int dummy;
 
 	flbuf();
@@ -893,8 +891,8 @@
 	if (ifiles != NULL) {
 		t = sheap("%s:%d: error: ", ifiles->fname, ifiles->lineno);
-		dummy = write (2, t, strlen((char *)t));
-	}
-	dummy = write (2, s, strlen((char *)s));
-	dummy = write (2, "\n", 1);
+		write (2, t, strlen((char *)t));
+	}
+	write (2, s, strlen((char *)s));
+	write (2, "\n", 1);
 	exit(1);
 }
@@ -1863,5 +1861,5 @@
 	struct tree *w, *new, *last;
 	int len, cix, bit, fbit, svbit, ix, bitno;
-	const usch *k, *m, *sm;
+	const usch *k, *m;
 
 	/* Count full string length */
@@ -1898,5 +1896,5 @@
 	sp = (struct symtab *)w;
 
-	sm = m = sp->namep;
+	m = sp->namep;
 	k = key;
 
Index: uspace/app/pcc/cc/cpp/token.c
===================================================================
--- uspace/app/pcc/cc/cpp/token.c	(revision f5c80460a9886faf736b47c8926a4dae299030cc)
+++ uspace/app/pcc/cc/cpp/token.c	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -45,5 +45,5 @@
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
+#include <compat/ctype.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -183,5 +183,5 @@
 {
 	struct symtab *nl;
-	int ch, i, ccnt, onemore;
+	int ch, i, ccnt;
 	usch *cp;
 
@@ -357,5 +357,5 @@
 				goto xloop;
 			}
-			onemore = i = ccnt = 0;
+			i = ccnt = 0;
 			do {
 				yytext[i++] = (usch)ch;
Index: uspace/app/pcc/config.h
===================================================================
--- uspace/app/pcc/config.h	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
+++ uspace/app/pcc/config.h	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -0,0 +1,180 @@
+
+// FIXME: find out which of them are actually true
+
+/* Using a.out ABI */
+//#undef AOUTABI
+
+/* Define path to alternate assembler */
+//#undef ASSEMBLER
+
+/* Using Classic 68k ABI */
+//#undef CLASSIC68K
+
+/* Using COFF ABI */
+//#undef COFFABI
+
+/* Define path to alternate compiler */
+//#undef COMPILER
+
+/* Using ECOFF ABI */
+//#undef ECOFFABI
+
+/* Using ELF ABI */
+#define ELFABI 1
+
+/* Define to 1 if you have the `basename' function. */
+#define HAVE_BASENAME 1
+
+/* Define to 1 if printf supports C99 size specifiers */
+#define HAVE_C99_FORMAT 1
+
+/* Define to 1 if your compiler supports C99 variadic macros */
+#define HAVE_CPP_VARARG_MACRO_GCC 1
+
+/* Define to 1 if you have the `ffs' function. */
+#define HAVE_FFS 1
+
+/* Define to 1 if you have the `getopt' function. */
+#define HAVE_GETOPT 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mkstemp' function. */
+#define HAVE_MKSTEMP 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+//#define HAVE_STRLCAT 1
+
+/* 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
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+//#define HAVE_SYS_WAIT_H 1
+
+/* 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 */
+//#undef HOST_BIG_ENDIAN
+
+/* Define if host is LITTLE endian */
+#define HOST_LITTLE_ENDIAN
+// FIXME: check architecture
+
+/* lex is flex */
+#define ISFLEX 1
+
+/* Define alternate standard lib directory */
+//#undef LIBDIR
+
+/* Define path to alternate linker */
+//#undef LINKER
+
+/* Using Mach-O ABI */
+//#undef MACHOABI
+
+/* Define to the address where bug reports for this package should be sent. */
+//#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+//#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+//#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+//#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+//#undef PACKAGE_VERSION
+
+/* Major version no */
+#define PCC_MAJOR 1
+
+/* Minor version no */
+#define PCC_MINOR 0
+
+/* Minor minor version no */
+#define PCC_MINORMINOR 0
+
+/* Using PE/COFF ABI */
+//#undef PECOFFABI
+
+/* Define path to alternate preprocessor */
+//#undef PREPROCESSOR
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define alternate standard include directory */
+//#undef STDINC
+
+/* Define if target defaults to BIG endian */
+//#undef TARGET_BIG_ENDIAN
+
+/* Define if target defaults to LITTLE endian */
+#define TARGET_LITTLE_ENDIAN
+// FIXME: check architecture
+
+/* Target OS */
+#define TARGOS HelenOS
+
+/* Target OS version */
+// #undef TARGOSVER
+
+/* Enable thread-local storage (TLS). */
+// #undef TLS
+
+/* Version string */
+#define VERSSTR "pcc 1.0.0 for HelenOS"
+
+/* Size of wide character type */
+// #undef WCHAR_SIZE
+
+/* Type to use for wide characters */
+// #undef WCHAR_TYPE
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+   `char[]'. */
+//#define YYTEXT_POINTER 1
+
Index: uspace/app/pcc/mip/config.h
===================================================================
--- uspace/app/pcc/mip/config.h	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
+++ uspace/app/pcc/mip/config.h	(revision 3baec294a7cbba646da1ea5f76cb165b3bf77f16)
@@ -0,0 +1,1 @@
+/home/jirkazr/HelenOS_pcc/uspace/app/pcc/config.h
