Module: xenomai-3
Branch: wip/dovetail
Commit: 24bfe96f6a7711ed6490513e924ebf572e8fc112
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=24bfe96f6a7711ed6490513e924ebf572e8fc112

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Apr 22 10:46:49 2016 +0200

scripts/xeno-config: catch misusage of --[no-]auto-init

---

 scripts/xeno-config-cobalt.in  |    8 ++++++++
 scripts/xeno-config-mercury.in |    8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index eefc0d9..fec0e28 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -108,6 +108,7 @@ fi
 
 do_ldflags=
 do_cflags=
+do_setinit=
 
 while test $# -gt 0; do
     case "$1" in
@@ -131,9 +132,11 @@ while test $# -gt 0; do
             echo $XENO_PREFIX
             ;;
        --no-auto-init)
+           do_setinit=y
            WRAP_MAIN=
            ;;
        --auto-init)
+           do_setinit=y
            WRAP_MAIN="$WRAP_MAIN_OPT"
            ;;
         --lib*-dir|--libdir|--user-libdir)
@@ -184,6 +187,11 @@ while test $# -gt 0; do
     shift
 done
 
+if test x$do_setinit = xy -a x$do_ldflags = x; then
+       echo "--[no-]auto-init is meaningful only with --ldflags" 1>&2
+       exit 1
+fi
+
 if test x$do_cflags = xy; then
     if test -z "$skin_list"; then
        echo "no API specified, missing --skin before --cflags" 1>&2
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index 77cf89c..04fed80 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -79,6 +79,7 @@ fi
 
 do_ldflags=
 do_cflags=
+do_setinit=
 
 while test $# -gt 0; do
     case "$1" in
@@ -99,9 +100,11 @@ while test $# -gt 0; do
             echo $XENO_PREFIX
             ;;
        --no-auto-init)
+           do_setinit=y
            WRAP_MAIN=
            ;;
        --auto-init)
+           do_setinit=y
            WRAP_MAIN="$WRAP_MAIN_OPT"
            ;;
         --lib*-dir|--libdir|--user-libdir)
@@ -148,6 +151,11 @@ while test $# -gt 0; do
     shift
 done
 
+if test x$do_setinit = xy -a x$do_ldflags = x; then
+       echo "--[no-]auto-init is meaningful only with --ldflags" 1>&2
+       exit 1
+fi
+
 if test x$do_cflags = xy; then
     cflags="$XENO_BASE_CFLAGS"
     test -z "$skin_list" && skin_list=posix


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

Reply via email to