Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision f03c3da635e07202ea78ed26fba2187be319083d)
+++ tools/autotool.py	(revision 49e50e9b24e3d3bf9a73a63ff6659bd320961c0f)
@@ -186,4 +186,5 @@
 	gnu_target = None
 	clang_target = None
+	helenos_target = None
 	cc_args = []
 	
@@ -195,12 +196,15 @@
 			gnu_target = "arm-linux-gnueabi"
 			clang_target = "arm-unknown-linux"
+			helenos_target = "arm-helenos-gnueabi"
 		
 		if (config['CROSS_TARGET'] == "ia32"):
 			gnu_target = "i686-pc-linux-gnu"
 			clang_target = "i386-unknown-linux"
+			helenos_target = "i686-pc-helenos"
 		
 		if (config['CROSS_TARGET'] == "mips32"):
 			gnu_target = "mipsel-linux-gnu"
 			clang_target = "mipsel-unknown-linux"
+			helenos_target = "mipsel-helenos"
 			common['CC_ARGS'].append("-mabi=32")
 	
@@ -209,4 +213,5 @@
 		gnu_target = "amd64-linux-gnu"
 		clang_target = "x86_64-unknown-linux"
+		helenos_target = "amd64-helenos"
 	
 	if (config['PLATFORM'] == "arm32"):
@@ -214,4 +219,5 @@
 		gnu_target = "arm-linux-gnueabi"
 		clang_target = "arm-unknown-linux"
+		helenos_target = "arm-helenos-gnueabi"
 	
 	if (config['PLATFORM'] == "ia32"):
@@ -219,8 +225,10 @@
 		gnu_target = "i686-pc-linux-gnu"
 		clang_target = "i386-unknown-linux"
+		helenos_target = "i686-pc-helenos"
 	
 	if (config['PLATFORM'] == "ia64"):
 		target = config['PLATFORM']
 		gnu_target = "ia64-pc-linux-gnu"
+		helenos_target = "ia64-pc-helenos"
 	
 	if (config['PLATFORM'] == "mips32"):
@@ -232,4 +240,5 @@
 			gnu_target = "mipsel-linux-gnu"
 			clang_target = "mipsel-unknown-linux"
+			helenos_target = "mipsel-helenos"
 		
 		if ((config['MACHINE'] == "bmalta")):
@@ -237,4 +246,5 @@
 			gnu_target = "mips-linux-gnu"
 			clang_target = "mips-unknown-linux"
+			helenos_target = "mips-helenos"
 	
 	if (config['PLATFORM'] == "mips64"):
@@ -246,4 +256,5 @@
 			gnu_target = "mips64el-linux-gnu"
 			clang_target = "mips64el-unknown-linux"
+			helenos_target = "mips64el-helenos"
 	
 	if (config['PLATFORM'] == "ppc32"):
@@ -251,4 +262,5 @@
 		gnu_target = "ppc-linux-gnu"
 		clang_target = "powerpc-unknown-linux"
+		helenos_target = "ppc-helenos"
 	
 	if (config['PLATFORM'] == "sparc64"):
@@ -256,6 +268,7 @@
 		gnu_target = "sparc64-linux-gnu"
 		clang_target = "sparc-unknown-linux"
-	
-	return (target, cc_args, gnu_target, clang_target)
+		helenos_target = "sparc64-helenos"
+	
+	return (target, cc_args, gnu_target, clang_target, helenos_target)
 
 def check_app(args, name, details):
@@ -697,4 +710,10 @@
 		cross_prefix = "/usr/local/cross"
 	
+	# HelenOS cross-compiler prefix
+	if ('CROSS_HELENOS_PREFIX' in os.environ):
+		cross_helenos_prefix = os.environ['CROSS_HELENOS_PREFIX']
+	else:
+		cross_helenos_prefix = "/usr/local/cross-helenos"
+	
 	# Prefix binutils tools on Solaris
 	if (os.uname()[0] == "SunOS"):
@@ -719,5 +738,5 @@
 		common['CC_ARGS'] = []
 		if (config['COMPILER'] == "gcc_cross"):
-			target, cc_args, gnu_target, clang_target = get_target(config)
+			target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
 			
 			if (target is None) or (gnu_target is None):
@@ -727,4 +746,21 @@
 			path = "%s/%s/bin" % (cross_prefix, target)
 			prefix = "%s-" % gnu_target
+			
+			check_gcc(path, prefix, common, PACKAGE_CROSS)
+			check_binutils(path, prefix, common, PACKAGE_CROSS)
+			
+			check_common(common, "GCC")
+			common['CC'] = common['GCC']
+			common['CC_ARGS'].extend(cc_args)
+		
+		if (config['COMPILER'] == "gcc_helenos"):
+			target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
+			
+			if (target is None) or (helenos_target is None):
+				print_error(["Unsupported compiler target for GNU GCC.",
+				             "Please contact the developers of HelenOS."])
+			
+			path = "%s/%s/bin" % (cross_helenos_prefix, target)
+			prefix = "%s-" % helenos_target
 			
 			check_gcc(path, prefix, common, PACKAGE_CROSS)
