<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 13, 2019 at 6:42 PM Joerg Vehlow <<a href="mailto:lkml@jv-coder.de">lkml@jv-coder.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Joerg Vehlow <<a href="mailto:joerg.vehlow@aox-tech.de" target="_blank">joerg.vehlow@aox-tech.de</a>><br>
<br>
The usage of AC_ARG_WITH was wrong. This resulted in unexpected configuration.<br>
E.g --without-bash set with_bash=yes and --with-nume set with_numa=no.<br>
This is fixed by using "$withval" in the action-if-given. Also all AC_ARG_WITH<br>
are unified now (all use alos action-if-not-given)<br>
<br>
The "default=" help text did not make sense for same options.<br>
e.g. for --with expect was "default=yes", but it defaults to no.<br>
The "default=" strings are dropped, because defaultness is indicated by<br>
either "--with-<option>" or "--without-<option>" as done by other projects,<br>
that use autoconf.<br>
<br>
Defining AC_ARG_WITH within an if to express dependencies does not work.<br>
./configure --with-realtime-testsuite set with_realtime_testsuite=yes,<br>
even if with_bash=no or with_python=no. The check is removed completely.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I think this patch makes sense. It follows the <span class="gmail_default"></span>AC_ARG_WITH official usage, and make use of the shell variable 'withval' is also a wise choice.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Just a few queries below:</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Joerg Vehlow <<a href="mailto:joerg.vehlow@aox-tech.de" target="_blank">joerg.vehlow@aox-tech.de</a>><br>
---<br>
 <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 46 ++++++++++++++++++++++++----------------------<br>
 1 file changed, 24 insertions(+), 22 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index 62c5a0bb4..4b7c6d57c 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -108,8 +108,9 @@ AC_CHECK_FUNCS([ \<br>
 # Expect<br>
 AC_ARG_WITH([bash],<br>
   [AC_HELP_STRING([--with-bash],<br>
-    [have the Bourne Again SHell interpreter (default=no)])],<br>
-  [with_bash=yes],<br>
+    [have the Bourne Again Shell interpreter])],<br>
+  [with_bash=$withval],<br>
+  [with_bash=no]<br>
 )<br>
 if test "x$with_bash" = xyes; then<br>
     AC_SUBST([WITH_BASH],["yes"])<br>
@@ -119,8 +120,8 @@ fi<br>
<br>
 AC_ARG_WITH([expect],<br>
   [AC_HELP_STRING([--with-expect],<br>
-    [have the Tcl/expect library (default=yes)])],<br>
-  [with_expect=yes],<br>
+    [have the Tcl/expect library])],<br>
+  [with_expect=$withval],<br>
  <span class="gmail_default" style="font-size:small"></span> [with_expect=no]<br></blockquote><div><br></div><div><div class="gmail_default" style="">From the original intention, it likely to set yes as the default, so maybe the [action-if-not-given] should as <span class="gmail_default"></span> [with_expect=yes]?</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 )<br>
 if test "x$with_expect" = xyes; then<br>
@@ -132,16 +133,16 @@ fi<br>
 # Numa<br>
 AC_ARG_WITH([numa],<br>
   AC_HELP_STRING([--without-numa],<br>
-    [without numa support (default=no)]),<br>
-  [with_numa=no],<br>
+    [without numa support]),<br>
+  [with_numa=$withval],<br>
   [with_numa=yes]<br>
 )<br>
<br>
 # Perl<br>
 AC_ARG_WITH([perl],<br>
   [AC_HELP_STRING([--with-perl],<br>
-    [have a perl interpreter (default=yes)])],<br>
-  [with_perl=yes],<br>
+    [have a perl interpreter])],<br>
+  [with_perl=$withval],<br>
   <span class="gmail_default" style="font-size:small"></span>[with_perl=no]<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small"><span class="gmail_default"></span>[with_perl=yes] ?</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 )<br>
 if test "x$with_perl" = xyes; then<br>
@@ -153,8 +154,8 @@ fi<br>
 # Python<br>
 AC_ARG_WITH([python],<br>
   [AC_HELP_STRING([--with-python],<br>
-    [have a python interpreter (default=yes)])],<br>
-  [with_python=yes],<br>
+    [have a python interpreter])],<br>
+  [with_python=$withval],<br>
   <span class="gmail_default" style="font-size:small"></span>[with_python=no]<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small"><span class="gmail_default"></span>[with_python=yes] ?</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 )<br>
 if test "x$with_python" = xyes; then<br>
@@ -166,8 +167,8 @@ fi<br>
 # TI RPC<br>
 AC_ARG_WITH([tirpc],<br>
   AC_HELP_STRING([--without-tirpc],<br>
-    [without libtirpc support (default=no)]),<br>
-  [with_tirpc=no],<br>
+    [without libtirpc support]),<br>
+  [with_tirpc=$withval],<br>
   [with_tirpc=yes]<br>
 )<br>
 # END tools knobs<br>
@@ -176,8 +177,9 @@ AC_ARG_WITH([tirpc],<br>
<br>
 AC_ARG_WITH([open-posix-testsuite],<br>
   [AC_HELP_STRING([--with-open-posix-testsuite],<br>
-    [compile and install the open posix testsuite (default=no)])],<br>
-  [with_open_posix_testsuite=$withval]<br>
+    [compile and install the open posix testsuite])],<br>
+  [with_open_posix_testsuite=$withval],<br>
+  [with_open_posix_testsuite=no]<br>
 )<br>
 if test "x$with_open_posix_testsuite" = xyes; then<br>
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])<br>
@@ -185,14 +187,14 @@ else<br>
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])<br>
 fi<br>
<br>
-# testcases/realtime requires bash and python.<br>
-if test "x$with_bash" = xyes && test "x$with_python" = xyes; then<br>
-    AC_ARG_WITH([realtime-testsuite],<br>
-      [AC_HELP_STRING([--with-realtime-testsuite],<br>
-        [compile and install the realtime testsuite (default=no)])],<br>
-      [with_realtime_testsuite=yes]<br>
-    )<br>
-fi<br>
+# TODO: testcases/realtime requires bash and python.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Why remove the judgment of bash/python here?</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+AC_ARG_WITH([realtime-testsuite],<br>
+  [AC_HELP_STRING([--with-realtime-testsuite],<br>
+    [compile and install the realtime testsuite])],<br>
+  [with_realtime_testsuite=$withval],<br>
+  [with_realtime_testsuite=no]<br>
+)<br>
+<br>
 if test "x$with_realtime_testsuite" = xyes; then<br>
     AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])<br>
     # Run configure on testcases/realtime as well.<br>
-- <br>
2.20.1<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>