diff options
Diffstat (limited to 'nuttx/tools/configure.sh')
-rwxr-xr-x | nuttx/tools/configure.sh | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/nuttx/tools/configure.sh b/nuttx/tools/configure.sh index 1cba7805f..5bff89922 100755 --- a/nuttx/tools/configure.sh +++ b/nuttx/tools/configure.sh @@ -135,11 +135,15 @@ fi # Extract values needed from the defconfig file. We need: # (1) The CONFIG_NUTTX_NEWCONFIG setting to know if this is a "new" style -# configuration, and -# (2) The CONFIG_APPS_DIR to see if there is a configured location for the -# application directory. +# configuration, +# (2) The CONFIG_WINDOWS_NATIVE setting to know it this is target for a +# native Windows (meaning that we want setenv.bat vs setenv.sh and we need +# to use backslashes in the CONFIG_APPS_DIR setting). +# (3) The CONFIG_APPS_DIR setting to see if there is a configured location for the +# application directory. This can be overridden from the command line. newconfig=`grep CONFIG_NUTTX_NEWCONFIG= "${src_config}" | cut -d'=' -f2` +winnative=`grep CONFIG_WINDOWS_NATIVE= "${src_config}" | cut -d'=' -f2` defappdir=y if [ -z "${appdir}" ]; then @@ -175,24 +179,29 @@ if [ -z "${appdir}" ]; then fi fi +# For checking the apps dir path, we need a POSIX version of the relative path. + +posappdir=`echo "${appdir}" | sed -e "s/\\/\/g"` +winappdir=`echo "${appdir}" | sed -e "s/\//\\/g"` + # If appsdir was provided (or discovered) then make sure that the apps/ # directory exists -if [ ! -z "${appdir}" -a ! -d "${TOPDIR}/${appdir}" ]; then - echo "Directory \"${TOPDIR}/${appdir}\" does not exist" +if [ ! -z "${appdir}" -a ! -d "${TOPDIR}/${posappdir}" ]; then + echo "Directory \"${TOPDIR}/${posappdir}\" does not exist" exit 7 fi # Okay... Everything looks good. Setup the configuration -install -C "${src_makedefs}" "${dest_makedefs}" || \ +install "${src_makedefs}" "${dest_makedefs}" || \ { echo "Failed to copy \"${src_makedefs}\"" ; exit 7 ; } if [ "X${have_setenv}" = "Xy" ]; then - install -C "${src_setenv}" "${dest_setenv}" || \ + install "${src_setenv}" "${dest_setenv}" || \ { echo "Failed to copy ${src_setenv}" ; exit 8 ; } chmod 755 "${dest_setenv}" fi -install -C "${src_config}" "${tmp_config}" || \ +install "${src_config}" "${tmp_config}" || \ { echo "Failed to copy \"${src_config}\"" ; exit 9 ; } # If we did not use the CONFIG_APPS_DIR that was in the defconfig config file, @@ -204,7 +213,11 @@ if [ "X${defappdir}" = "Xy" ]; then echo "" >> "${tmp_config}" echo "# Application configuration" >> "${tmp_config}" echo "" >> "${tmp_config}" - echo "CONFIG_APPS_DIR=\"$appdir\"" >> "${tmp_config}" + if [ "X${winnative)" = "Xy" ]; then + echo "CONFIG_APPS_DIR=\"$winappdir\"" >> "${tmp_config}" + else + echo "CONFIG_APPS_DIR=\"$posappdir\"" >> "${tmp_config}" + fi fi # Copy appconfig file. The appconfig file will be copied to ${appdir}/.config @@ -215,7 +228,7 @@ if [ ! -z "${appdir}" -a "X${newconfig}" != "Xy" ]; then if [ ! -r "${configpath}/appconfig" ]; then echo "NOTE: No readable appconfig file found in ${configpath}" else - install -C "${configpath}/appconfig" "${TOPDIR}/${appdir}/.config" || \ + install "${configpath}/appconfig" "${TOPDIR}/${posappdir}/.config" || \ { echo "Failed to copy ${configpath}/appconfig" ; exit 10 ; } fi fi @@ -223,6 +236,5 @@ fi # install the final .configX only if it differs from any existing # .config file. -install -C "${tmp_config}" "${dest_config}" +install "${tmp_config}" "${dest_config}" rm -f "${tmp_config}" - |