Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision ea15a89ad4ebd576ab3620748f7af9e29f5809c0)
+++ tools/autotool.py	(revision 9ce068327015d9cf93bd07491b950880816e4f0e)
@@ -182,5 +182,5 @@
 		             "Please contact the developers of HelenOS."])
 
-def get_target(config, needs_clang = False):
+def get_target(config):
 	target = None
 	gnu_target = None
@@ -205,5 +205,5 @@
 		target = config['PLATFORM']
 		gnu_target = "amd64-linux-gnu"
-		clang_target = "x86_64-uknown-linux"
+		clang_target = "x86_64-unknown-linux"
 	
 	if (config['PLATFORM'] == "arm32"):
@@ -214,5 +214,5 @@
 		target = config['PLATFORM']
 		gnu_target = "i686-pc-linux-gnu"
-		clang_target = "i386-uknown-linux"
+		clang_target = "i386-unknown-linux"
 	
 	if (config['PLATFORM'] == "ia64"):
@@ -247,8 +247,4 @@
 		target = config['PLATFORM']
 		gnu_target = "sparc64-linux-gnu"
-	
-	if (target is None) or (gnu_target is None) or (clang_target is None and needs_clang):
-		print_error(["Failed to determine target for compiler.",
-		             "Please contact the developers of HelenOS."])
 	
 	return (target, cc_args, gnu_target, clang_target)
@@ -714,5 +710,10 @@
 		common['CC_ARGS'] = []
 		if (config['COMPILER'] == "gcc_cross"):
-			target, cc_args, gnu_target, clang_target_unused = get_target(config)
+			target, cc_args, gnu_target, clang_target = get_target(config)
+			
+			if (target is None) or (gnu_target is None):
+				print_error(["Unsupported compiler target for GNU GCC.",
+				             "Please contact the developers of HelenOS."])
+			
 			path = "%s/%s/bin" % (cross_prefix, target)
 			prefix = "%s-" % gnu_target
@@ -739,15 +740,23 @@
 		
 		if (config['COMPILER'] == "clang"):
-			target, cc_args, gnu_target, clang_target = get_target(config, True)
+			target, cc_args, gnu_target, clang_target = get_target(config)
+			
+			if (target is None) or (gnu_target is None) or (clang_target is None):
+				print_error(["Unsupported compiler target for clang.",
+				             "Please contact the developers of HelenOS."])
+			
 			path = "%s/%s/bin" % (cross_prefix, target)
 			prefix = "%s-" % gnu_target
 			
+			check_app(["clang", "--version"], "clang compiler", "preferably version 1.0 or newer")
+			check_gcc(path, prefix, common, PACKAGE_GCC)
+			check_binutils(path, prefix, common, PACKAGE_BINUTILS)
+			
+			check_common(common, "GCC")
 			common['CC'] = "clang"
 			common['CC_ARGS'].extend(cc_args)
 			common['CC_ARGS'].append("-target")
 			common['CC_ARGS'].append(clang_target)
-			check_app([common['CC'], "--version"], "Clang compiler", "preferably version 1.0 or newer")
-			check_gcc(path, prefix, common, PACKAGE_GCC)
-			check_binutils(path, prefix, common, PACKAGE_BINUTILS)
+			common['CLANG_TARGET'] = clang_target
 		
 		# Platform-specific utilities
