From 8deca84debb66a97f9d57ed0299659196e31b5f2 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Dec 2011 12:44:39 +0000 Subject: Changes to tools to support MAC OS git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4232 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/tools/Makefile.export | 1 + nuttx/tools/configure.sh | 18 +++++++++--------- nuttx/tools/mkexport.sh | 11 ++++++----- 3 files changed, 16 insertions(+), 14 deletions(-) (limited to 'nuttx/tools') diff --git a/nuttx/tools/Makefile.export b/nuttx/tools/Makefile.export index 650dc7241..fa2909972 100644 --- a/nuttx/tools/Makefile.export +++ b/nuttx/tools/Makefile.export @@ -60,6 +60,7 @@ ifdef ARCHSCRIPT endif @echo "ARCHCFLAGS=\"$(ARCHCFLAGS) $(ARCHCPUFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh @echo "ARCHCXXFLAGS=\"$(ARCHCXXFLAGS) $(ARCHCPUFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "CROSSDEV=\"$(CROSSDEV)\"" >> $(EXPORTDIR)/makeinfo.sh @chmod 755 $(EXPORTDIR)/makeinfo.sh clean: diff --git a/nuttx/tools/configure.sh b/nuttx/tools/configure.sh index 1174534fe..a13e288be 100755 --- a/nuttx/tools/configure.sh +++ b/nuttx/tools/configure.sh @@ -142,12 +142,12 @@ fi # Okay... setup the configuration -cp -f "${configpath}/Make.defs" "${TOPDIR}/." || \ +install -C "${configpath}/Make.defs" "${TOPDIR}/." || \ { echo "Failed to copy ${configpath}/Make.defs" ; exit 7 ; } -cp -f "${configpath}/setenv.sh" "${TOPDIR}/." || \ +install -C "${configpath}/setenv.sh" "${TOPDIR}/." || \ { echo "Failed to copy ${configpath}/setenv.sh" ; exit 8 ; } chmod 755 "${TOPDIR}/setenv.sh" -cp -f "${configpath}/defconfig" "${TOPDIR}/.config" || \ +install -C "${configpath}/defconfig" "${TOPDIR}/.configX" || \ { echo "Failed to copy ${configpath}/defconfig" ; exit 9 ; } # Copy option appconfig @@ -156,13 +156,13 @@ if [ ! -z "${appdir}" ]; then if [ ! -r "${configpath}/appconfig" ]; then echo "NOTE: No readable appconfig file found in ${configpath}" else - cp -f "${configpath}/appconfig" "${TOPDIR}/${appdir}/.config" || \ + install -C "${configpath}/appconfig" "${TOPDIR}/${appdir}/.configX" || \ { echo "Failed to copy ${configpath}/appconfig" ; exit 10 ; } - echo "" >> "${TOPDIR}/.config" - echo "# Application configuration" >> "${TOPDIR}/.config" - echo "" >> "${TOPDIR}/.config" - echo "CONFIG_APPS_DIR=\"$appdir\"" >> "${TOPDIR}/.config" + echo "" >> "${TOPDIR}/.configX" + echo "# Application configuration" >> "${TOPDIR}/.configX" + echo "" >> "${TOPDIR}/.configX" + echo "CONFIG_APPS_DIR=\"$appdir\"" >> "${TOPDIR}/.configX" fi fi - +install -C "${TOPDIR}/.configX" "${TOPDIR}/.config" diff --git a/nuttx/tools/mkexport.sh b/nuttx/tools/mkexport.sh index 7da6d19eb..a65c7894d 100755 --- a/nuttx/tools/mkexport.sh +++ b/nuttx/tools/mkexport.sh @@ -169,7 +169,7 @@ if [ ! -z "${LDPATH}" ]; then # Copy the linker script - cp --preserve=all "${LDPATH}" "${EXPORTDIR}/build/." || \ + cp -p "${LDPATH}" "${EXPORTDIR}/build/." || \ { echo "MK: cp ${LDPATH} failed"; exit 1; } fi @@ -180,7 +180,7 @@ echo "ARCHCXXFLAGS = ${ARCHCXXFLAGS}" >>"${EXPORTDIR}/build/Make.defs" # Copy the NuttX include directory (retaining attributes and following symbolic links) -cp -LR --preserve=all "${TOPDIR}/include" "${EXPORTDIR}/." || \ +cp -LR -p "${TOPDIR}/include" "${EXPORTDIR}/." || \ { echo "MK: 'cp ${TOPDIR}/include' failed"; exit 1; } find "${EXPORTDIR}/include" -name .svn | xargs rm -rf @@ -251,6 +251,7 @@ fi # Then process each library +AR=${CROSSDEV}ar for lib in ${LIBLIST}; do if [ ! -f "${TOPDIR}/${lib}" ]; then echo "MK: Library ${TOPDIR}/${lib} does not exist" @@ -265,7 +266,7 @@ for lib in ${LIBLIST}; do # Copy the application library unmodified if [ "X${libname}" = "Xlibapps" ]; then - cp --preserve=all "${TOPDIR}/${lib}" "${EXPORTDIR}/libs/." || \ + cp -p "${TOPDIR}/${lib}" "${EXPORTDIR}/libs/." || \ { echo "MK: cp ${TOPDIR}/${lib} failed"; exit 1; } else @@ -276,14 +277,14 @@ for lib in ${LIBLIST}; do { echo "MK: 'mkdir ${EXPORTDIR}/tmp' failed"; exit 1; } cd "${EXPORTDIR}/tmp" || \ { echo "MK: 'cd ${EXPORTDIR}/tmp' failed"; exit 1; } - ar x "${TOPDIR}/${lib}" + ${AR} x "${TOPDIR}/${lib}" # Rename each object file (to avoid collision when they are combined) # and add the file to libnuttx for file in `ls`; do mv "${file}" "${shortname}-${file}" - ar rcs "${EXPORTDIR}/libs/libnuttx${LIBEXT}" "${shortname}-${file}" + ${AR} rcs "${EXPORTDIR}/libs/libnuttx${LIBEXT}" "${shortname}-${file}" done cd "${TOPDIR}" || \ -- cgit v1.2.3