Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision ef46abb957c5ec205f92086a02aa05485f684865)
+++ driver/cfa.cc	(revision 1ee048fdd73812ee6ad00b56a313fa0bb424b4a7)
@@ -38,17 +38,22 @@
 
 
-bool prefix( string arg, string pre ) {
+bool prefix( const string & arg, const string & pre ) {
 	return arg.substr( 0, pre.size() ) == pre;
 } // prefix
 
-bool suffix( string arg ) {
-	enum { NumSuffixes = 3 };
-	static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
-	//std::cerr << arg << std::endl;
-	size_t dot = arg.find_last_of( "." );
-	//std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
-	if ( dot == string::npos ) return false;
-	const string * end = suffixes + NumSuffixes;
-	return std::find( suffixes, end, arg.substr( dot + 1 ) ) != end;
+inline bool ends_with(const string & str, const string & sfix) {
+	if (sfix.size() > str.size()) return false;
+	return std::equal(str.rbegin(), str.rbegin() + sfix.size(), sfix.rbegin(), sfix.rend());
+}
+
+bool suffix( const string & arg ) {
+	static const string suffixes[] = { ".cfa", ".hfa", ".cfa.ii" };
+	for(const auto sfix : suffixes) {
+		if(arg.size() <= sfix.size()) continue;
+		size_t pos = arg.find_last_of(sfix);
+		size_t exp = (arg.size() - 1);
+		if(pos == exp) return true;
+	}
+	return false;
 } // suffix
 
@@ -116,4 +121,5 @@
 	bool m64 = false;									// -m64 flag
 	bool intree = false;
+	bool compiling_libs = false;
 	bool disttree = false;
 
@@ -133,9 +139,4 @@
 
 	// process command-line arguments
-
-	args[nargs] = "-x";									// turn off language
-	nargs += 1;
-	args[nargs] = "c";
-	nargs += 1;
 
 	for ( int i = 1; i < argc; i += 1 ) {
@@ -183,4 +184,6 @@
 			} else if ( arg == "-dist-tree" ) {
 				disttree = true;
+			} else if ( arg == "-cfalib") {
+				compiling_libs = true;
 			} else if ( arg == "-compiler" ) {
 				// use the user specified compiler
@@ -375,4 +378,7 @@
 	} else {
 		libbase = TOP_BUILDDIR "libcfa/";
+	}
+
+	if( compiling_libs ) {
 		args[nargs] = "-D__CFA_FLAG__=-t";
 		nargs += 1;
@@ -564,6 +570,7 @@
 	cerr << "args:" << endl;
 	for ( int i = 0; args[i] != NULL; i += 1 ) {
-		cerr << " \"" << args[i] << "\"" << endl;
+		cerr << " \"" << args[i] << "\" ";
 	} // for
+	cerr << endl;
 	#endif // __DEBUG_H__
 
Index: libcfa/prelude/Makefile.am
===================================================================
--- libcfa/prelude/Makefile.am	(revision ef46abb957c5ec205f92086a02aa05485f684865)
+++ libcfa/prelude/Makefile.am	(revision 1ee048fdd73812ee6ad00b56a313fa0bb424b4a7)
@@ -72,5 +72,5 @@
 distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
 	${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@
-	echo "Dummy file to track distribution to remote hosts" > ${@}
+	@echo "Dummy file to track distribution to remote hosts" > ${@}
 
 all: all-am distribution
Index: libcfa/prelude/Makefile.in
===================================================================
--- libcfa/prelude/Makefile.in	(revision ef46abb957c5ec205f92086a02aa05485f684865)
+++ libcfa/prelude/Makefile.in	(revision 1ee048fdd73812ee6ad00b56a313fa0bb424b4a7)
@@ -572,5 +572,5 @@
 @ENABLE_DISTCC_TRUE@distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
 @ENABLE_DISTCC_TRUE@	${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@
-@ENABLE_DISTCC_TRUE@	echo "Dummy file to track distribution to remote hosts" > ${@}
+@ENABLE_DISTCC_TRUE@	@echo "Dummy file to track distribution to remote hosts" > ${@}
 
 @ENABLE_DISTCC_TRUE@all: all-am distribution
Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision ef46abb957c5ec205f92086a02aa05485f684865)
+++ libcfa/src/Makefile.am	(revision 1ee048fdd73812ee6ad00b56a313fa0bb424b4a7)
@@ -30,5 +30,5 @@
 # use -no-include-stdhdr to prevent rebuild cycles
 # The built sources must not depend on the installed headers
-AM_CFAFLAGS = -quiet @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
+AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr  @CONFIG_CFAFLAGS@
 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
Index: libcfa/src/Makefile.in
===================================================================
--- libcfa/src/Makefile.in	(revision ef46abb957c5ec205f92086a02aa05485f684865)
+++ libcfa/src/Makefile.in	(revision 1ee048fdd73812ee6ad00b56a313fa0bb424b4a7)
@@ -443,5 +443,5 @@
 # use -no-include-stdhdr to prevent rebuild cycles
 # The built sources must not depend on the installed headers
-AM_CFAFLAGS = -quiet @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
+AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr  @CONFIG_CFAFLAGS@
 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
