Skip to contentSkip to conversation

Cosmetic changes to script xeno-config + man page

Xenomai-core Romain Lenglet 3 participants 8 messages Oct 16, 2005 – Oct 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

Here is a man page that I have written for xeno-config. Philippe, you will have to create a "man" directory to contain that man file and an GNUmakefile.am file that contains:
man1_MANS = xeno-config.man
dist_man1_MANS = $(man1_MANS)

And add "man" to the SUBDIRS in the root GNUmakefile.am.

I will write man pages for xeno-info, xeno-load and xeno-test when I have some time this week.

By the way, I noticed that the output of function usage() in that script was wrong. Here is a correct version, to replace the one in scripts/xeno-config.in:
usage ()
{
cat <<EOF
Usage xeno-config OPTIONS
Options :

        --help
        -v,--verbose
        --version
        --cc
        --cross-compile
        --arch
        --subarch
        --prefix
        --config
        --mod*-cflags,--kernel-cflags
        --xeno-cflags,--fusion-cflags
        --xeno-ldflags,--fusion-ldflags
        --posix-cflags
        --posix-ldflags
        --uvm-cflags
        --uvm-ldflags
        --linux-dir,--linux
        --linux-ver*
        --mod*-dir
        --sym*-dir
        --lib*-dir,--libdir,--user-libdir
EOF
    exit $1
}

And I also noticed a few echos with unquoted "*" in function verbose(). Here is a correct version without any "*":
verbose ()

{
    echo xeno-config --verbose

    echo "   " --version="\"${XENO_VERSION}\""
    echo "   " --cc="\"$XENO_CC\""
    echo "   " --cross-compile="\"$CROSS_COMPILE\""
    echo "   " --arch="\"$XENO_TARGET_ARCH\""
    echo "   " --subarch="\"$XENO_TARGET_SUBARCH\""
    echo "   " --prefix="\"$XENO_PREFIX\""
    echo "   " --config="\"$XENO_CONFIG\""
    echo "   " --kernel-cflags="\"$XENO_KERNEL_CFLAGS\""

    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 "   " --uvm-cflags="\"=$XENO_UVM_CFLAGS \""
    echo "   " --uvm-ldflags="\"=$XENO_UVM_LDFLAGS\""

    echo "   " --module-dir="\"=$XENO_MODULE_DIR\""
    echo "   " --symbol-dir="\"$XENO_SYMBOL_DIR\""
    echo "   " --libdir="\"$XENO_LIBRARY_DIR\""
    echo "   " --linux-dir="\"$XENO_LINUX_DIR\""
    echo "   " --linux-version="\"$XENO_LINUX_VERSION\""
}
Signature · 1 line
Romain Lenglet
#1 lore raw
Quoted 3 lines · Romain Lenglet

By the way, I noticed that the output of function usage() in that script was wrong. Here is a correct version, to replace the one

if you see an error, please provide a proper patch. I cannot see the error youve 'corrected' below..

In fact, youve added one; -v doesnt work, --v does.

Quoted 6 lines

in scripts/xeno-config.in:
usage ()
{
cat <<EOF
Usage xeno-config OPTIONS
Options :

Quoted 7 lines
       --help
       -v,--verbose
       --version
       --cc
       --cross-compile

thx
jimc

#2 lore raw
Quoted 1 line

if you see an error, please provide a proper patch.

Here is a patch that includes the correction of xeno-config.in and the manpage. If someone wants to add it to the patch tracker on the Gna! project page, please do it.

Quoted 1 line

I cannot see the error youve 'corrected' below..

You will see in the patch. ;)
The usage mentionned --module-cxxflags and --kernel-cxxflags that are not allowed, and the actual set of accepted options is larger than previously displayed in the usage.

Quoted 1 line

In fact, youve added one; -v doesnt work, --v does.

Thanks, corrected in this patch.

