Module: xenomai-rpm
Branch: for-upstream
Commit: 0ecb3d5e06a5f1970c98fcb439ce4ce2be44a969
URL:    
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=0ecb3d5e06a5f1970c98fcb439ce4ce2be44a969

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Feb 21 16:36:19 2010 +0100

wrap-link.sh: introduce dry run mode (-n)

---

 scripts/wrap-link.sh |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/scripts/wrap-link.sh b/scripts/wrap-link.sh
index 9014df1..80a2efb 100755
--- a/scripts/wrap-link.sh
+++ b/scripts/wrap-link.sh
@@ -14,6 +14,7 @@ Xenomai user-space posix skin in two stages.
 Options:
 -q be quiet
 -v be verbose (print each command before running it)
+-n dry run (print all commands but don't run any)
 
 Example:
 $1 -v gcc -o foo foo.o -Wl,@/usr/xenomai/lib/posix.wrappers -L/usr/xenomai/lib 
-lpthread_rt -lpthread -lrt
@@ -51,6 +52,7 @@ if test -n "$V" && test $V -gt 0; then
 else
     verbose=false
 fi
+dryrun=
 progname="$0"
 
 if test $# -eq 0; then
@@ -70,6 +72,10 @@ while test $# -gt 0; do
            verbose=false
            ;;
 
+       -n) 
+           dryrun="echo # "
+           ;;
+
        -*)
            cc="$cc $arg"
            ;;
@@ -91,6 +97,7 @@ while test $# -gt 0; do
     esac
 done
 
+test -z "$dryrun" || verbose=false
 next_is_wrapped_symbol=false
 
 onestage_args="$@"
@@ -177,10 +184,10 @@ done
 
 if $stage2; then
     $verbose && set -x
-    $cc -o "$output.tmp" -Wl,-Ur -nostdlib $stage1_args
-    $cc -o "$output" "$output.tmp" $stage2_args
-    rm -f $output.tmp
+    $dryrun $cc -o "$output.tmp" -Wl,-Ur -nostdlib $stage1_args
+    $dryrun $cc -o "$output" "$output.tmp" $stage2_args
+    $dryrun rm -f $output.tmp
 else
     $verbose && set -x
-    $cc -o "$output" $onestage_args
+    $dryrun $cc -o "$output" $onestage_args
 fi


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to