diff --git a/build/bakefiles/wx.bkl b/build/bakefiles/wx.bkl
index 1265e4dc77..6d6995515a 100644
--- a/build/bakefiles/wx.bkl
+++ b/build/bakefiles/wx.bkl
@@ -87,7 +87,7 @@
$(SRCDIR)/build/bakefiles/wxpresets/presets
- wx.bkl wx_unix.bkl wx_win32.bkl wx_xrc.bkl
+ wx.bkl wx_unix.bkl wx_win32.bkl wx_xrc.bkl wx_presets.py
$(DATADIR)/bakefile/presets
diff --git a/build/bakefiles/wxpresets/presets/wx.bkl b/build/bakefiles/wxpresets/presets/wx.bkl
index eae18ed220..ff06b7f6fd 100644
--- a/build/bakefiles/wxpresets/presets/wx.bkl
+++ b/build/bakefiles/wxpresets/presets/wx.bkl
@@ -112,6 +112,7 @@
+
- $(COMPILER)
+ $(COMPILER)
diff --git a/build/bakefiles/wxpresets/presets/wx_presets.py b/build/bakefiles/wxpresets/presets/wx_presets.py
new file mode 100644
index 0000000000..60af474f6c
--- /dev/null
+++ b/build/bakefiles/wxpresets/presets/wx_presets.py
@@ -0,0 +1,11 @@
+
+# We use 'COMPILER_PREFIX' option in places where bakefile doesn't like it, so
+# we must register a substitution function for it that provides additional
+# knowledge about the option (in this case that it does not contain dir
+# separators and so utils.nativePaths() doesn't have to do anything with it):
+
+from utils import addSubstituteCallback
+
+def __noopSubst(name, func, caller):
+ return '$(%s)' % name
+addSubstituteCallback('COMPILER_PREFIX', __noopSubst)