configure.ac: Fix --with* options
PATCH 1/1 configure.ac: Fix --with* options
From: Joerg Vehlow <[email protected]>
The usage of AC_ARG_WITH was wrong. This resulted in unexpected configuration. E.g --without-bash set with_bash=yes and --with-nume set with_numa=no. This is fixed by using "$withval" in the action-if-given. Also all AC_ARG_WITH are unified now (all use alos action-if-not-given)
The "default=" help text did not make sense for same options. e.g. for --with expect was "default=yes", but it defaults to no. The "default=" strings are dropped, because defaultness is indicated by either "--with-<option>" or "--without-<option>" as done by other projects, that use autoconf.
Defining AC_ARG_WITH within an if to express dependencies does not work. ./configure --with-realtime-testsuite set with_realtime_testsuite=yes, even if with_bash=no or with_python=no. The check is removed completely.
--- configure.ac | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-)
configure.ac +24 -22
@@ -108,8 +108,9 @@ AC_CHECK_FUNCS([ \ # Expect AC_ARG_WITH([bash], [AC_HELP_STRING([--with-bash], - [have the Bourne Again SHell interpreter (default=no)])], - [with_bash=yes], + [have the Bourne Again Shell interpreter])], + [with_bash=$withval], + [with_bash=no] ) if test "x$with_bash" = xyes; then AC_SUBST([WITH_BASH],["yes"])
@@ -119,8 +120,8 @@ fi AC_ARG_WITH([expect], [AC_HELP_STRING([--with-expect], - [have the Tcl/expect library (default=yes)])], - [with_expect=yes], + [have the Tcl/expect library])], + [with_expect=$withval], [with_expect=no] ) if test "x$with_expect" = xyes; then
@@ -132,16 +133,16 @@ fi # Numa AC_ARG_WITH([numa], AC_HELP_STRING([--without-numa], - [without numa support (default=no)]), - [with_numa=no], + [without numa support]), + [with_numa=$withval], [with_numa=yes] ) # Perl AC_ARG_WITH([perl], [AC_HELP_STRING([--with-perl], - [have a perl interpreter (default=yes)])], - [with_perl=yes], + [have a perl interpreter])], + [with_perl=$withval], [with_perl=no] ) if test "x$with_perl" = xyes; then
@@ -153,8 +154,8 @@ fi # Python AC_ARG_WITH([python], [AC_HELP_STRING([--with-python], - [have a python interpreter (default=yes)])], - [with_python=yes], + [have a python interpreter])], + [with_python=$withval], [with_python=no] ) if test "x$with_python" = xyes; then
@@ -166,8 +167,8 @@ fi # TI RPC AC_ARG_WITH([tirpc], AC_HELP_STRING([--without-tirpc], - [without libtirpc support (default=no)]), - [with_tirpc=no], + [without libtirpc support]), + [with_tirpc=$withval], [with_tirpc=yes] ) # END tools knobs
@@ -176,8 +177,9 @@ AC_ARG_WITH([tirpc], AC_ARG_WITH([open-posix-testsuite], [AC_HELP_STRING([--with-open-posix-testsuite], - [compile and install the open posix testsuite (default=no)])], - [with_open_posix_testsuite=$withval] + [compile and install the open posix testsuite])], + [with_open_posix_testsuite=$withval], + [with_open_posix_testsuite=no] ) if test "x$with_open_posix_testsuite" = xyes; then AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
@@ -185,14 +187,14 @@ else AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"]) fi -# testcases/realtime requires bash and python. -if test "x$with_bash" = xyes && test "x$with_python" = xyes; then - AC_ARG_WITH([realtime-testsuite], - [AC_HELP_STRING([--with-realtime-testsuite], - [compile and install the realtime testsuite (default=no)])], - [with_realtime_testsuite=yes] - ) -fi +# TODO: testcases/realtime requires bash and python. +AC_ARG_WITH([realtime-testsuite], + [AC_HELP_STRING([--with-realtime-testsuite], + [compile and install the realtime testsuite])], + [with_realtime_testsuite=$withval], + [with_realtime_testsuite=no] +) + if test "x$with_realtime_testsuite" = xyes; then AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"]) # Run configure on testcases/realtime as well.
Signature · 1 line
2.20.1
PATCH 1/1 configure.ac: Fix --with* options
Hi Joerg,
Quoted 13 lines
From: Joerg Vehlow <[email protected]>
The usage of
AC_ARG_WITHwas wrong. This resulted in unexpected configuration. E.g --without-bash set with_bash=yes and --with-nume set with_numa=no. This is fixed by using "$withval" in the action-if-given. Also allAC_ARG_WITHare unified now (all use alos action-if-not-given)The "default=" help text did not make sense for same options. e.g. for --with expect was "default=yes", but it defaults to no. The "default=" strings are dropped, because defaultness is indicated by either "--with-<option>" or "--without-<option>" as done by other projects, that use autoconf.
Quoted 5 lines
Defining
AC_ARG_WITHwithin an if to express dependencies does not work. ./configure --with-realtime-testsuite set with_realtime_testsuite=yes, even if with_bash=no or with_python=no. The check is removed completely.Signed-off-by Joerg Vehlow <[email protected]>
LGTM, but I'll have more deep look tomorrow.
FYI: https://github.com/linux-test-project/ltp/issues/508
Kind regards,
Petr
PATCH 1/1 configure.ac: Fix --with* options
In reply to Joerg VehlowQuoted 15 lines · Joerg Vehlow
From: Joerg Vehlow <[email protected]>
The usage of
AC_ARG_WITHwas wrong. This resulted in unexpected configuration.
E.g --without-bash set with_bash=yes and --with-nume set with_numa=no. This is fixed by using "$withval" in the action-if-given. Also allAC_ARG_WITH
are unified now (all use alos action-if-not-given)The "default=" help text did not make sense for same options. e.g. for --with expect was "default=yes", but it defaults to no. The "default=" strings are dropped, because defaultness is indicated by either "--with-<option>" or "--without-<option>" as done by other projects, that use autoconf.
Quoted 4 lines
Defining
AC_ARG_WITHwithin an if to express dependencies does not work. ./configure --with-realtime-testsuite set with_realtime_testsuite=yes, even if with_bash=no or with_python=no. The check is removed completely.
I think this patch makes sense. It follows the AC_ARG_WITH official usage, and make use of the shell variable 'withval' is also a wise choice.
Just a few queries below:
Quoted 23 lines
Signed-off-by Joerg Vehlow <[email protected]>--- configure.ac | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-)configure.ac +3
-2@@ -108,8 +108,9 @@ AC_CHECK_FUNCS([ \ # Expect AC_ARG_WITH([bash], [AC_HELP_STRING([--with-bash], - [have the Bourne Again SHell interpreter (default=no)])], - [with_bash=yes], + [have the Bourne Again Shell interpreter])], + [with_bash=$withval], + [with_bash=no] ) if test "x$with_bash" = xyes; then AC_SUBST([WITH_BASH],["yes"])
configure.ac fi · line 126
Quoted 9 lines
configure.ac +2
-2@@ -119,8 +120,8 @@ fi AC_ARG_WITH([expect], [AC_HELP_STRING([--with-expect], - [have the Tcl/expect library (default=yes)])], - [with_expect=yes], + [have the Tcl/expect library])], + [with_expect=$withval], [with_expect=no]
From the original intention, it likely to set yes as the default, so maybe the [action-if-not-given] should as [with_expect=yes]?
Quoted 12 lines
configure.ac +0
-0)if test "x$with_expect" = xyes; then
configure.ac +2
-2@@ -132,16 +133,16 @@ fi # Numa AC_ARG_WITH([numa], AC_HELP_STRING([--without-numa], - [without numa support (default=no)]), - [with_numa=no], + [without numa support]), + [with_numa=$withval], [with_numa=yes] )
configure.ac fi · line 147
Quoted 10 lines
configure.ac +2
-2# Perl AC_ARG_WITH([perl], [AC_HELP_STRING([--with-perl], - [have a perl interpreter (default=yes)])], - [with_perl=yes], + [have a perl interpreter])], + [with_perl=$withval], [with_perl=no]
[with_perl=yes] ?
configure.ac fi · line 160
Quoted 12 lines
configure.ac +0
-0)if test "x$with_perl" = xyes; then
configure.ac +2
-2@@ -153,8 +154,8 @@ fi # Python AC_ARG_WITH([python], [AC_HELP_STRING([--with-python], - [have a python interpreter (default=yes)])], - [with_python=yes], + [have a python interpreter])], + [with_python=$withval], [with_python=no]
[with_python=yes] ?
Quoted 29 lines
configure.ac +0
-0)if test "x$with_python" = xyes; then
configure.ac +5
-4@@ -166,8 +167,8 @@ fi # TI RPC AC_ARG_WITH([tirpc], AC_HELP_STRING([--without-tirpc], - [without libtirpc support (default=no)]), - [with_tirpc=no], + [without libtirpc support]), + [with_tirpc=$withval], [with_tirpc=yes] ) # END tools knobs@@ -176,8 +177,9 @@ AC_ARG_WITH([tirpc], AC_ARG_WITH([open-posix-testsuite], [AC_HELP_STRING([--with-open-posix-testsuite], - [compile and install the open posix testsuite (default=no)])], - [with_open_posix_testsuite=$withval] + [compile and install the open posix testsuite])], + [with_open_posix_testsuite=$withval], + [with_open_posix_testsuite=no] ) if test "x$with_open_posix_testsuite" = xyes; then AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])@@ -185,14 +187,14 @@ else AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"]) fi
configure.ac else · line 191
Quoted 10 lines
configure.ac +1
-8-# testcases/realtime requires bash and python. -if test "x$with_bash" = xyes && test "x$with_python" = xyes; then - AC_ARG_WITH([realtime-testsuite], - [AC_HELP_STRING([--with-realtime-testsuite], - [compile and install the realtime testsuite (default=no)])], - [with_realtime_testsuite=yes] - ) -fi +# TODO: testcases/realtime requires bash and python.
Why remove the judgment of bash/python here?
Quoted 18 lines
configure.ac +7
-0+AC_ARG_WITH([realtime-testsuite], + [AC_HELP_STRING([--with-realtime-testsuite], + [compile and install the realtime testsuite])], + [with_realtime_testsuite=$withval], + [with_realtime_testsuite=no] +) + if test "x$with_realtime_testsuite" = xyes; then AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])# Run configure on testcases/realtime as well.
--
2.20.1--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20191114/25ab7b46/attachment-0001.htm>
PATCH 1/1 configure.ac: Fix --with* options
Hi Li,
Quoted 16 lines
I think this patch makes sense. It follows the
AC_ARG_WITHofficial usage, and make use?of the shell variable 'withval' is also a wise choice.Just a few queries below:
?AC_ARG_WITH([expect], ? ?[AC_HELP_STRING([--with-expect], -? ? [have the Tcl/expect library (default=yes)])], -? [with_expect=yes], +? ? [have the Tcl/expect library])], +? [with_expect=$withval], ?[with_expect=no]
Quoted 2 lines
From the original intention, it likely to set yes as the default, so maybe the?[action-if-not-given] should as ?[with_expect=yes]?
Maybe, but I did not want to change the current behavior here. This should be done in another patch.
Quoted 13 lines
-# testcases/realtime requires bash and python.
-if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
-? ? AC_ARG_WITH([realtime-testsuite],
-? ? ? [AC_HELP_STRING([--with-realtime-testsuite],
-? ? ? ? [compile and install the realtime testsuite (default=no)])],
-? ? ? [with_realtime_testsuite=yes]
-? ? )
-fi
+# TODO: testcases/realtime requires bash and python.Quoted 1 line
Why remove the judgment?of bash/python here?
It simply does not work as intended. See last part of my patch description:
Defining AC_ARG_WITH within an if to express dependencies does not work. ./configure --with-realtime-testsuite set with_realtime_testsuite=yes, even if with_bash=no or with_python=no. The check is removed completely.
I though removing it is better than leaving something that does nothing anyway
Quoted 1 line
J?rg
PATCH 1/1 configure.ac: Fix --with* options
Hi Joerg,
Quoted 6 lines · Joerg Vehlow
...
Quoted 2 lines
From the original intention, it likely to set yes as the default, so maybe the [action-if-not-given] should as [with_expect=yes]?
Maybe, but I did not want to change the current behavior here. This should be done in another patch.
Ok, sure.
Quoted 13 lines
Quoted 13 lines
-# testcases/realtime requires bash and python.
-if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
- AC_ARG_WITH([realtime-testsuite],
- [AC_HELP_STRING([--with-realtime-testsuite],
- [compile and install the realtime testsuite (default=no)])],
- [with_realtime_testsuite=yes]
- )
-fi
+# TODO: testcases/realtime requires bash and python.
Quoted 3 lines
Quoted 1 line
Why remove the judgment of bash/python here?
It simply does not work as intended. See last part of my patch description:
Ah, sorry for missing this part.
Quoted 4 lines
Defining
AC_ARG_WITHwithin an if to express dependencies does not work. ./configure --with-realtime-testsuite set with_realtime_testsuite=yes, even if with_bash=no or with_python=no. The check is removed completely.
Or, maybe we can make use of AS_IF here? and I noticed there are many places that use "if test ..." in the configure.ac file. That looks tangly...
Quoted 4 lines
I though removing it is better than leaving something that does nothing anyway
Indeed.
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20191114/8a071407/attachment.htm>
PATCH 1/1 configure.ac: Fix --with* options
Hi,
Quoted 11 lines
Defining
AC_ARG_WITHwithin an if to express dependencies does not work.
./configure --with-realtime-testsuite set with_realtime_testsuite=yes, even if with_bash=no or with_python=no. The check is removed completely.Or, maybe we can make use of
AS_IFhere? and I noticed there are many places that use "if test ..." in the configure.ac
<http://configure.ac> file. That looks?tangly...
I left a TODO in there so it can be fixed later, maybe together with other errors. I think this does not block merging this patch first? The python requirement for realtime-testsuite is outdated/wrong anyway, if I remember correctly. A colleague of mine recently investigated the python requirement and we came to the conclusion, that it is not needed for running the test.
I think it was used only for manual test result evaluation.
So there seems to be more work regarding dependencies between configure options.
J?rg
PATCH 1/1 configure.ac: Fix --with* options
Quoted 10 lines · Joerg Vehlow
Hi,
Quoted 4 lines
Defining
AC_ARG_WITHwithin an if to express dependencies does not work.
./configure --with-realtime-testsuite setwith_realtime_testsuite=yes,
Quoted 4 lines
even if with_bash=no or with_python=no. The check is removed completely.
Quoted 6 lines
Quoted 3 lines
Or, maybe we can make use of
AS_IFhere? and I noticed there are many places that use "if test ..." in the configure.ac
<http://configure.ac> file. That looks tangly...I left a TODO in there so it can be fixed later, maybe together with other errors. I think this does not block merging this patch first?
Well, I just saw adding new #TODO here and hoping to solve this together, a simple way I was thinking is:
+AS_IF([test "x$with_bash" != xyes || test "x$with_python" != xyes],
+ [with_realtime_testsuite=no]
+)
Of course, It's fine to fix that in a separate patch!
Quoted 10 lines
The python requirement for realtime-testsuite is outdated/wrong anyway, if I remember correctly. A colleague of mine recently investigated the python requirement and we came to the conclusion, that it is not needed for running the test.
I think it was used only for manual test result evaluation.So there seems to be more work regarding dependencies between configure options.
Yes, thanks for investigating this. Looking forward to more patches :).
For this one:
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20191114/00f1db0f/attachment.htm>
PATCH 1/1 configure.ac: Fix --with* options
Hi,
Quoted 8 lines
Well, I just saw adding new #TODO here and hoping to solve this together, a simple way I was thinking is:
configure.ac +3
-0+AS_IF([test "x$with_bash" != xyes || test "x$with_python" != xyes], + [with_realtime_testsuite=no] +)Of course, It's fine to fix that in a separate patch!
I'm for merging this. I just wonder if it's not better to remove $with_bash and $with_python (as part of this patch), if they're not working.
BTW better, than fixing bash/shell would be to actually rewrote tests which are using python and bash to C or posix shell.
https://github.com/linux-test-project/ltp/issues/547
Kind regards,
Petr
PATCH 1/1 configure.ac: Fix --with* options
Quoted 12 lines · Petr Vorel
Hi,
Reviewed-by Petr Vorel <[email protected]>Quoted 1 line
Well, I just saw adding new #TODO here and hoping to solve this
together, a
Quoted 5 lines
simple way I was thinking is:
(quoted diff) +3
-0+AS_IF([test "x$with_bash" != xyes || test "x$with_python" != xyes], + [with_realtime_testsuite=no] +)
Quoted 6 lines
Quoted 1 line
Of course, It's fine to fix that in a separate patch!
I'm for merging this. I just wonder if it's not better to remove $with_bash and
$with_python (as part of this patch), if they're not working.
Me too. I think we could fix that in one patch. But as Joerg mentioned they will be working on the #TODO. So maybe it doesn't matter to do right now or later.
Quoted 10 lines
BTW better, than fixing bash/shell would be to actually rewrote tests which are
using python and bash to C or posix shell.
https://github.com/linux-test-project/ltp/issues/547Kind regards,
Petr
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20191118/c661b854/attachment-0001.htm>
PATCH 1/1 configure.ac: Fix --with* options
In reply to Petr VorelHi Petr,
Quoted 2 lines
I'm for merging this. I just wonder if it's not better to remove $with_bash and $with_python (as part of this patch), if they're not working.
I think you misunderstood. I did not say, that Bash and Python switches were not working,
just that the dependency of bash and python for realtime tests did not work -> it was not a dependency.
The realtime testsuite could be enabled without bash and python enabled.
PATCH 1/1 configure.ac: Fix --with* options
Hi Joerg,
Quoted 8 lines
Hi Petr,
Quoted 2 lines
I'm for merging this. I just wonder if it's not better to remove $with_bash and $with_python (as part of this patch), if they're not working.
I think you misunderstood. I did not say, that Bash and Python switches were not working,
just that the dependency of bash and python for realtime tests did not work -> it was not a dependency.
The realtime testsuite could be enabled without bash and python enabled.
I understood :). It's just that this whole Bash and Python switches are meant to be just for realtime testsuite (therefore completely useless, if they're not working for the only use). As we generally don't want to depend on either python nor bash, this switches will be removed sooner or later.
And our autoconf needs more love, it's obscure.
https://github.com/linux-test-project/ltp/issues/508
But ok, it's a separate problem, I'm for merging it as it is.
Kind regards,
Petr
PATCH 1/1 configure.ac: Fix --with* options
In reply to Joerg VehlowHi J?rg, Li,
merged (the original version with bash and python kept).
Kind regards,
Petr