Merged in TJ-Hidetaka-Takano/nuttx-pr/feature/improve-configure (pull request #396)

Improve configure.sh behavior (proposal).

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Hidetaka 2017-06-15 12:57:45 +00:00 committed by Gregory Nutt
commit 2a723bdeb7

View File

@ -32,7 +32,7 @@
# POSSIBILITY OF SUCH DAMAGE.
#
WD=`pwd`
WD=`test -d ${0%/*} && cd ${0%/*}; pwd`
TOPDIR="${WD}/.."
USAGE="
@ -86,19 +86,23 @@ if [ -z "${boardconfig}" ]; then
fi
configpath=${TOPDIR}/configs/${boardconfig}
if [ ! -d "${configpath}" ]; then
# Try direct path for convenience.
configpath=${TOPDIR}/${boardconfig}
if [ ! -d "${configpath}" ]; then
echo "Directory ${configpath} does not exist. Options are:"
echo ""
echo "Select one of the following options for <board-name>:"
configlist=`find ${TOPDIR}/configs -name defconfig`
for defconfig in $configlist; do
config=`dirname $defconfig | sed -e "s,${TOPDIR}/configs/,,g"`
echo " $config"
for defconfig in ${configlist}; do
config=`dirname ${defconfig} | sed -e "s,${TOPDIR}/configs/,,g"`
echo " ${config}"
done
echo ""
echo "$USAGE"
exit 3
fi
fi
src_makedefs="${configpath}/Make.defs"
dest_makedefs="${TOPDIR}/Make.defs"
@ -176,6 +180,7 @@ install -m 644 "${src_makedefs}" "${dest_makedefs}" || \
{ echo "Failed to copy \"${src_makedefs}\"" ; exit 7 ; }
install -m 644 "${src_config}" "${dest_config}" || \
{ echo "Failed to copy \"${src_config}\"" ; exit 9 ; }
test -f "${configpath}/.gdbinit" && install "${configpath}/.gdbinit" "${TOPDIR}/"
# If we did not use the CONFIG_APPS_DIR that was in the defconfig config file,
# then append the correct application information to the tail of the .config