summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-05 18:27:26 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-05 18:27:26 +0000
commit6783ea57900a20ac2cf0d85880dd9b4181083852 (patch)
tree12bf866205c13ecdaf98a65158c3d7e48af41cde
parentbabfc9eff82505e92e33e125e9c17be859e54e6f (diff)
downloadpx4-nuttx-6783ea57900a20ac2cf0d85880dd9b4181083852.tar.gz
px4-nuttx-6783ea57900a20ac2cf0d85880dd9b4181083852.tar.bz2
px4-nuttx-6783ea57900a20ac2cf0d85880dd9b4181083852.zip
Fix a bug in 'make export' introduced recently
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4265 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/Makefile2
-rwxr-xr-xnuttx/tools/mkexport.sh27
2 files changed, 23 insertions, 6 deletions
diff --git a/nuttx/Makefile b/nuttx/Makefile
index 7bda2b9e0..a5cf3a434 100644
--- a/nuttx/Makefile
+++ b/nuttx/Makefile
@@ -518,7 +518,7 @@ pass2dep: context
# that the archiver is 'ar'
export: pass2deps
- @tools/mkexport.sh -t "$(TOPDIR)" -l "$(NUTTXLIBS)"
+ @tools/mkexport.sh -w$(WINTOOL) -t "$(TOPDIR)" -l "$(NUTTXLIBS)"
# General housekeeping targets: dependencies, cleaning, etc.
#
diff --git a/nuttx/tools/mkexport.sh b/nuttx/tools/mkexport.sh
index a65c7894d..7ddeae699 100755
--- a/nuttx/tools/mkexport.sh
+++ b/nuttx/tools/mkexport.sh
@@ -1,8 +1,8 @@
#!/bin/bash
# tools/mkexport.sh
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
-# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -41,10 +41,11 @@
# Get the input parameter list
-USAGE="USAGE: $0 [-d] [-z] -t <top-dir> [-x <lib-ext>] -l \"lib1 [lib2 [lib3 ...]]\""
+USAGE="USAGE: $0 [-d] [-z] [-w|wy|wn] -t <top-dir> [-x <lib-ext>] -l \"lib1 [lib2 [lib3 ...]]\""
unset TOPDIR
unset LIBLIST
unset TGZ
+WINTOOL=n
LIBEXT=.a
while [ ! -z "$1" ]; do
@@ -56,6 +57,12 @@ while [ ! -z "$1" ]; do
shift
LIBLIST=$1
;;
+ -wy )
+ WINTOOL=y
+ ;;
+ -w | -wn )
+ WINTOOL=n
+ ;;
-t )
shift
TOPDIR=$1
@@ -277,14 +284,24 @@ 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}"
+ if [ "X${WINTOOL}" = "Xy" ]; then
+ WLIB=`cygpath -w "${TOPDIR}/${lib}"`
+ ${AR} x "${WLIB}"
+ else
+ ${AR} x "${TOPDIR}/${lib}"
+ fi
# 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}"
+ if [ "X${WINTOOL}" = "Xy" ]; then
+ WLIB=`cygpath -w "${EXPORTDIR}/libs/libnuttx${LIBEXT}"`
+ ${AR} rcs "${WLIB}" "${shortname}-${file}"
+ else
+ ${AR} rcs "${EXPORTDIR}/libs/libnuttx${LIBEXT}" "${shortname}-${file}"
+ fi
done
cd "${TOPDIR}" || \