From b8f2ec585da9f22a4b9ecb9216071d6bf7afab8d Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Mon, 10 Aug 2020 08:55:31 +0200
Subject: [PATCH] BUILD: Rename the --with options by --enable for features

---
 configure             | 22 ++++++++++------------
 configure.ac          | 20 ++++++++++----------
 scripts/validate.bash |  4 ++--
 3 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/configure b/configure
index 694436ce..5ede6b60 100755
--- a/configure
+++ b/configure
@@ -777,8 +777,8 @@ with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
-with_debug
-with_static_module
+enable_debug
+enable_static_module
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1421,6 +1421,8 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-debug          Enable debug so you can use gdb
+  --enable-static-module  Build modules statically in liblektor
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1433,8 +1435,6 @@ Optional Packages:
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                           compiler's sysroot if not specified).
-  --with-debug            Enable debug so you can use gdb
-  --with-static-module    Build modules statically in liblektor
 
 Some influential environment variables:
   CC          C compiler command
@@ -13523,10 +13523,9 @@ fi
 # OPTIONS #
 ###########
 
-
-# Check whether --with-debug was given.
-if test "${with_debug+set}" = set; then :
-  withval=$with_debug; LKT_DEBUG_ENABLED=yes
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug; LKT_DEBUG_ENABLED=yes
 else
   LKT_DEBUG_ENABLED=no
 fi
@@ -13538,10 +13537,9 @@ _ACEOF
 
 
 
-
-# Check whether --with-static-module was given.
-if test "${with_static_module+set}" = set; then :
-  withval=$with_static_module; LKT_STATIC_MODULE=yes
+# Check whether --enable-static-module was given.
+if test "${enable_static_module+set}" = set; then :
+  enableval=$enable_static_module; LKT_STATIC_MODULE=yes
 else
   LKT_STATIC_MODULE=no
 fi
diff --git a/configure.ac b/configure.ac
index 42e250a6..7731d29a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,19 +77,19 @@ AM_PROG_AS
 # OPTIONS #
 ###########
 
-AC_ARG_WITH([debug],
-            [AS_HELP_STRING([--with-debug],
-                            [Enable debug so you can use gdb])],
-            [LKT_DEBUG_ENABLED=yes],
-            [LKT_DEBUG_ENABLED=no])
+AC_ARG_ENABLE([debug],
+              [AS_HELP_STRING([--enable-debug],
+                              [Enable debug so you can use gdb])],
+              [LKT_DEBUG_ENABLED=yes],
+              [LKT_DEBUG_ENABLED=no])
 AC_DEFINE_UNQUOTED([LKT_DEBUG_ENABLED], ["$LKT_DEBUG_ENABLED"], [Enable debug])
 AC_SUBST([LKT_DEBUG_ENABLED])
 
-AC_ARG_WITH([static-module],
-            [AS_HELP_STRING([--with-static-module],
-                            [Build modules statically in liblektor])],
-            [LKT_STATIC_MODULE=yes],
-            [LKT_STATIC_MODULE=no])
+AC_ARG_ENABLE([static-module],
+              [AS_HELP_STRING([--enable-static-module],
+                              [Build modules statically in liblektor])],
+              [LKT_STATIC_MODULE=yes],
+              [LKT_STATIC_MODULE=no])
 AM_CONDITIONAL([LKT_STATIC_MODULE], [test "x${LKT_STATIC_MODULE}" = "xyes"])
 if test "x${LKT_STATIC_MODULE}" ; then
     AC_DEFINE([LKT_STATIC_MODULE], [], [Build with modules inside liblektor])
diff --git a/scripts/validate.bash b/scripts/validate.bash
index 89eddcc4..50b1242c 100755
--- a/scripts/validate.bash
+++ b/scripts/validate.bash
@@ -194,10 +194,10 @@ function do_cleanup ()
 function process_args ()
 {
     if [ "x$LKT_DEBUG" = "xyes" ] ; then
-        LKT_CONFIGURE_OPTIONS="$LKT_CONFIGURE_OPTIONS --with-debug"
+        LKT_CONFIGURE_OPTIONS="$LKT_CONFIGURE_OPTIONS --enable-debug"
     fi
     if [ "x$LKT_STATIC_MODULES" = "xyes" ] ; then
-        LKT_CONFIGURE_OPTIONS="$LKT_CONFIGURE_OPTIONS --with-static-module"
+        LKT_CONFIGURE_OPTIONS="$LKT_CONFIGURE_OPTIONS --enable-static-module"
     fi
     LKT_CONFIGURE_OPTIONS="$LKT_CONFIGURE_OPTIONS CC=$LKT_COMPILER"
 }
-- 
GitLab