If someone applies the patch to the repository, it will be necessary to run autoreconf once (to regenerate configure and man/GNUmakefile.in). It does not work on my system, apparently because my versions of automake and autoconf are too recent, and some rule files seem to not be included in the repository.

I am currently working on manpages for xeno-load(1) and runinfo(5) (for the format of .runinfo files). I will send a patch with these.

Signature · 1 line
Romain Lenglet
GNUmakefile.am +2 -1
@@ -12,7 +12,8 @@
 	scripts \
 	@XENO_MAYBE_DOCDIR@ \
 	$(subdirs) \
-	config
+	config \
+	man
 
 EXTRA_DIST = CREDITS makefile Kconfig README.INSTALL README.QUICKINSTALL TROUBLESHOOTING @XENO_MAYBE_SIMDIR@
 
configure.in +1 -0
@@ -1474,6 +1474,7 @@
 	include/nucleus/asm-ppc64/GNUmakefile \
 	include/nucleus/asm-ia64/GNUmakefile \
 	include/nucleus/asm-uvm/GNUmakefile \
+	man/GNUmakefile \
 	nucleus/GNUmakefile \
 	scripts/GNUmakefile \
 	scripts/xeno-config \
man/GNUmakefile.am +2 -0
@@ -0,0 +1,2 @@
+man1_MANS = xeno-config.man
+dist_man1_MANS = $(man1_MANS)
man/xeno-config.man +120 -0

120 lines not on this page · raw message

scripts/xeno-config.in +11 -11
@@ -37,6 +37,7 @@
 Usage xeno-config OPTIONS
 Options :
         --help
+        --v,--verbose
         --version
         --cc
         --cross-compile
@@ -44,19 +45,18 @@
         --subarch
         --prefix
         --config
-        --module-cflags,--kernel-cflags
-        --module-cxxflags,--kernel-cxxflags
+        --mod*-cflags,--kernel-cflags
         --xeno-cflags,--fusion-cflags
         --xeno-ldflags,--fusion-ldflags
         --posix-cflags
         --posix-ldflags
         --uvm-cflags
         --uvm-ldflags
-        --linux-dir
-        --linux-version
-        --module-dir
-        --symbol-dir
-        --library-dir
+        --linux-dir,--linux
+        --linux-ver*
+        --mod*-dir
+        --sym*-dir
+        --lib*-dir,--libdir,--user-libdir
 EOF
     exit $1
 }
@@ -81,11 +81,11 @@
     echo "   " --uvm-cflags="\"=$XENO_UVM_CFLAGS \""
     echo "   " --uvm-ldflags="\"=$XENO_UVM_LDFLAGS\""
 
-    echo "   " --mod*-dir="\"=$XENO_MODULE_DIR\""
-    echo "   " --sym*-dir="\"$XENO_SYMBOL_DIR\""
-    echo "   " --libdir="\"$XENO_LIBRARY_DIR\""
+    echo "   " --module-dir="\"=$XENO_MODULE_DIR\""
+    echo "   " --symbol-dir="\"$XENO_SYMBOL_DIR\""
+    echo "   " --library-dir="\"$XENO_LIBRARY_DIR\""
     echo "   " --linux-dir="\"$XENO_LINUX_DIR\""
-    echo "   " --linux-ver*="\"$XENO_LINUX_VERSION\""
+    echo "   " --linux-version="\"$XENO_LINUX_VERSION\""
 }
 
 if test $# -eq 0; then
#3 lore raw
Quoted 8 lines · Romain Lenglet
Quoted 1 line

if you see an error, please provide a proper patch.

Here is a patch that includes the correction of xeno-config.in and the manpage. If someone wants to add it to the patch tracker on the Gna! project page, please do it.

Quoted 1 line

I cannot see the error youve 'corrected' below..

Quoted 8 lines

You will see in the patch. ;)
The usage mentionned --module-cxxflags and --kernel-cxxflags that are not allowed, and the actual set of accepted options is larger than previously displayed in the usage.

Quoted 1 line

