Improve configure.sh behavior (proposal).

- enable to call from top directory.
 - enable to designate direct path for config.
 - install .gdbinit if the target has.
This commit is contained in:
Hidetaka Takano 2017-06-15 21:12:56 +09:00
parent 9edf43abc1
commit d155939258

View File

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