From 341cbb272b032fc69195d9f0b0bba10a723a4b34 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 5 Aug 2019 09:03:12 -0600 Subject: [PATCH] tools/configure.sh and configure.c. Update to preserve backward compatibility in usage. --- tools/configure.c | 16 +++++++++++----- tools/configure.sh | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/tools/configure.c b/tools/configure.c index 10a3945151a..2d04e5b7b75 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -1,7 +1,7 @@ /**************************************************************************** * tools/configure.c * - * Copyright (C) 2012, 2017-2018 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2017-2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -550,7 +550,7 @@ static void enumerate_configs(void) static void check_configdir(void) { - /* Get the path to the top level configuration directory */ + /* Get the path to the top level configuration directory: boards/ */ snprintf(g_buffer, BUFFER_SIZE, "%s%cboards", g_topdir, g_delim); debug("check_configdir: Checking configtop=%s\n", g_buffer); @@ -558,10 +558,12 @@ static void check_configdir(void) verify_directory(g_buffer); g_configtop = strdup(g_buffer); - /* Get and verify the path to the selected configuration */ + /* Get and verify the path to the selected configuration: + * boards//configs/ + */ - snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%c%s", - g_topdir, g_delim, g_delim, g_boarddir, g_delim, g_configdir); + snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%cconfigs%c%s", + g_topdir, g_delim, g_delim, g_boarddir, g_delim, g_delim, g_configdir); debug("check_configdir: Checking configpath=%s\n", g_buffer); if (!verify_optiondir(g_buffer)) @@ -573,6 +575,10 @@ static void check_configdir(void) g_configpath = strdup(g_buffer); + /* Get and verfy the path to the scripts directory: + * boards//scripts + */ + snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%cscripts", g_topdir, g_delim, g_delim, g_boarddir, g_delim); debug("check_configdir: Checking scriptspath=%s\n", g_buffer); diff --git a/tools/configure.sh b/tools/configure.sh index d472fafab95..f809539eb64 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -1,7 +1,7 @@ #!/bin/bash # tools/configure.sh # -# Copyright (C) 2007, 2008, 2011, 2015, 2017-2018 Gregory Nutt. All rights +# Copyright (C) 2007, 2008, 2011, 2015, 2017-2019 Gregory Nutt. All rights # reserved. # Author: Gregory Nutt # @@ -37,7 +37,7 @@ WD=`test -d ${0%/*} && cd ${0%/*}; pwd` TOPDIR="${WD}/.." USAGE=" -USAGE: ${0} [-d] [-l|m|c|u|g|n] [-a ] /configs/ +USAGE: ${0} [-d] [-l|m|c|u|g|n] [-a ] / Where: -l selects the Linux (l) host environment. @@ -108,7 +108,7 @@ while [ ! -z "$1" ]; do *) if [ ! -z "${boardconfig}" ]; then echo "" - echo " defined twice" + echo " defined twice" echo "$USAGE" exit 1 fi @@ -122,12 +122,15 @@ done if [ -z "${boardconfig}" ]; then echo "" - echo "Missing argument" + echo "Missing argument" echo "$USAGE" exit 2 fi -configpath=${TOPDIR}/boards/${boardconfig} +boarddir=`echo ${boardconfig} | cut -d'/' -f1` +configdir=`echo ${boardconfig} | cut -d'/' -f2` + +configpath=${TOPDIR}/boards/${boarddir}/configs/${configdir} if [ ! -d "${configpath}" ]; then # Try direct path for convenience. @@ -147,12 +150,11 @@ if [ ! -d "${configpath}" ]; then fi fi -src_makedefs="${configpath}/Make.defs" +src_makedefs="${TOPDIR}/boards/${boarddir}/configs/${configdir}/Make.defs" dest_makedefs="${TOPDIR}/Make.defs" if [ ! -r "${src_makedefs}" ]; then - boardpath=`dirname $configpath` - src_makedefs="${boardpath}/../scripts/Make.defs" + src_makedefs="${TOPDIR}/boards/${boarddir}/scripts/Make.defs" if [ ! -r "${src_makedefs}" ]; then echo "File Make.defs could not be found"