Skip to contentSkip to conversation

consistent xeno-config output

PATCH In review Jan Kiszka 2 participants 7 messages Jan 28, 2008 – Feb 4, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 consistent xeno-config output

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
scripts/xeno-config.in +27 -22
Index: xenomai/scripts/xeno-config.in
===================================================================
@@ -23,6 +23,23 @@ XENO_LIBRARY_DIR="${staging}${libdir}"
 
 unset prefix exec_prefix libdir datadir datarootdir pkgdatadir includedir
 
+posix_ldflags ()
+{
+    if test \! -r $XENO_POSIX_WRAPPERS; then
+        echo "POSIX support is not available" >&2
+        exit 1
+    fi
+    if test "$XENO_POSIX_FAST_WRAPPING" = "yes"; then
+        echo -n "-Wl,@$XENO_POSIX_WRAPPERS $XENO_POSIX_LDFLAGS"
+    else
+        wrappers=`cat $XENO_POSIX_WRAPPERS | \
+            while read wrap_option symbol; do \
+                echo -n "-Wl,$wrap_option,$symbol " ; \
+            done`
+        echo -n "$wrappers $XENO_POSIX_LDFLAGS"
+    fi
+}
+
 usage ()
 {
 cat <<EOF
@@ -46,15 +63,15 @@ EOF
 verbose ()
 {
     echo xeno-config --verbose
-    echo "   " --version="\"${XENO_VERSION}\""
-    echo "   " --cc="\"$XENO_CC\""
-    echo "   " --arch="\"$XENO_TARGET_ARCH\""
-    echo "   " --prefix="\"$XENO_PREFIX\""
-    echo "   " --xeno-cflags="\"$XENO_BASE_CFLAGS\""
-    echo "   " --xeno-ldflags="\"$XENO_BASE_LDFLAGS\""
-    echo "   " --posix-cflags="\"$XENO_POSIX_CFLAGS\""
-    echo "   " --posix-ldflags="\"$XENO_POSIX_LDFLAGS\""
-    echo "   " --library-dir="\"$XENO_LIBRARY_DIR\""
+    echo "        --version=\"${XENO_VERSION}\""
+    echo "        --cc=\"$XENO_CC\""
+    echo "        --arch=\"$XENO_TARGET_ARCH\""
+    echo "        --prefix=\"$XENO_PREFIX\""
+    echo "        --xeno-cflags=\"$XENO_BASE_CFLAGS\""
+    echo "        --xeno-ldflags=\"$XENO_BASE_LDFLAGS\""
+    echo "        --posix-cflags=\"$XENO_POSIX_CFLAGS\""
+    echo "        --posix-ldflags=\"`posix_ldflags`\""
+    echo "        --library-dir=\"$XENO_LIBRARY_DIR\""
 }
 
 if test $# -eq 0; then
@@ -90,19 +107,7 @@ while test $# -gt 0; do
             echo $XENO_POSIX_CFLAGS
             ;;
         --posix-ldflags)
-            if test \! -r $XENO_POSIX_WRAPPERS; then
-               echo "POSIX support is not available" >&2
-               exit 1
-            fi
-            if test "$XENO_POSIX_FAST_WRAPPING" = "yes"; then
-                echo "-Wl,@$XENO_POSIX_WRAPPERS $XENO_POSIX_LDFLAGS"
-            else
-                wrappers=`cat $XENO_POSIX_WRAPPERS | \
-                    while read wrap_option symbol; do \
-                        echo -n "-Wl,$wrap_option,$symbol " ; \
-                    done`
-                echo "$wrappers $XENO_POSIX_LDFLAGS"
-            fi
+            echo `posix_ldflags`
             ;;
         --lib*-dir|--libdir|--user-libdir)
             echo $XENO_LIBRARY_DIR
#1 lore raw
Quoted 2 lines · Jan Kiszka

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Useless use of cat detected ! When parsing posix.wrappers, we could redirect input from posix.wrappers instead of using cat.

Signature · 1 line
                                               Gilles Chanteperdrix
author
#2 lore raw
Quoted 7 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Useless use of cat detected ! When parsing posix.wrappers, we could redirect input from posix.wrappers instead of using cat.

OK. Is this one better?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
---
 scripts/xeno-config.in |   48 ++++++++++++++++++++++++++----------------------
 1 file changed, 26 insertions(+), 22 deletions(-)
scripts/xeno-config.in +26 -22
Index: b/scripts/xeno-config.in
===================================================================
@@ -23,6 +23,22 @@ XENO_LIBRARY_DIR="${staging}${libdir}"
 
 unset prefix exec_prefix libdir datadir datarootdir pkgdatadir includedir
 
