diff --git a/Android.mk b/Android.mk
index 982e669287bc8844623d089238d183cce65ba17c..c21ec8265be2d40dacb4308cc9e322dfa32aafb4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
-# Copyright (c) 2012, The Linux Foundation. All rights reserved.
+# Copyright (c) 2012,2014 The Linux Foundation. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -41,3 +41,19 @@ $(AAPT):
 
 include $(LOCAL_PATH)/updater/Android.mk \
         $(LOCAL_PATH)/jsmin/Android.mk
+
+# Populate GAIA_DISTRIBUTION_DIR prior to the Gaia sub-build
+gaia/profile.tar.gz: $(GAIA_DISTRIBUTION_DIR)/.exist
+$(GAIA_DISTRIBUTION_DIR)/.exist:
+	mkdir -p $(@D)
+	touch $@
+
+define mk_gaia_distribution_file
+$(GAIA_DISTRIBUTION_DIR)/.exist: $2
+$2: $1
+	mkdir -p $$(@D)
+	cp $$< $$@
+endef
+
+$(foreach file,$(GAIA_DISTRIBUTION_SRC_FILES),\
+  $(eval $(call mk_gaia_distribution_file, $(file), $(GAIA_DISTRIBUTION_DIR)/$(notdir $(file)))))
diff --git a/b2g_product.mk b/b2g_product.mk
index 583e91acd555e3582de755c2413ea40ea070141a..d3e55cf3e7a0379df723ece62f0c15ed2a37b576 100644
--- a/b2g_product.mk
+++ b/b2g_product.mk
@@ -1,4 +1,4 @@
-# Copyright (c) 2012,2013 The Linux Foundation. All rights reserved.
+# Copyright (c) 2012,2013,2014 The Linux Foundation. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -66,6 +66,12 @@ CLEAR_XPCOM_VARS:=$(dir $(firstword $(MAKEFILE_LIST)))clear_xpcom_vars.mk
 BUILD_XPCOM:=$(dir $(firstword $(MAKEFILE_LIST)))xpcom.mk
 
 
+# GAIA_DISTRIBUTION_DIR enables overrides for Gaia settings
+ifndef GAIA_DISTRIBUTION_DIR
+GAIA_DISTRIBUTION_DIR:=$(ANDROID_BUILD_TOP)/out/target/product/$(TARGET_PRODUCT)/gaia_distribution
+export GAIA_DISTRIBUTION_DIR
+endif
+
 #
 # Multilocale support.
 #