In fact, youve added one; -v doesnt work, --v does.

Thanks, corrected in this patch.

Thanks a lot, will apply. I would move the man directory under the doc directory though.

Quoted 5 lines

If someone applies the patch to the repository, it will be necessary to run autoreconf once (to regenerate configure and man/GNUmakefile.in). It does not work on my system, apparently because my versions of automake and autoconf are too recent, and some rule files seem to not be included in the repository.

The necessary versions of the autotools are the one in Debian Sarge, and their version is given in README.INSTALL:
o autoconf 2.59
o automake 1.9.5
o aclocal 1.9.5
o libtool 1.5.6

If you want to regenerate the autotools files, you may enable the "maintainer mode" in Xenomai configuration or run script/bootstrap (you have to run it under the sim directory too).

autoreconf does not work because it greps the flags to be passed to aclocal by looking for the ACLOCAL_AMFLAGS variable definition in the top Makefile, but there is no top Makefile in Xenomai, only a top GNUmakefile. I tracked down this issue and changed my autoreconf script a long time ago but am using the bootstrap script now... Automake maintainer mode, on the other hand, works fine with makefiles called GNUmakefile.

Signature · 1 line
					    Gilles Chanteperdrix.
#4 lore raw
In reply to Romain Lenglet
Quoted 5 lines · Romain Lenglet
Quoted 1 line

if you see an error, please provide a proper patch.

Here is a patch that includes the correction of xeno-config.in and the manpage. If someone wants to add it to the patch tracker on the Gna! project page, please do it.

You are supposed to be able to ad that patch to the tracker: being a logged-in user should be enough to be able to post a patch. I do not think it wise to open it to anonymous users, it would open it for use by spammers.

Quoted 3 lines

I am currently working on manpages for xeno-load(1) and runinfo(5) (for the format of .runinfo files). I will send a patch with these.

Thanks. Note that you will need to document the latency test. This looks important, because this is the first program users should run, before messing with .runinfo.

In order to compare Xenomai with other Debian packagees, I checked gtk-config, and I have a few remarks on xeno-config and its manpage.

gtk-config is made to be sourced from configure scripts, so that configure scripts have a simple way to know whether GTK is installed, and a simple way to get the glib_* variables and export them to the generated makefiles.

When run with no arguments, xeno-config prints the usage, but most importantly returns an error. I would suggest firstly that we do not print anything, after all the standard way to get help is the --help or -h argument, but if you do insist that you want help, I admit configure script may redirect output when sourcing xeno-config. But I strongly suggest we return 0, otherwise, there is no simple way for a configure script to know whether Xenomai is correctly installed.

gtk-config has no --verbose option and I wonder how useful this option is. I mean, if you want to have the variables list, you may run (modulo we do not return 1 as status when called with no arguments) . xeno-config
set | grep '^XENO'

Now, about the manpage itself, unless I am wrong, the DESTDIR feature is not documented, it is very useful when compiling for a target.

Signature · 1 line
					    Gilles Chanteperdrix.
#5 lore raw
Quoted 3 lines

In order to compare Xenomai with other Debian packagees, I checked gtk-config, and I have a few remarks on xeno-config and its manpage.

[...]

I merely documented xeno-config as it is now, and made the printed usage consistent. If you modify it, I will update the manpage accordingly.

Another item to add to the looOOong-term wishlist: I would like to have ready-to-use autoconf rules, to use instead of xeno-config.

If someone ever writes such rules, e.g. in a "xenomai.m4" file, it would only be necessary, at Xenomai install time:
1- to copy xenomai.m4 into /usr/share/autoconf/autoconf/ 2- to add the following line into autoconf.m4:
m4_include([autoconf/xenomai.m4])
2- to regenerate autoconf.m4f by running:
cd /usr/share/autoconf/autoconf
autom4te --language=autoconf --freeze --output=autoconf.m4f

