Index: tools/xcw/bin/helenos-bld-config
===================================================================
--- tools/xcw/bin/helenos-bld-config	(revision 3875f1064135338c90e634c95c82359a59d27007)
+++ tools/xcw/bin/helenos-bld-config	(revision a5c468e1202a50cf26350e4a4d16303bc7323265)
@@ -1,5 +1,5 @@
 #!/bin/bash
 #
-# Copyright (c) 2015 Jiri Svoboda
+# Copyright (c) 2018 Jiri Svoboda
 # All rights reserved.
 #
@@ -35,4 +35,5 @@
 MAKEFILE_COMMON="$SRC_ROOT"/Makefile.common
 MAKEFILE_CONFIG="$SRC_ROOT"/Makefile.config
+CONFIG_MK="$SRC_ROOT"/uspace/export/config.mk
 
 # Extract simple 'name = value' variable definition from Makefile
@@ -42,5 +43,6 @@
 	file_name="$2"
 
-	sed -n "s/^$field_name = \\(.*\\)$/\\1/p" "$file_name"
+	sed -n "s/^$field_name \\{0,1\\}= \\{0,1\\}\\(.*\\)$/\\1/p" "$file_name" | \
+	    sed "s/^\"//" | sed "s/\"$//"
 }
 
@@ -54,4 +56,6 @@
 	echo "__${ENDIAN}__"
 	;;
+*.--cflags) extract_field "HELENOS_CFLAGS" "$CONFIG_MK";;
+*.--ldflags) extract_field "HELENOS_LDFLAGS" "$CONFIG_MK";;
 (*)
 	echo "Unknown option $1" >&2
