Module: xenomai-forge
Branch: next
Commit: aa1ef26327ba8812bbfbe219984cbd75b2f6626f
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=aa1ef26327ba8812bbfbe219984cbd75b2f6626f

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Apr  8 12:16:05 2014 +0200

scripts/xeno-config: introduce --kcflags

This switch dumps the CFLAGS required for building over a given kernel
API. Just like with --cflags, --skin must mention the API of choice.

--[skin=]rtdm --kcflags is available for retrieving the kernel CFLAGS
  required for building a RTDM driver. Typically, a Makefile frag
  would do:

  ccflags-y := $(shell xeno-config --rtdm --kcflags)

---

 scripts/xeno-config-cobalt.in  |   29 ++++++++++++++++++++++++-----
 scripts/xeno-config-mercury.in |   26 ++++++++++++++++++++++----
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index 665efc2..481dce0 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -52,9 +52,10 @@ Options :
         --ccld
         --arch
         --prefix
-        --[skin=]posix/cobalt|vxworks|psos|alchemy
+        --[skin=]posix/cobalt|vxworks|psos|alchemy|rtdm
         --auto-init|no-auto-init
         --cflags
+        --kcflags
         --ldflags
         --lib*-dir,--libdir,--user-libdir
         --core
@@ -120,30 +121,48 @@ while test $# -gt 0; do
                skin_list="$skin_list `expr "$1" : '--skin=\(.*\)'`"
            fi
            ;;
-       --posix|--cobalt|--vxworks|--psos|--alchemy)
+       --posix|--cobalt|--vxworks|--psos|--alchemy|--rtdm)
            skin_list="$skin_list `expr "$1" : '--\(.*\)'`"
            ;;
        --cflags)
            if test -z "$skin_list"; then
-               echo "no skin specified, missing --skin before --cflags" 1>&2
+               echo "no RTOS skin specified, missing --skin before --cflags" 
1>&2
                exit 1
            fi
            cflags="$XENO_BASE_CFLAGS"
            for skin in $skin_list; do
                case "$skin" in
-                   posix|cobalt)
+                   posix|cobalt|rtdm)
                        ;;
                    vxworks|psos|alchemy)
                        cflags="$cflags -I$XENO_INCLUDE_DIR/$skin"
                        ;;
                    *)
-                       echo "unknown skin: $skin" 1>&2
+                       echo "unknown RTOS skin: $skin" 1>&2
                        exit 1
                        ;;
                esac
            done
            echo $cflags
            ;;
+       --kcflags)
+           if test -z "$skin_list"; then
+               echo "no kernel API specified, missing --skin before --kcflags" 
1>&2
+               exit 1
+           fi
+           for skin in $skin_list; do
+               case "$skin" in
+                   rtdm)
+                       kcflags='-Iarch/$(SRCARCH)/xenomai/include 
-Iinclude/xenomai'
+                       ;;
+                   *)
+                       echo "unknown kernel API: $skin" 1>&2
+                       exit 1
+                       ;;
+               esac
+           done
+           echo $kcflags
+           ;;
        --ldflags)
            if test -z "$skin_list"; then
                echo "no skin specified, missing --skin before --ldflags" 1>&2
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index 3b9c1c9..98b847e 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -34,7 +34,7 @@ Options :
         --ccld
         --arch
         --prefix
-        --[skin=]vxworks|psos|alchemy
+        --[skin=]vxworks|psos|alchemy|rtdm
         --auto-init|no-auto-init
         --cflags
         --ldflags
@@ -99,12 +99,12 @@ while test $# -gt 0; do
                skin_list="$skin_list `expr "$1" : '--skin=\(.*\)'`"
            fi
            ;;
-       --vxworks|--psos|--alchemy)
+       --vxworks|--psos|--alchemy|--rtdm
            skin_list="$skin_list `expr "$1" : '--\(.*\)'`"
            ;;
        --cflags)
            if test -z "$skin_list"; then
-               echo "no skin specified, missing --skin before --cflags" 1>&2
+               echo "no RTOS skin specified, missing --skin before --cflags" 
1>&2
                exit 1
            fi
            cflags="$XENO_BASE_CFLAGS"
@@ -114,13 +114,31 @@ while test $# -gt 0; do
                        cflags="$cflags -I$XENO_INCLUDE_DIR/$skin"
                        ;;
                    *)
-                       echo "unknown skin: $skin" 1>&2
+                       echo "unknown RTOS skin: $skin" 1>&2
                        exit 1
                        ;;
                esac
            done
            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
+           done
+           echo $kcflags
+           ;;
        --ldflags)
            if test -z "$skin_list"; then
                echo "no skin specified, missing --skin before --ldflags" 1>&2


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

Reply via email to