A simpler solution would be to ship a xenomai.m4 to be used as a acinclude.m4 in every project using Xenomai. But I have had very bad experiences with aclocal in that use case. aclocal is quite buggy. And it would be more confortable for projects it is were immediately available after installing Xenomai.

Quoted 3 lines

Now, about the manpage itself, unless I am wrong, the DESTDIR feature is not documented, it is very useful when compiling for a target.

DESTDIR is a feature of makefiles generated through Automake, not of xeno-config. Why would you like to document this is in xeno-config's manpage?

Signature · 1 line
Romain Lenglet
#6 lore raw
Quoted 8 lines · Romain Lenglet
Quoted 3 lines

In order to compare Xenomai with other Debian packagees, I checked gtk-config, and I have a few remarks on xeno-config and its manpage.

[...]

I merely documented xeno-config as it is now, and made the printed usage consistent. If you modify it, I will update the manpage accordingly.

Sorry for the digression then. But the point about DESTDIR still holds, from my point of view.

Quoted 15 lines

Another item to add to the looOOong-term wishlist: I would like to have ready-to-use autoconf rules, to use instead of xeno-config.

If someone ever writes such rules, e.g. in a "xenomai.m4" file, it would only be necessary, at Xenomai install time:
1- to copy xenomai.m4 into /usr/share/autoconf/autoconf/ 2- to add the following line into autoconf.m4:
m4_include([autoconf/xenomai.m4])
2- to regenerate autoconf.m4f by running:
cd /usr/share/autoconf/autoconf
autom4te --language=autoconf --freeze --output=autoconf.m4f

Quoted 5 lines

A simpler solution would be to ship a xenomai.m4 to be used as a acinclude.m4 in every project using Xenomai. But I have had very bad experiences with aclocal in that use case. aclocal is quite buggy. And it would be more confortable for projects it is were immediately available after installing Xenomai.

Yes, this was the original plan, but there are still many things on our todo list before that.

Quoted 9 lines
Quoted 5 lines

Now, about the manpage itself, unless I am wrong, the DESTDIR feature is not documented, it is very useful when compiling for a target.

DESTDIR is a feature of makefiles generated through Automake, not of xeno-config. Why would you like to document this is in xeno-config's manpage?

DESTDIR is used by xeno-config the same way it is used by Makefiles. When you compiled Xenomai for a target and installed it with DESTDIR=/home/romain/target, you have to set DESTDIR in xeno-config environment so that it outputs -I/home/romain/target/usr/realtime/include and -L/home/romain/target/usr/realtimeLib.

Since it is a rather obscure functionality, it probably deserves an explanation.

Signature · 1 line
					    Gilles Chanteperdrix.
#7 lore raw
Quoted 9 lines

 > A simpler solution would be to ship a xenomai.m4 to be used > as a acinclude.m4 in every project using Xenomai. But I > have had very bad experiences with aclocal in that use > case. aclocal is quite buggy. And it would be more > confortable for projects it is were immediately available > after installing Xenomai.

Yes, this was the original plan, but there are still many things on our todo list before that.

I found a better solution, that could be a replacement for both a xenomai.m4 trick, and the xeno-config script: pkg-config.
http://pkgconfig.freedesktop.org/wiki/
There are packages for pkgconfig in both Debian and RedHat, AFAIK, and surely for all other distribs.

I will look into making a xenomai.pc file.

Quoted 9 lines

DESTDIR is used by xeno-config the same way it is used by Makefiles. When you compiled Xenomai for a target and installed it with DESTDIR=/home/romain/target, you have to set DESTDIR in xeno-config environment  so that it outputs

(quoted diff) +0 -2
-I/home/romain/target/usr/realtime/include and
-L/home/romain/target/usr/realtimeLib.

Since it is a rather obscure functionality, it probably deserves an explanation.

Ok, done. Please apply patches #472 and #474:
https://gna.org/patch/index.php?func=detailitem&item_id=472
https://gna.org/patch/index.php?func=detailitem&item_id=474

Signature · 1 line
Romain Lenglet