From 18f40cd879d9c8ac518bcfa5e39dc4f23b207d1c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 12 Jan 2019 21:21:32 +0100 Subject: [PATCH] autoconf: fix enable flags --- configure.ac | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index b117a10..c995099 100644 --- a/configure.ac +++ b/configure.ac @@ -69,17 +69,30 @@ AM_CONDITIONAL(OS_LINUX, test "x$os" = xlinux) AM_CONDITIONAL(OS_DARWIN, test "x$os" = xdarwin) # Examples build -AC_ARG_ENABLE([disable-examples-build], [AS_HELP_STRING([--disable-examples-build], - [disable building example applications [default=no]])], - [disable_build_examples=$enableval], - [disable_build_examples=no]) -AM_CONDITIONAL(BUILD_EXAMPLES, test "x$disable_build_examples" != xyes) +AC_ARG_ENABLE([examples], +AS_HELP_STRING([--enable-examples], + [enable building example applications, default: yes]), + [case "${enableval}" in + yes) build_examples=true ;; + no) build_examples=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-examples]) ;; + esac], + [build_examples=true] +) +AM_CONDITIONAL(BUILD_EXAMPLES, test x"$build_examples" == x"true") + # Debug enable -AC_ARG_ENABLE([debug], [AS_HELP_STRING([--debug], - [turn on debugging [default=no]])], - [debug=$enableval], - [debug=no]) -AM_CONDITIONAL(DEBUG, test "x$debug" != xno) +AC_ARG_ENABLE(debug, +AS_HELP_STRING([--enable-debug], + [enable debugging, default: no]), + [case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; + esac], + [debug=false] +) +AM_CONDITIONAL(DEBUG, test x"$debug" = x"true") AC_SUBST(LTLDFLAGS)