summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf.samuelsson@atmel.com>2008-03-29 14:09:22 +0000
committerUlf Samuelsson <ulf.samuelsson@atmel.com>2008-03-29 14:09:22 +0000
commitacdf16967d44b7a380ff9985f4f65974bbb56c07 (patch)
tree789bd03680f03a07ce00979d854b76c9f2507010 /target/linux
parent26447bda444c6fab48425552d32596e0534577a2 (diff)
Add some robustness to linux configuration
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/Makefile.in.advanced41
1 files changed, 28 insertions, 13 deletions
diff --git a/target/linux/Makefile.in.advanced b/target/linux/Makefile.in.advanced
index f2be6465e..0c4ee7610 100644
--- a/target/linux/Makefile.in.advanced
+++ b/target/linux/Makefile.in.advanced
@@ -188,16 +188,6 @@ LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" HOSTCFLAGS="$(HOSTCFLAGS)" \
LZMA="$(LZMA)"
# =============================================================================
-
-$(LINUX26_KCONFIG):
- @if [ ! -f "$(LINUX26_KCONFIG)" ] ; then \
- echo ""; \
- echo "You should create a .config for your kernel"; \
- echo "and install it as $(LINUX26_KCONFIG)"; \
- echo ""; \
- sleep 5; \
- fi
-# =============================================================================
ifneq ($(strip $(LINUX26_VERSION)),$(strip $(LINUX_HEADERS_VERSION)))
$(DL_DIR)/$(LINUX26_SOURCE):
$(WGET) -P $(DL_DIR) $(LINUX26_SITE)/$(LINUX26_SOURCE)
@@ -284,9 +274,9 @@ ifneq ($(LINUX26_PATCH_DIR),)
fi
endif
touch $@
+# =============================================================================
-# -----------------------------------------------------------------------------
-$(LINUX26_DIR)/.configured: $(LINUX26_DIR)/.patched $(LINUX26_KCONFIG)
+$(LINUX26_DIR)/.config: $(LINUX26_DIR)/.patched
ifeq ($(BR2_PACKAGE_LINUX_USE_DEFCONFIG),y)
$(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) $(BOARD_NAME)_defconfig
endif
@@ -294,8 +284,33 @@ ifeq ($(BR2_PACKAGE_LINUX_USE_XCONFIG),y)
$(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) xconfig
endif
ifeq ($(BR2_PACKAGE_LINUX_USE_KCONFIG),y)
- cp -dpf $(LINUX26_KCONFIG) $(LINUX26_DIR)/.config
+ # Try user defined config
+ if [ -f "$(LINUX26_KCONFIG)" ] ; then \
+ cp -dpf $(LINUX26_KCONFIG) $@ ; \
+ fi
+ # Try to get a config for this linux version in the board directory
+ if [ ! -f "$(LINUX26_DIR)/.config" ] ; then \
+ if [ -f "$(BOARD_PATH)/$(BOARD_NAME)-linux-$(LINUX26_VERSION).config" ] ; then \
+ cp -dpf $(BOARD_PATH)/$(BOARD_NAME)-linux-$(LINUX26_VERSION).config $@ ; \
+ fi ; \
+ fi
+ # Try to get a config for latest linux version in the board directory
+ if [ ! -f "$(LINUX26_DIR)/.config" ] ; then \
+ scripts/get_linux_config.sh $(BOARD_PATH) $(LINUX26_DIR) ; \
+ fi
+ # Use a board config defined in the linux source.
+ if [ ! -f "$(LINUX26_DIR)/.config" ] ; then \
+ $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) $(BOARD_NAME)_defconfig || \
+ echo "$(BOARD_NAME)_defconfig failed..." ; \
+ fi
+ # let the user create his/her own config
+ if [ ! -f "$(LINUX26_DIR)/.config" ] ; then \
+ $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) xconfig ; \
+ fi
endif
+
+# -----------------------------------------------------------------------------
+$(LINUX26_DIR)/.configured: $(LINUX26_DIR)/.config
$(SED) '/CONFIG_AEABI=y/d' $(LINUX26_DIR)/.config
ifeq ($(BR2_ARM_EABI),y)
echo "CONFIG_AEABI=y" >> $(LINUX26_DIR)/.config