+posix_ldflags ()
+{
+    if test \! -r $XENO_POSIX_WRAPPERS; then
+        echo "POSIX support is not available" >&2
+        exit 1
+    fi
+    if test "$XENO_POSIX_FAST_WRAPPING" = "yes"; then
+        echo -n "-Wl,@$XENO_POSIX_WRAPPERS $XENO_POSIX_LDFLAGS"
+    else
+        wrappers=`while read wrap_option symbol; do \
+                      echo -n "-Wl,$wrap_option,$symbol " ; \
+                  done < $XENO_POSIX_WRAPPERS`
+        echo -n "$wrappers $XENO_POSIX_LDFLAGS"
+    fi
+}
+
 usage ()
 {
 cat <<EOF
@@ -46,15 +62,15 @@ EOF
 verbose ()
 {
     echo xeno-config --verbose
-    echo "   " --version="\"${XENO_VERSION}\""
-    echo "   " --cc="\"$XENO_CC\""
-    echo "   " --arch="\"$XENO_TARGET_ARCH\""
-    echo "   " --prefix="\"$XENO_PREFIX\""
-    echo "   " --xeno-cflags="\"$XENO_BASE_CFLAGS\""
-    echo "   " --xeno-ldflags="\"$XENO_BASE_LDFLAGS\""
-    echo "   " --posix-cflags="\"$XENO_POSIX_CFLAGS\""
-    echo "   " --posix-ldflags="\"$XENO_POSIX_LDFLAGS\""
-    echo "   " --library-dir="\"$XENO_LIBRARY_DIR\""
+    echo "        --version=\"${XENO_VERSION}\""
+    echo "        --cc=\"$XENO_CC\""
+    echo "        --arch=\"$XENO_TARGET_ARCH\""
+    echo "        --prefix=\"$XENO_PREFIX\""
+    echo "        --xeno-cflags=\"$XENO_BASE_CFLAGS\""
+    echo "        --xeno-ldflags=\"$XENO_BASE_LDFLAGS\""
+    echo "        --posix-cflags=\"$XENO_POSIX_CFLAGS\""
+    echo "        --posix-ldflags=\"`posix_ldflags`\""
+    echo "        --library-dir=\"$XENO_LIBRARY_DIR\""
 }
 
 if test $# -eq 0; then
@@ -90,19 +106,7 @@ while test $# -gt 0; do
             echo $XENO_POSIX_CFLAGS
             ;;
         --posix-ldflags)
-            if test \! -r $XENO_POSIX_WRAPPERS; then
-               echo "POSIX support is not available" >&2
-               exit 1
-            fi
-            if test "$XENO_POSIX_FAST_WRAPPING" = "yes"; then
-                echo "-Wl,@$XENO_POSIX_WRAPPERS $XENO_POSIX_LDFLAGS"
-            else
-                wrappers=`cat $XENO_POSIX_WRAPPERS | \
-                    while read wrap_option symbol; do \
-                        echo -n "-Wl,$wrap_option,$symbol " ; \
-                    done`
-                echo "$wrappers $XENO_POSIX_LDFLAGS"
-            fi
+            echo `posix_ldflags`
             ;;
         --lib*-dir|--libdir|--user-libdir)
             echo $XENO_LIBRARY_DIR
#3 lore raw
Quoted 10 lines · Jan Kiszka
Quoted 7 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Useless use of cat detected ! When parsing posix.wrappers, we could redirect input from posix.wrappers instead of using cat.

OK. Is this one better?

I would say there is still a useless use of backticks, why use:
echo posix_ldflags
instead of simply:
posix_ldflags
echo

?

Signature · 1 line
                                               Gilles Chanteperdrix
author
#4 lore raw
Quoted 10 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Useless use of cat detected ! When parsing posix.wrappers, we could redirect input from posix.wrappers instead of using cat.

OK. Is this one better?

Quoted 7 lines

I would say there is still a useless use of backticks, why use:
echo posix_ldflags
instead of simply:
posix_ldflags
echo

?

So shall it be. :)

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
---
 ChangeLog              |    4 ++++
 scripts/xeno-config.in |   49 +++++++++++++++++++++++++++----------------------
 2 files changed, 31 insertions(+), 22 deletions(-)
scripts/xeno-config.in +27 -22
Index: b/scripts/xeno-config.in
===================================================================
@@ -23,6 +23,22 @@ XENO_LIBRARY_DIR="${staging}${libdir}"
 
 unset prefix exec_prefix libdir datadir datarootdir pkgdatadir includedir
 
