SQLite Forum

[PATCH] Remove Bashism in configure.ac
Login

[PATCH] Remove Bashism in configure.ac

(1) By Matt Whitlock (mwhitlock) on 2020-07-07 06:18:31 [source]

On systems where /bin/sh is a POSIX-compliant shell (such as Dash without the hobbling of $LINENO that some distros inflict on it), Autoconf will use /bin/sh as its configure script interpreter. Bashisms in configure.ac thus lead to shell errors at runtime. The most common such Bashism is the use of the == operator with the test built-in.

SQLite's configure.ac has one such occurrence of the == operator, which causes Dash to emit errors of the form:

./configure: 12664: test: unexpected operator

Please apply this patch to eliminate the Bashism:

diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac	2020-06-18 14:35:12.000000000 +0000
+++ b/configure.ac	2020-07-06 21:22:52.742873150 +0000
@@ -569,7 +569,7 @@
 # See whether we should use the amalgamation to build
 AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation],
       [Disable the amalgamation and instead build all files separately]))
-if test "${enable_amalgamation}" == "no" ; then
+if test "${enable_amalgamation}" = "no" ; then
   USE_AMALGAMATION=0
 fi
 AC_SUBST(USE_AMALGAMATION)

(2) By Dan Kennedy (dan) on 2020-07-07 19:27:03 in reply to 1 [link] [source]