Module: xenomai-3
Branch: master
Commit: 19fac3c4d1f69296643608943b02ea6b219e6ed1
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=19fac3c4d1f69296643608943b02ea6b219e6ed1

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Nov 16 16:56:19 2014 +0100

scripts/xeno-config: add some implicit defaults

Mercury: --cflags/--ldflags without API specification => posix

Cobalt: --cflags/--ldflags without API specification => posix
        --kcflags without API specification => rtdm

---

 scripts/xeno-config-cobalt.in  |   17 +++++++----------
 scripts/xeno-config-mercury.in |   38 ++++++++++++--------------------------
 2 files changed, 19 insertions(+), 36 deletions(-)

diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index c6c6da5..3bd4850 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -158,7 +158,7 @@ while test $# -gt 0; do
            ;;
        --cflags)
            if test -z "$skin_list"; then
-               echo "no RTOS skin specified, missing --skin before --cflags" 
1>&2
+               echo "no API specified, missing --skin before --cflags" 1>&2
                exit 1
            fi
            cflags="$XENO_BASE_CFLAGS"
@@ -171,7 +171,7 @@ while test $# -gt 0; do
                        cflags="$cflags -I$XENO_INCLUDE_DIR/$skin"
                        ;;
                    *)
-                       echo "unknown RTOS skin: $skin" 1>&2
+                       echo "$skin is not a user-space API" 1>&2
                        exit 1
                        ;;
                esac
@@ -179,17 +179,14 @@ while test $# -gt 0; do
            echo $cflags
            ;;
        --kcflags)
-           if test -z "$skin_list"; then
-               echo "no kernel API specified, missing --skin before --kcflags" 
1>&2
-               exit 1
-           fi
+           test -z "$skin_list" && skin_list=rtdm
            for skin in $skin_list; do
                case "$skin" in
                    rtdm)
                        kcflags='-Iarch/$(SRCARCH)/xenomai/include 
-Iinclude/xenomai'
                        ;;
                    *)
-                       echo "unknown kernel API: $skin" 1>&2
+                       echo "$skin is not a kernel API (maybe --cflags?)" 1>&2
                        exit 1
                        ;;
                esac
@@ -198,7 +195,7 @@ while test $# -gt 0; do
            ;;
        --ldflags)
            if test -z "$skin_list"; then
-               echo "no skin specified, missing --skin before --ldflags" 1>&2
+               echo "no API specified, missing --skin before --ldflags" 1>&2
                exit 1
            fi
            ldflags=
@@ -206,7 +203,7 @@ while test $# -gt 0; do
            copperplate=
            for skin in $skin_list; do
                case "$skin" in
-                   posix|cobalt)
+                   posix|cobalt|rtdm)
                        ldflags="`dump_wrappers cobalt.wrappers` $ldflags"
                        ;;
                    vxworks|psos|alchemy|smokey)
@@ -217,7 +214,7 @@ while test $# -gt 0; do
                        fi
                        ;;
                    *)
-                       echo "unknown skin: $skin" 1>&2
+                       echo "unknown API: $skin" 1>&2
                        exit 1
                        ;;
                esac
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index 9311f4c..0615b10 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -122,18 +122,16 @@ while test $# -gt 0; do
            skin_list="$skin_list `expr "$1" : '--\(.*\)'`"
            ;;
        --cflags)
-           if test -z "$skin_list"; then
-               echo "no RTOS skin specified, missing --skin before --cflags" 
1>&2
-               exit 1
-           fi
-           cflags="$XENO_BASE_CFLAGS"
+           test -z "$skin_list" && skin_list=posix
            for skin in $skin_list; do
                case "$skin" in
                    vxworks|psos|alchemy|smokey)
                        cflags="$cflags -I$XENO_INCLUDE_DIR/$skin"
                        ;;
+                   posix|rtdm)
+                       ;;
                    *)
-                       echo "unknown RTOS skin: $skin" 1>&2
+                       echo "$skin is not a user-space API" 1>&2
                        exit 1
                        ;;
                esac
@@ -141,38 +139,25 @@ while test $# -gt 0; do
            echo $cflags
            ;;
        --kcflags)
-           if test -z "$skin_list"; then
-               echo "no kernel API specified, missing --skin before --kcflags" 
1>&2
-               exit 1
-           fi
-           kcflags=
            for skin in $skin_list; do
-               case "$skin" in
-                   rtdm)
-                       ;;
-                   *)
-                       echo "unknown kernel API: $skin" 1>&2
-                       exit 1
-                       ;;
-               esac
+               if test \! "$skin" = rtdm; then
+                   echo "$skin is not a kernel API (maybe --cflags?)" 1>&2
+                   exit 1
+               fi
            done
-           echo $kcflags
            ;;
        --ldflags)
-           if test -z "$skin_list"; then
-               echo "no skin specified, missing --skin before --ldflags" 1>&2
-               exit 1
-           fi
+           test -z "$skin_list" && skin_list=posix
            ldflags="$WRAP_MAIN $XENO_BASE_LDFLAGS"
            for skin in $skin_list; do
                case "$skin" in
-                   posix)
+                   posix|rtdm)
                        ;;
                    vxworks|psos|alchemy|smokey)
                        ldflags="-l$skin $ldflags"
                        ;;
                    *)
-                       echo "unknown skin: $skin" 1>&2
+                       echo "unknown API: $skin" 1>&2
                        exit 1
                        ;;
                esac
@@ -189,6 +174,7 @@ while test $# -gt 0; do
             dump_info
             ;;
         *)
+        echo "invalid option: $1" 1>&2
          usage 1 1>&2
          ;;
     esac


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to