+posix_ldflags ()
+{
+    if test \! -r $XENO_POSIX_WRAPPERS; then
+        echo "POSIX support is not available" >&2
+        exit 1
+    fi
+    if test "$XENO_POSIX_FAST_WRAPPING" = "yes"; then
+        echo -n "-Wl,@$XENO_POSIX_WRAPPERS $XENO_POSIX_LDFLAGS"
+    else
+        wrappers=`while read wrap_option symbol; do \
+                      echo -n "-Wl,$wrap_option,$symbol " ; \
+                  done < $XENO_POSIX_WRAPPERS`
+        echo -n "$wrappers $XENO_POSIX_LDFLAGS"
+    fi
+}
+
 usage ()
 {
 cat <<EOF
@@ -46,15 +62,15 @@ EOF
 verbose ()
 {
     echo xeno-config --verbose
-    echo "   " --version="\"${XENO_VERSION}\""
-    echo "   " --cc="\"$XENO_CC\""
-    echo "   " --arch="\"$XENO_TARGET_ARCH\""
-    echo "   " --prefix="\"$XENO_PREFIX\""
-    echo "   " --xeno-cflags="\"$XENO_BASE_CFLAGS\""
-    echo "   " --xeno-ldflags="\"$XENO_BASE_LDFLAGS\""
-    echo "   " --posix-cflags="\"$XENO_POSIX_CFLAGS\""
-    echo "   " --posix-ldflags="\"$XENO_POSIX_LDFLAGS\""
-    echo "   " --library-dir="\"$XENO_LIBRARY_DIR\""
+    echo "        --version=\"${XENO_VERSION}\""
+    echo "        --cc=\"$XENO_CC\""
+    echo "        --arch=\"$XENO_TARGET_ARCH\""
+    echo "        --prefix=\"$XENO_PREFIX\""
+    echo "        --xeno-cflags=\"$XENO_BASE_CFLAGS\""
+    echo "        --xeno-ldflags=\"$XENO_BASE_LDFLAGS\""
+    echo "        --posix-cflags=\"$XENO_POSIX_CFLAGS\""
+    echo "        --posix-ldflags=\"`posix_ldflags`\""
+    echo "        --library-dir=\"$XENO_LIBRARY_DIR\""
 }
 
 if test $# -eq 0; then
@@ -90,19 +106,8 @@ while test $# -gt 0; do
             echo $XENO_POSIX_CFLAGS
             ;;
         --posix-ldflags)
-            if test \! -r $XENO_POSIX_WRAPPERS; then
-               echo "POSIX support is not available" >&2
-               exit 1
-            fi
-            if test "$XENO_POSIX_FAST_WRAPPING" = "yes"; then
-                echo "-Wl,@$XENO_POSIX_WRAPPERS $XENO_POSIX_LDFLAGS"
-            else
-                wrappers=`cat $XENO_POSIX_WRAPPERS | \
-                    while read wrap_option symbol; do \
-                        echo -n "-Wl,$wrap_option,$symbol " ; \
-                    done`
-                echo "$wrappers $XENO_POSIX_LDFLAGS"
-            fi
+            posix_ldflags
+            echo
             ;;
         --lib*-dir|--libdir|--user-libdir)
             echo $XENO_LIBRARY_DIR
ChangeLog +4 -0
Index: b/ChangeLog
===================================================================
@@ -1,3 +1,7 @@
+2008-01-26  Jan Kiszka  <[email protected]>
+
+	* scripts/xeno-config.in: Ensure consistent output of posix-ldflags.
+
 2008-01-27  Jan Kiszka  <[email protected]>
 
 	* ksrc/arch/x86/hal-common.c: Fix race when starting the cleanup
author
#5 lore raw
Quoted 16 lines · Jan Kiszka
Quoted 15 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Useless use of cat detected ! When parsing posix.wrappers, we could redirect input from posix.wrappers instead of using cat.

OK. Is this one better?

I would say there is still a useless use of backticks, why use:
echo posix_ldflags
instead of simply:
posix_ldflags
echo

Quoted 4 lines
Quoted 1 line

?

So shall it be. :)

I'm going to commit the last version to trunk and 2.4.x. OK?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#6 lore raw
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 15 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

I received some complaint that xeno-config [--verbose] does not match xeno-config --posix-ldflags. Here is a fix.

Useless use of cat detected ! When parsing posix.wrappers, we could redirect input from posix.wrappers instead of using cat.

OK. Is this one better?

I would say there is still a useless use of backticks, why use:
echo posix_ldflags
instead of simply:
posix_ldflags
echo

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

?

So shall it be. :)

I'm going to commit the last version to trunk and 2.4.x. OK?

Ok for me.

Signature · 1 line
                                               Gilles Chanteperdrix