-$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
- (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
- ac_cv_linux_vers=$(BR2_DEFAULT_KERNEL_HEADERS) \
- BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
+$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
+ mkdir -p $(BUILD_DIR)/$(PKG_NAME)
+ $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR)/$(PKG_NAME) $(TAR_OPTIONS) -
+ $(PATCH) $(PKG_BUILD_DIR) ./patches
+ touch $(PKG_BUILD_DIR)/.prepared
+
+$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+ (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \