]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - mkconfig
cmd_i2c: moved a define to before the functions
[karo-tx-uboot.git] / mkconfig
index bdc9d91d17198cd3e2d5252a8bdae902ff14bff2..0f7f13e3a4d836d6bb8a1ab18b34e63a4125cc2c 100755 (executable)
--- a/mkconfig
+++ b/mkconfig
@@ -27,6 +27,11 @@ done
 [ $# -lt 4 ] && exit 1
 [ $# -gt 6 ] && exit 1
 
+if [ "${ARCH}" -a "${ARCH}" != "$2" ]; then
+       echo "Failed: \$ARCH=${ARCH}, should be '$2' for ${BOARD_NAME}" 1>&2
+       exit 1
+fi
+
 echo "Configuring for ${BOARD_NAME} board..."
 
 #
@@ -96,9 +101,11 @@ for i in ${TARGETS} ; do
        echo "#define CONFIG_MK_${i} 1" >>config.h ;
 done
 
-echo "#define CONFIG_BOARDDIR board/$BOARDDIR" >>config.h
-
-echo "#include <configs/$1.h>" >>config.h
-echo "#include <asm/config.h>" >>config.h
+cat << EOF >> config.h
+#define CONFIG_BOARDDIR board/$BOARDDIR
+#include <config_defaults.h>
+#include <configs/$1.h>
+#include <asm/config.h>
+EOF
 
 exit 0