From 4cb5a352280f164a39fc94d23a4256dad20508ec Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 24 Sep 2015 15:34:21 +0000 Subject: [PATCH] Add removedir= argument; use cd ; pwd -P to obtain absolute path; use defs.h header in gdb_get_stdin.c source git-svn-id: trunk@31816 - --- packages/gdbint/gen-gdblib-inc.sh | 40 +++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/packages/gdbint/gen-gdblib-inc.sh b/packages/gdbint/gen-gdblib-inc.sh index 5d402fee1b..8afb1d6e7d 100755 --- a/packages/gdbint/gen-gdblib-inc.sh +++ b/packages/gdbint/gen-gdblib-inc.sh @@ -13,6 +13,7 @@ usage () echo "should be copied." echo "Possible parameters for this script:" echo "--forcestatic, to convert all -lname into $LINKLIB libname.a" + echo "removedir=\"space separated list of directories to remove\"" echo "implicitlibs=\"space separated list of used system libraries\"" echo "libdir=\"space separated list of library directories\"" } @@ -146,12 +147,20 @@ if [ "${1#libdir=}" != "$1" ]; then opt_handled=1 fi -if [ "${1//=/ }" != "$1" ]; then - # Some variable set explicitly - echo "Evaluating $1" - export $1 +if [ "${1#removedir=}" != "$1" ]; then + removedir=${1#removedir=} + echo "removedir is set to \"$removedir\"" opt_handled=1 fi + +if [ $opthandled -eq 0 ] ; then + if [ "${1//=/ }" != "$1" ]; then + # Some variable set explicitly + echo "Evaluating \"$1\"" + export "$1" + opt_handled=1 + fi +fi } # Try to handle all command line options @@ -188,7 +197,7 @@ ${MAKE} gdb${EXEEXT} ${MAKEOPT} LDFLAGS="$LDFLAGS" 2>&1 | tee make.log # To avoid stdin macro expansion hell. cat > gdb_get_stdin.c < /dev/null && pwd -P` + if [ "X$newdir" != "X" ] ; then + adddir=1 + for rdir in $removedir ; do + if [ "$rdir" == "$newdir" ] ; then + adddir=0 + fi + done + if [ $adddir -eq 1 ] ; then + newlibdir="$newlibdir $newdir" + echo "Adding $dir as $newdir" + fi + else + echo "$dir not found" + fi +done +libdir="$newlibdir" + # Try to locate all libraries echo Creating ./copy-libs.sh script has_libgdb=`cat comp-cmd.log | grep "libgdb\.a"`