Skip to content

Commit

Permalink
Allow --{enable,disable}-* options to actually work
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Aleksandr Makarov committed Jul 14, 2020
1 parent 6a6dd2d commit 8458d95
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ AM_COND_IF([FREEBSD], AC_MSG_RESULT([Skipping libdl check]),
AC_ARG_ENABLE([jni],
[AS_HELP_STRING([--enable-jni],
[Enable support for JNI library])],
[jni_on=1],
[jni_on=0])
AM_CONDITIONAL([ENABLE_JNI], [test x$jni_on = x1])
[],
[enable_jni = "no"])
AM_CONDITIONAL([ENABLE_JNI], [test "$enable_jni" = "no")
AM_COND_IF([ENABLE_JNI],
AC_MSG_RESULT([JNI support enabled])
AC_DEFINE([ENABLE_JNI]),
Expand All @@ -43,9 +43,9 @@ AM_CONDITIONAL([JAVA_HOME_SET], [test ! -z "$JAVA_HOME"])
AC_ARG_ENABLE([client-only],
[AS_HELP_STRING([--enable-client-only],
[Enable the building of only the client mode of libEST])],
[clientonly_on=1],
[clientonly_on=0])
AM_CONDITIONAL([ENABLE_CLIENT_ONLY], [test x$clientonly_on = x1])
[],
[enable_client_only = "no"])
AM_CONDITIONAL([ENABLE_CLIENT_ONLY], [test "$enable_client_only" = "yes"])
AM_COND_IF([ENABLE_CLIENT_ONLY],
AC_MSG_RESULT([Client only build enabled])
AC_DEFINE([ENABLE_CLIENT_ONLY]),
Expand All @@ -54,9 +54,9 @@ AM_COND_IF([ENABLE_CLIENT_ONLY],
AC_ARG_ENABLE([brski],
[AS_HELP_STRING([--enable-brski],
[Enable support for brski bootstrap functionality])],
[brski_on=1],
[brski_on=0])
AM_CONDITIONAL([ENABLE_BRSKI], [test x$brski_on = x1])
[],
[enable_brski = "no"])
AM_CONDITIONAL([ENABLE_BRSKI], [test "$enable_brski" = "yes"])
AM_COND_IF([ENABLE_BRSKI],
AC_MSG_RESULT([BRSKI support enabled])
AC_DEFINE([ENABLE_BRSKI]),
Expand All @@ -65,9 +65,9 @@ AM_COND_IF([ENABLE_BRSKI],
AC_ARG_ENABLE([pthreads],
[AS_HELP_STRING([--disable-pthreads],
[Disable support for pthreads])],
[pthreads_on=1],
[pthreads_on=0])
AM_CONDITIONAL([DISABLE_PTHREAD], [test x$pthreads_on = x1])
[],
[enable_pthreads = "yes"])
AM_CONDITIONAL([DISABLE_PTHREAD], [test "$enable_pthreads" = "yes"])
AM_COND_IF([DISABLE_PTHREAD],
AC_MSG_RESULT([pthread support disabled])
AC_DEFINE([DISABLE_PTHREADS]),
Expand Down

0 comments on commit 8458d95

Please sign in to comment.