Skip to content

Commit 8458d95

Browse files
author
Aleksandr Makarov
committed
Allow --{enable,disable}-* options to actually work
Multiple tests in configure.ac are flawed: [--snip--] AC_ARG_ENABLE([pthreads], [AS_HELP_STRING([--disable-pthreads], [Disable support for pthreads])], [pthreads_on=1], [pthreads_on=0]) [--snip--] The third argument is "action-if-given" and the fourth argument is "action-if-not-given" [0]. Which means that, whether you pass --enable-pthreads or --disable-pthreads, the third argument will be executed, that is "pthreads_on=1". And if you pass neither, the fourth argument will be executed, i.e. "pthreads_on=0". [0] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/autoconf.html#Package-Options Signed-off-by: Aleksandr Makarov <aleksandr.o.makarov@gmail.com>
1 parent 6a6dd2d commit 8458d95

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

configure.ac

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ AM_COND_IF([FREEBSD], AC_MSG_RESULT([Skipping libdl check]),
3131
AC_ARG_ENABLE([jni],
3232
[AS_HELP_STRING([--enable-jni],
3333
[Enable support for JNI library])],
34-
[jni_on=1],
35-
[jni_on=0])
36-
AM_CONDITIONAL([ENABLE_JNI], [test x$jni_on = x1])
34+
[],
35+
[enable_jni = "no"])
36+
AM_CONDITIONAL([ENABLE_JNI], [test "$enable_jni" = "no")
3737
AM_COND_IF([ENABLE_JNI],
3838
AC_MSG_RESULT([JNI support enabled])
3939
AC_DEFINE([ENABLE_JNI]),
@@ -43,9 +43,9 @@ AM_CONDITIONAL([JAVA_HOME_SET], [test ! -z "$JAVA_HOME"])
4343
AC_ARG_ENABLE([client-only],
4444
[AS_HELP_STRING([--enable-client-only],
4545
[Enable the building of only the client mode of libEST])],
46-
[clientonly_on=1],
47-
[clientonly_on=0])
48-
AM_CONDITIONAL([ENABLE_CLIENT_ONLY], [test x$clientonly_on = x1])
46+
[],
47+
[enable_client_only = "no"])
48+
AM_CONDITIONAL([ENABLE_CLIENT_ONLY], [test "$enable_client_only" = "yes"])
4949
AM_COND_IF([ENABLE_CLIENT_ONLY],
5050
AC_MSG_RESULT([Client only build enabled])
5151
AC_DEFINE([ENABLE_CLIENT_ONLY]),
@@ -54,9 +54,9 @@ AM_COND_IF([ENABLE_CLIENT_ONLY],
5454
AC_ARG_ENABLE([brski],
5555
[AS_HELP_STRING([--enable-brski],
5656
[Enable support for brski bootstrap functionality])],
57-
[brski_on=1],
58-
[brski_on=0])
59-
AM_CONDITIONAL([ENABLE_BRSKI], [test x$brski_on = x1])
57+
[],
58+
[enable_brski = "no"])
59+
AM_CONDITIONAL([ENABLE_BRSKI], [test "$enable_brski" = "yes"])
6060
AM_COND_IF([ENABLE_BRSKI],
6161
AC_MSG_RESULT([BRSKI support enabled])
6262
AC_DEFINE([ENABLE_BRSKI]),
@@ -65,9 +65,9 @@ AM_COND_IF([ENABLE_BRSKI],
6565
AC_ARG_ENABLE([pthreads],
6666
[AS_HELP_STRING([--disable-pthreads],
6767
[Disable support for pthreads])],
68-
[pthreads_on=1],
69-
[pthreads_on=0])
70-
AM_CONDITIONAL([DISABLE_PTHREAD], [test x$pthreads_on = x1])
68+
[],
69+
[enable_pthreads = "yes"])
70+
AM_CONDITIONAL([DISABLE_PTHREAD], [test "$enable_pthreads" = "yes"])
7171
AM_COND_IF([DISABLE_PTHREAD],
7272
AC_MSG_RESULT([pthread support disabled])
7373
AC_DEFINE([DISABLE_PTHREADS]),

0 commit comments

Comments
 (0)