Index: src/driver/Makefile.am
===================================================================
--- src/driver/Makefile.am	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
+++ src/driver/Makefile.am	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
@@ -0,0 +1,26 @@
+######################## -*- Mode: Makefile-Automake -*- ######################
+##
+## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+##
+## The contents of this file are covered under the licence agreement in the
+## file "LICENCE" distributed with Cforall.
+##
+## Makefile.am -- 
+##
+## Author           : Peter A. Buhr
+## Created On       : Sun May 31 08:49:31 2015
+## Last Modified By : Peter A. Buhr
+## Last Modified On : Sun May 31 08:50:25 2015
+## Update Count     : 1
+###############################################################################
+
+# applies to both programs
+AM_CXXFLAGS = -Wall
+
+bin_PROGRAMS = cfa
+cfa_SOURCES = cfa.cc
+
+# put into lib for now
+cc1libdir = ${libdir}
+cc1lib_PROGRAMS = cc1
+cc1_SOURCES = cc1.cc
Index: src/driver/Makefile.in
===================================================================
--- src/driver/Makefile.in	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
+++ src/driver/Makefile.in	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
@@ -0,0 +1,530 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+######################## -*- Mode: Makefile-Automake -*- ######################
+###############################################################################
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+bin_PROGRAMS = cfa$(EXEEXT)
+cc1lib_PROGRAMS = cc1$(EXEEXT)
+subdir = src/driver
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cc1libdir)"
+PROGRAMS = $(bin_PROGRAMS) $(cc1lib_PROGRAMS)
+am_cc1_OBJECTS = cc1.$(OBJEXT)
+cc1_OBJECTS = $(am_cc1_OBJECTS)
+cc1_LDADD = $(LDADD)
+am_cfa_OBJECTS = cfa.$(OBJEXT)
+cfa_OBJECTS = $(am_cfa_OBJECTS)
+cfa_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/automake/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
+DIST_SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BACKEND_CC = @BACKEND_CC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFA_BINDIR = @CFA_BINDIR@
+CFA_INCDIR = @CFA_INCDIR@
+CFA_LIBDIR = @CFA_LIBDIR@
+CFA_PREFIX = @CFA_PREFIX@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCC_PATH = @GCC_PATH@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# applies to both programs
+AM_CXXFLAGS = -Wall
+cfa_SOURCES = cfa.cc
+
+# put into lib for now
+cc1libdir = ${libdir}
+cc1_SOURCES = cc1.cc
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/driver/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/driver/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	      echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	      $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+install-cc1libPROGRAMS: $(cc1lib_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(cc1libdir)" || $(MKDIR_P) "$(DESTDIR)$(cc1libdir)"
+	@list='$(cc1lib_PROGRAMS)'; test -n "$(cc1libdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	      echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(cc1libdir)$$dir'"; \
+	      $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(cc1libdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-cc1libPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(cc1lib_PROGRAMS)'; test -n "$(cc1libdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(cc1libdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(cc1libdir)" && rm -f $$files
+
+clean-cc1libPROGRAMS:
+	-test -z "$(cc1lib_PROGRAMS)" || rm -f $(cc1lib_PROGRAMS)
+cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) $(EXTRA_cc1_DEPENDENCIES) 
+	@rm -f cc1$(EXEEXT)
+	$(CXXLINK) $(cc1_OBJECTS) $(cc1_LDADD) $(LIBS)
+cfa$(EXEEXT): $(cfa_OBJECTS) $(cfa_DEPENDENCIES) $(EXTRA_cfa_DEPENDENCIES) 
+	@rm -f cfa$(EXEEXT)
+	$(CXXLINK) $(cfa_OBJECTS) $(cfa_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cc1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfa.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cc1libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-cc1libPROGRAMS clean-generic \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-cc1libPROGRAMS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-cc1libPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-cc1libPROGRAMS clean-generic ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-cc1libPROGRAMS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-binPROGRAMS uninstall-cc1libPROGRAMS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: src/driver/cc1.cc
===================================================================
--- src/driver/cc1.cc	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
+++ src/driver/cc1.cc	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
@@ -0,0 +1,491 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// cc1.cc -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Fri Aug 26 14:23:51 2005
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 30 08:58:29 2015
+// Update Count     : 51
+//
+
+#include <iostream>
+using std::cerr;
+using std::endl;
+#include <string>
+using std::string;
+#include <cstdio>										// stderr, stdout, perror, fprintf
+#include <cstdlib>										// getenv, exit, mkstemp
+#include <unistd.h>										// execvp, fork, unlink
+#include <sys/wait.h>									// wait
+
+#include "config.h"										// configure info
+
+
+//#define __DEBUG_H__
+
+
+string compiler_name( GCC_PATH );						// path/name of C compiler
+
+string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" );
+string D__CFA_FLAGPREFIX__( "-D__CFA_FLAG__=" );
+
+char tmpname[] = P_tmpdir "/CFAXXXXXX";
+int tmpfilefd = -1;
+
+
+bool prefix( string arg, string pre ) {
+	return arg.substr( 0, pre.size() ) == pre;
+} // prefix
+
+
+void checkEnv( const char *args[], int &nargs ) {
+	char *value;
+
+	value = getenv( "__COMPILER__" );
+	if ( value != NULL ) {
+		compiler_name = value;
+#ifdef __DEBUG_H__
+		cerr << "env arg:\"" << compiler_name << "\"" << endl;
+#endif // __DEBUG_H__
+	} // if
+
+	value = getenv( "__GCC_MACHINE__" );
+	if ( value != NULL ) {
+		args[nargs] = ( *new string( value ) ).c_str(); // pass the argument along
+#ifdef __DEBUG_H__
+		cerr << "env arg:\"" << args[nargs] << "\"" << endl;
+#endif // __DEBUG_H__
+		nargs += 1;
+	} // if
+
+	value = getenv( "__GCC_VERSION__" );
+	if ( value != NULL ) {
+		args[nargs] = ( *new string( value ) ).c_str(); // pass the argument along
+#ifdef __DEBUG_H__
+		cerr << "env arg:\"" << args[nargs] << "\"" << endl;
+#endif // __DEBUG_H__
+		nargs += 1;
+	} // if
+} // checkEnv
+
+
+void rmtmpfile() {
+	if ( unlink( tmpname ) == -1 ) {					// remove tmpname
+		perror ( "CFA Translator error: cpp failed" );
+		exit( EXIT_FAILURE );
+	} // if
+	tmpfilefd = -1;										// mark closed
+} // rmtmpfile
+
+
+void sigTermHandler( int signal ) {
+	if ( tmpfilefd != -1 ) {							// RACE, file created ?
+		rmtmpfile();									// remove
+		exit( EXIT_FAILURE );							// terminate 
+	} // if
+} // sigTermHandler
+
+
+void Stage1( const int argc, const char * const argv[] ) {
+	int code;
+	int i;
+
+	string arg;
+	string bprefix;
+
+	const char *cpp_in = NULL;
+	const char *cpp_out = NULL;
+
+	bool CFA_flag = false;
+	bool cpp_flag = false;
+	const char *o_name = NULL;
+
+	const char *args[argc + 100];						// leave space for 100 additional cpp command line values
+	int nargs = 1;										// number of arguments in args list; 0 => command name
+	const char *uargs[20];								// leave space for 20 additional cfa-cpp command line values
+	int nuargs = 1;										// 0 => command name
+
+	signal( SIGINT,  sigTermHandler );
+	signal( SIGTERM, sigTermHandler );
+
+	// process all the arguments
+
+	checkEnv( args, nargs );							// arguments passed via environment variables
+
+	for ( i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+		arg = argv[i];
+#ifdef __DEBUG_H__
+		cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+		if ( prefix( arg, "-" ) ) {
+			// strip g++ flags that are inappropriate or cause duplicates in subsequent passes
+
+			if ( arg == "-quiet" ) {
+			} else if ( arg == "-imultilib" || arg == "-imultiarch" ) {
+				i += 1;									// and the argument
+			} else if ( prefix( arg, "-A" ) ) {
+			} else if ( prefix( arg, "-D__GNU" ) ) {
+				//********
+				// GCC 5.6.0 SEPARATED THE -D FROM THE ARGUMENT!
+				//********
+			} else if ( arg == "-D" && prefix( argv[i + 1], "__GNU" ) ) {
+				i += 1;									// and the argument
+
+				// strip flags controlling cpp step
+
+			} else if ( arg == "-D__CPP__" ) {
+				cpp_flag = true;
+			} else if ( arg == "-D" && string( argv[i + 1] ) == "__CPP__" ) {
+				i += 1;									// and the argument
+				cpp_flag = true;
+			} else if ( arg == "-D__CFA__" ) {
+				CFA_flag = true;
+			} else if ( arg == "-D" && string( argv[i + 1] ) == "__CFA__" ) {
+				i += 1;									// and the argument
+				CFA_flag = true;
+			} else if ( prefix( arg, D__CFA_FLAGPREFIX__ ) ) {
+				uargs[nuargs] = ( *new string( arg.substr( D__CFA_FLAGPREFIX__.size() ) ) ).c_str();
+				nuargs += 1;
+			} else if ( arg == "-D" && prefix( argv[i + 1], D__CFA_FLAGPREFIX__.substr(2) ) ) {
+				uargs[nuargs] = ( *new string( string( argv[i + 1] ).substr( D__CFA_FLAGPREFIX__.size() - 2 ) ) ).c_str();
+				nuargs += 1;
+				i += 1;									// and the argument
+			} else if ( prefix( arg, D__GCC_BPREFIX__ ) ) {
+				bprefix = arg.substr( D__GCC_BPREFIX__.size() );
+			} else if ( arg == "-D" && prefix( argv[i + 1], D__GCC_BPREFIX__.substr(2) ) ) {
+				bprefix = string( argv[i + 1] ).substr( D__GCC_BPREFIX__.size() - 2 );
+				i += 1;									// and the argument
+
+				// all other flags
+
+			} else if ( arg == "-o" ) {
+				i += 1;
+				o_name = argv[i];
+			} else {
+				args[nargs] = argv[i];					// pass the flag along
+				nargs += 1;
+				// CPP flags with an argument
+				if ( arg == "-D" || arg == "-I" || arg == "-MF" || arg == "-MT" || arg == "-MQ" ||
+					 arg == "-include" || arg == "-imacros" || arg == "-idirafter" || arg == "-iprefix" ||
+					 arg == "-iwithprefix" || arg == "-iwithprefixbefore" || arg == "-isystem" || arg == "-isysroot" ) {
+					i += 1;
+					args[nargs] = argv[i];				// pass the argument along
+					nargs += 1;
+#ifdef __DEBUG_H__
+					cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+				} else if ( arg == "-MD" || arg == "-MMD" ) {
+					args[nargs] = "-MF";				// insert before file
+					nargs += 1;
+					i += 1;
+					args[nargs] = argv[i];				// pass the argument along
+					nargs += 1;
+#ifdef __DEBUG_H__
+					cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+				} // if
+			} // if
+		} else {										// obtain input and possibly output files
+			if ( cpp_in == NULL ) {
+				cpp_in = argv[i];
+#ifdef __DEBUG_H__
+				cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
+#endif // __DEBUG_H__
+			} else if ( cpp_out == NULL ) {
+				cpp_out = argv[i];
+#ifdef __DEBUG_H__
+				cerr << "cpp_out:\"" << cpp_out << "\""<< endl;
+#endif // __DEBUG_H__
+			} else {
+				cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+				exit( EXIT_FAILURE );
+			} // if
+		} // if
+	} // for
+
+#ifdef __DEBUG_H__
+	cerr << "args:";
+	for ( i = 1; i < nargs; i += 1 ) {
+		cerr << " " << args[i];
+	} // for
+	if ( cpp_in != NULL ) cerr << " " << cpp_in;
+	if ( cpp_out != NULL ) cerr << " " << cpp_out;
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	if ( cpp_in == NULL ) {
+		cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+		exit( EXIT_FAILURE );
+	} // if
+
+	if ( cpp_flag ) {
+		// The -E flag is specified on the cfa command so only run the preprocessor and output is written to standard
+		// output or -o. The call to cfa has a -E so it does not have to be added to the argument list.
+
+		args[0] = compiler_name.c_str();
+		args[nargs] = cpp_in;
+		nargs += 1;
+		if ( o_name != NULL ) {							// location for output
+			args[nargs] = "-o";
+			nargs += 1;
+			args[nargs] = o_name;
+			nargs += 1;
+		} // if
+		args[nargs] = NULL;								// terminate argument list
+
+#ifdef __DEBUG_H__
+		cerr << "nargs: " << nargs << endl;
+		for ( i = 0; args[i] != NULL; i += 1 ) {
+			cerr << args[i] << " ";
+		} // for
+		cerr << endl;
+#endif // __DEBUG_H__
+
+		execvp( args[0], (char *const *)args );			// should not return
+		perror( "CFA Translator error: cpp level, execvp" );
+		exit( EXIT_FAILURE );
+	} // if
+
+	// Create a temporary file to store output of the C preprocessor.
+
+	tmpfilefd = mkstemp( tmpname );
+	if ( tmpfilefd == -1 ) {
+		perror( "CFA Translator error: cpp level, mkstemp" );
+		exit( EXIT_FAILURE );
+	} // if
+
+#ifdef __DEBUG_H__
+	cerr << "tmpname:" << tmpname << " tmpfilefd:" << tmpfilefd << endl;
+#endif // __DEBUG_H__
+
+	// Run the C preprocessor and save the output in tmpfile.
+
+	if ( fork() == 0 ) {								 // child process ?
+		// -o xxx.ii cannot be used to write the output file from cpp because no output file is created if cpp detects
+		// an error (e.g., cannot find include file). Whereas, output is always generated, even when there is an error,
+		// when cpp writes to stdout. Hence, stdout is redirected into the temporary file.
+		if ( freopen( tmpname, "w", stdout ) == NULL ) { // redirect stdout to tmpname
+			perror( "CFA Translator error: cpp level, freopen" );
+			exit( EXIT_FAILURE );
+		} // if
+
+		args[0] = compiler_name.c_str();
+		args[nargs] = cpp_in;							// input to cpp
+		nargs += 1;
+		args[nargs] = NULL;								// terminate argument list
+
+#ifdef __DEBUG_H__
+		cerr << "cpp nargs: " << nargs << endl;
+		for ( i = 0; args[i] != NULL; i += 1 ) {
+			cerr << args[i] << " ";
+		} // for
+		cerr << endl;
+#endif // __DEBUG_H__
+
+		execvp( args[0], (char *const *)args );			// should not return
+		perror( "CFA Translator error: cpp level, execvp" );
+		exit( EXIT_FAILURE );
+	} // if
+
+	wait( &code );										// wait for child to finish
+
+#ifdef __DEBUG_H__
+	cerr << "return code from cpp:" << WEXITSTATUS(code) << endl;
+#endif // __DEBUG_H__
+
+	if ( WIFSIGNALED(code) != 0 ) {						// child failed ?
+		rmtmpfile();									// remove tmpname
+		cerr << "CFA Translator error: cpp failed with signal " << WTERMSIG(code) << endl;
+		exit( EXIT_FAILURE );
+	} // if
+
+	if ( WEXITSTATUS(code) != 0 ) {						// child error ?
+		rmtmpfile();									// remove tmpname
+		exit( WEXITSTATUS( code ) );					// do not continue
+	} // if
+
+	// If -CFA flag specified, run the cfa-cpp preprocessor on the temporary file, and output is written to standard
+	// output.  Otherwise, run the cfa-cpp preprocessor on the temporary file and save the result into the output file.
+
+	if ( fork() == 0 ) {								// child runs CFA
+		uargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str();
+
+		uargs[nuargs] = "-p";
+		nuargs += 1;
+
+		uargs[nuargs] = tmpname;
+		nuargs += 1;
+		if ( o_name != NULL ) {
+			uargs[nuargs] = o_name;
+			nuargs += 1;
+		} else if ( ! CFA_flag ) {						// run cfa-cpp ?
+			uargs[nuargs] = cpp_out;
+			nuargs += 1;
+		} // if
+		uargs[nuargs] = NULL;							// terminate argument list
+
+#ifdef __DEBUG_H__
+		cerr << "cfa-cpp nuargs: " << o_name << " " << CFA_flag << " " << nuargs << endl;
+		for ( i = 0; uargs[i] != NULL; i += 1 ) {
+			cerr << uargs[i] << " ";
+		} // for
+		cerr << endl;
+#endif // __DEBUG_H__
+
+		execvp( uargs[0], (char * const *)uargs );		// should not return
+		perror( "CFA Translator error: cpp level, execvp" );
+		exit( EXIT_FAILURE );
+	} // if
+
+	wait( &code );										// wait for child to finish
+
+#ifdef __DEBUG_H__
+	cerr << "return code from cfa-cpp:" << WEXITSTATUS(code) << endl;
+#endif // __DEBUG_H__
+
+	// Must unlink here because file must exist across execvp.
+	rmtmpfile();										// remove tmpname
+
+	if ( WIFSIGNALED(code) ) {							// child failed ?
+		cerr << "CFA Translator error: cfa-cpp failed with signal " << WTERMSIG(code) << endl;
+		exit( EXIT_FAILURE );
+	} // if
+
+	exit( WEXITSTATUS(code) );
+} // Stage1
+
+
+void Stage2( const int argc, const char * const * argv ) {
+	int i;
+
+	string arg;
+
+	const char *cpp_in = NULL;
+
+	const char *args[argc + 100];						// leave space for 100 additional cfa command line values
+	int nargs = 1;										// number of arguments in args list; 0 => command name
+
+	// process all the arguments
+
+	checkEnv( args, nargs );							// arguments passed via environment variables
+
+	for ( i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+		arg = argv[i];
+#ifdef __DEBUG_H__
+		cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+		if ( prefix( arg, "-" ) ) {
+			// strip inappropriate flags
+
+			if ( arg == "-quiet" || arg == "-version" || arg == "-fpreprocessed" ||
+				 // Currently CFA does not suppose precompiled .h files.
+				 prefix( arg, "--output-pch" ) ) {
+
+				// strip inappropriate flags with an argument
+
+			} else if ( arg == "-auxbase" || arg == "-auxbase-strip" || arg == "-dumpbase" ) {
+				i += 1;
+#ifdef __DEBUG_H__
+				cerr << "arg:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+
+				// all other flags
+
+			} else {
+				args[nargs] = argv[i];					// pass the flag along
+				nargs += 1;
+				if ( arg == "-o" ) {
+					i += 1;
+					args[nargs] = argv[i];				// pass the argument along
+					nargs += 1;
+#ifdef __DEBUG_H__
+					cerr << "arg:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+				} // if
+			} // if
+		} else {										// obtain input and possibly output files
+			if ( cpp_in == NULL ) {
+				cpp_in = argv[i];
+#ifdef __DEBUG_H__
+				cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
+#endif // __DEBUG_H__
+			} else {
+				cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+				exit( EXIT_FAILURE );
+			} // if
+		} // if
+	} // for
+
+#ifdef __DEBUG_H__
+	cerr << "args:";
+	for ( i = 1; i < nargs; i += 1 ) {
+		cerr << " " << args[i];
+	} // for
+	cerr << endl;
+	if ( cpp_in != NULL ) cerr << " " << cpp_in;
+#endif // __DEBUG_H__
+
+	args[0] = compiler_name.c_str();
+	args[nargs] = "-S";									// only compile and put assembler output in specified file
+	nargs += 1;
+	args[nargs] = cpp_in;
+	nargs += 1;
+	args[nargs] = NULL;									// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "stage2 nargs: " << nargs << endl;
+	for ( i = 0; args[i] != NULL; i += 1 ) {
+		cerr << args[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( args[0], (char * const *)args );			// should not return
+	perror( "CFA Translator error: cpp level, execvp" );
+	exit( EXIT_FAILURE );								// tell gcc not to go any further
+} // Stage2
+
+
+int main( const int argc, const char * const argv[], const char * const env[] ) {
+#ifdef __DEBUG_H__
+	for ( int i = 0; env[i] != NULL; i += 1 ) {
+		cerr << env[i] << endl;
+	} // for
+#endif // __DEBUG_H__
+
+	string arg = argv[1];
+
+	// Currently, stage 1 starts with flag -E and stage 2 with flag -fpreprocessed.
+
+	if ( arg == "-E" ) {
+#ifdef __DEBUG_H__
+		cerr << "Stage1" << endl;
+#endif // __DEBUG_H__
+		Stage1( argc, argv );
+	} else if ( arg == "-fpreprocessed" ) {
+#ifdef __DEBUG_H__
+		cerr << "Stage2" << endl;
+#endif // __DEBUG_H__
+		Stage2( argc, argv );
+	} else {
+		cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+		exit( EXIT_FAILURE );
+	} // if
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/driver/cfa.cc
===================================================================
--- src/driver/cfa.cc	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
+++ src/driver/cfa.cc	(revision 6e7e2b36dcaa528c1778f81efe7654e171fb2197)
@@ -0,0 +1,361 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// cfa.cc -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Tue Aug 20 13:44:49 2002
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 30 10:15:00 2015
+// Update Count     : 116
+//
+
+#include <iostream>
+#include <cstdio>										// perror
+#include <cstdlib>										// putenv, exit
+#include <unistd.h>										// execvp
+#include <string>										// STL version
+
+#include "config.h"										// configure info
+
+using std::cerr;
+using std::endl;
+using std::string;
+
+
+//#define __DEBUG_H__
+
+
+bool prefix( string arg, string pre ) {
+	return arg.substr( 0, pre.size() ) == pre;
+} // prefix
+
+
+void shuffle( const char *args[], int S, int E, int N ) {
+	// S & E index 1 passed the end so adjust with -1
+#ifdef __DEBUG_H__
+	cerr << "shuffle:" << S << " " << E << " " << N << endl;
+#endif // __DEBUG_H__
+	for ( int j = E-1 + N; j > S-1 + N; j -=1 ) {
+#ifdef __DEBUG_H__
+		cerr << "\t" << j << " " << j-N << endl;
+#endif // __DEBUG_H__
+		args[j] = args[j-N];
+	} // for
+} // shuffle
+
+
+int main( int argc, char *argv[] ) {
+	string Version( VERSION );							// current version number from CONFIG
+	string Major( "0" ), Minor( "0" ), Patch( "0" );	// default version numbers
+	int posn1 = Version.find( "." );					// find the divider between major and minor version numbers
+	if ( posn1 == -1 ) {								// not there ?
+		Major = Version;
+	} else {
+		Major = Version.substr( 0, posn1 );
+		int posn2 = Version.find( ".", posn1 + 1 );		// find the divider between minor and patch numbers
+		if ( posn2 == -1 ) {							// not there ?
+			Minor = Version.substr( posn1 );
+		} else {
+			Minor = Version.substr( posn1 + 1, posn2 - posn1 - 1 );
+			Patch = Version.substr( posn2 + 1 );
+		} // if
+	} // if
+
+	string installincdir( CFA_INCDIR );					// fixed location of include files
+	string installlibdir( CFA_LIBDIR );					// fixed location of cc1 and cfa-cpp commands
+
+	string heading;										// banner printed at start of cfa compilation
+	string arg;											// current command-line argument during command-line parsing
+	string Bprefix;										// path where gcc looks for compiler command steps
+	string langstd;										// language standard
+
+	string compiler_path( GCC_PATH );					// path/name of C compiler
+	string compiler_name;								// name of C compiler
+
+	bool nonoptarg = false;								// indicates non-option argument specified
+	bool link = true;									// linking as well as compiling
+	bool verbose = false;								// -v flag
+	bool quiet = false;									// -quiet flag
+	bool debug = true;									// -debug flag
+	bool help = false;									// -help flag
+	bool CFA_flag = false;								// -CFA flag
+	bool cpp_flag = false;								// -E or -M flag, preprocessor only
+	bool debugging = false;								// -g flag
+
+	const char *args[argc + 100];						// cfa command line values, plus some space for additional flags
+	int sargs = 1;										// starting location for arguments in args list
+	int nargs = sargs;									// number of arguments in args list; 0 => command name
+
+	const char *libs[argc + 20];						// non-user libraries must come separately, plus some added libraries and flags
+	int nlibs = 0;
+
+#ifdef __DEBUG_H__
+	cerr << "CFA:" << endl;
+#endif // __DEBUG_H__
+
+	// process command-line arguments
+
+	for ( int i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+		arg = argv[i];									// convert to string value
+#ifdef __DEBUG_H__
+		cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+		if ( prefix( arg, "-" ) ) {
+			// pass through arguments
+
+			if ( arg == "-Xlinker" || arg == "-o" ) {
+				args[nargs] = argv[i];					// pass the argument along
+				nargs += 1;
+				i += 1;
+				if ( i == argc ) continue;				// next argument available ?
+				args[nargs] = argv[i];					// pass the argument along
+				nargs += 1;
+			} else if ( arg == "-XCFA" ) {				// CFA pass through
+				i += 1;
+				args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + argv[i] ) ).c_str();
+				nargs += 1;
+
+				// CFA specific arguments
+
+			} else if ( arg == "-CFA" ) {
+				CFA_flag = true;						// strip the -CFA flag
+				link = false;
+				args[nargs] = "-E";						// replace the argument with -E
+				nargs += 1;
+			} else if ( arg == "-debug" ) {
+				debug = true;							// strip the debug flag
+			} else if ( arg == "-nodebug" ) {
+				debug = false;							// strip the nodebug flag
+			} else if ( arg == "-quiet" ) {
+				quiet = true;							// strip the quiet flag
+			} else if ( arg == "-noquiet" ) {
+				quiet = false;							// strip the noquiet flag
+			} else if ( arg == "-help" ) {
+				help = true;							// strip the help flag
+			} else if ( arg == "-nohelp" ) {
+				help = false;							// strip the nohelp flag
+			} else if ( arg == "-compiler" ) {
+				// use the user specified compiler
+				i += 1;
+				if ( i == argc ) continue;				// next argument available ?
+				compiler_path = argv[i];
+				if ( putenv( (char *)( *new string( string( "__U_COMPILER__=" ) + argv[i]) ).c_str() ) != 0 ) {
+					cerr << argv[0] << " error, cannot set environment variable." << endl;
+					exit( EXIT_FAILURE );
+				} // if
+
+				// C++ specific arguments
+
+			} else if ( arg == "-v" ) {
+				verbose = true;							// verbosity required
+				args[nargs] = argv[i];					// pass the argument along
+				nargs += 1;
+			} else if ( arg == "-g" ) {
+				debugging = true;						// symbolic debugging required
+				args[nargs] = argv[i];					// pass the argument along
+				nargs += 1;
+			} else if ( prefix( arg, "-B" ) ) {
+				Bprefix = arg.substr(2);				// strip the -B flag
+				args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
+				nargs += 1;
+			} else if ( prefix( arg, "-b" ) ) {
+				if ( arg.length() == 2 ) {				// separate argument ?
+					i += 1;
+					if ( i == argc ) continue;			// next argument available ?
+					arg += argv[i];						// concatenate argument
+				} // if
+				// later versions of gcc require the -b option to appear at the start of the command line
+				shuffle( args, sargs, nargs, 1 );		// make room at front of argument list
+				args[sargs] = ( *new string( arg ) ).c_str(); // pass the argument along
+				if ( putenv( (char *)( *new string( string( "__GCC_MACHINE__=" ) + arg ) ).c_str() ) != 0 ) {
+					cerr << argv[0] << " error, cannot set environment variable." << endl;
+					exit( EXIT_FAILURE );
+				} // if
+				sargs += 1;
+				nargs += 1;
+			} else if ( prefix( arg, "-V" ) ) {
+				if ( arg.length() == 2 ) {				// separate argument ?
+					i += 1;
+					if ( i == argc ) continue;			// next argument available ?
+					arg += argv[i];						// concatenate argument
+				} // if
+				// later versions of gcc require the -V option to appear at the start of the command line
+				shuffle( args, sargs, nargs, 1 );		// make room at front of argument list
+				args[sargs] = ( *new string( arg ) ).c_str(); // pass the argument along
+				if ( putenv( (char *)( *new string( string( "__GCC_VERSION__=" ) + arg ) ).c_str() ) != 0 ) {
+					cerr << argv[0] << " error, cannot set environment variable." << endl;
+					exit( EXIT_FAILURE );
+				} // if
+				sargs += 1;
+				nargs += 1;
+			} else if ( arg == "-c" || arg == "-S" || arg == "-E" || arg == "-M" || arg == "-MM" ) {
+				args[nargs] = argv[i];					// pass the argument along
+				nargs += 1;
+				if ( arg == "-E" || arg == "-M" || arg == "-MM" ) {
+					cpp_flag = true;					// cpp only
+				} // if
+				link = false;                           // no linkage required
+			} else if ( arg[1] == 'l' ) {
+				// if the user specifies a library, load it after user code
+				libs[nlibs] = argv[i];
+				nlibs += 1;
+			} else {
+				// concatenate any other arguments
+				args[nargs] = argv[i];
+				nargs += 1;
+			} // if
+		} else {
+			// concatenate other arguments
+			args[nargs] = argv[i];
+			nargs += 1;
+			nonoptarg = true;
+		} // if
+	} // for
+
+#ifdef __DEBUG_H__
+	cerr << "args:";
+	for ( int i = 1; i < nargs; i += 1 ) {
+		cerr << " " << args[i];
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	if ( cpp_flag && CFA_flag ) {
+		cerr << argv[0] << " error, cannot use -E and -CFA flags together." << endl;
+		exit( EXIT_FAILURE );
+	} // if
+
+	string d;
+	if ( debug ) {
+		d = "-d";
+	} // if
+
+	args[nargs] = "-I" CFA_INCDIR;
+	nargs += 1;
+
+	if ( link ) {
+		// include the cfa library in case it's needed
+		args[nargs] = "-L" CFA_LIBDIR;
+		nargs += 1;
+		args[nargs] = "-lcfa";
+		nargs += 1;
+	} // if
+
+	// add the correct set of flags based on the type of compile this is
+
+	args[nargs] = ( *new string( string("-D__CFA_MAJOR__=") + Major ) ).c_str();
+	nargs += 1;
+	args[nargs] = ( *new string( string("-D__CFA_MINOR__=") + Minor ) ).c_str();
+	nargs += 1;
+
+	if ( cpp_flag ) {
+		args[nargs] = "-D__CPP__";
+		nargs += 1;
+	} // if
+
+	if ( CFA_flag ) {
+		args[nargs] = "-D__CFA__";
+		nargs += 1;
+	} // if
+
+	if ( debug ) {
+		heading += " (debug)";
+		args[nargs] = "-D__CFA_DEBUG__";
+		nargs += 1;
+	} else {
+		heading += " (no debug)";
+	} // if
+
+	if ( Bprefix.length() == 0 ) {
+		Bprefix = installlibdir;
+		args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
+		nargs += 1;
+	} // if
+
+	// execute the compilation command
+
+	args[0] = compiler_path.c_str();					// set compiler command for exec
+	// find actual name of the compiler independent of the path to it
+	int p = compiler_path.find_last_of( '/' );			// scan r -> l for first '/'
+	if ( p == -1 ) {
+		compiler_name = compiler_path;
+	} else {
+		compiler_name = *new string( compiler_path.substr( p + 1 ) );
+	} // if
+
+	if ( prefix( compiler_name, "gcc" ) ) {				// allow suffix on gcc name
+		args[nargs] = "-no-integrated-cpp";
+		nargs += 1;
+		args[nargs] = "-Wno-deprecated"; 
+		nargs += 1;
+		args[nargs] = "-std=c99";
+		nargs += 1;
+		args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str();
+		nargs += 1;
+	} else {
+		cerr << argv[0] << " error, compiler " << compiler_name << " not supported." << endl;
+		exit( EXIT_FAILURE );
+	} // if
+
+	for ( int i = 0; i < nlibs; i += 1 ) {				// copy non-user libraries after all user libraries
+		args[nargs] = libs[i];
+		nargs += 1;
+	} // for
+
+	args[nargs] = NULL;									// terminate with NULL
+
+#ifdef __DEBUG_H__
+	cerr << "nargs: " << nargs << endl;
+	cerr << "args:" << endl;
+	for ( int i = 0; args[i] != NULL; i += 1 ) {
+		cerr << " \"" << args[i] << "\"" << endl;
+	} // for
+#endif // __DEBUG_H__
+
+	if ( ! quiet ) {
+		cerr << "CFA " << "Version " << Version << heading << endl;
+
+		if ( help ) {
+			cerr <<
+				"-debug\t\t\t: use cfa runtime with debug checking" << endl <<
+				"-help\t\t\t: print this help message" << endl <<
+				"-quiet\t\t\t: print no messages from the cfa command" << endl <<
+				"-CFA\t\t\t: run the cpp preprocessor and the cfa-cpp translator" << endl <<
+				"-XCFA -cfa-cpp-flag\t: pass next flag as-is to the cfa-cpp translator" << endl <<
+				"...\t\t\t: any other " << compiler_name << " flags" << endl;
+		} // if
+	} // if
+
+	if ( verbose ) {
+		if ( argc == 2 ) exit( EXIT_SUCCESS );			// if only the -v flag is specified, do not invoke gcc
+
+		for ( int i = 0; args[i] != NULL; i += 1 ) {
+			cerr << args[i] << " ";
+		} // for
+		cerr << endl;
+	} // if
+
+	if ( ! nonoptarg ) {
+		cerr << argv[0] << " error, no input files" << endl;
+		exit( EXIT_FAILURE );
+	} // if
+
+	// execute the command and return the result
+
+	execvp( args[0], (char *const *)args );				// should not return
+	perror( "CFA Translator error: cfa level, execvp" );
+	exit( EXIT_FAILURE );
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
