Incompatibility into configure.ac

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Incompatibility into configure.ac

Pavel Volkov-2
Hello.
Please, replace the "+ =" operators in the configure.ac file with a
more compatible way of combining strings.
The "+ =" operator works as you would expect in bash only.
And it causes an error in the Bourne shell, for example.
Please, see this patch:

--- configure.ac.orig   2017-04-03 12:16:00 UTC
+++ configure.ac
@@ -596,7 +596,7 @@ AC_ARG_ENABLE(memsys5,
   [enable_memsys5=yes],[enable_memsys5=no])
 AC_MSG_CHECKING([whether to support MEMSYS5])
 if test "${enable_memsys5}" = "yes"; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_MEMSYS5"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS5"
   AC_MSG_RESULT([yes])
 else
   AC_MSG_RESULT([no])
@@ -606,7 +606,7 @@ AC_ARG_ENABLE(memsys3,
   [enable_memsys3=yes],[enable_memsys3=no])
 AC_MSG_CHECKING([whether to support MEMSYS3])
 if test "${enable_memsys3}" = "yes" -a "${enable_memsys5}" = "no"; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_MEMSYS3"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS3"
   AC_MSG_RESULT([yes])
 else
   AC_MSG_RESULT([no])
@@ -618,20 +618,20 @@ AC_ARG_ENABLE(fts3, AC_HELP_STRING([--en
       [Enable the FTS3 extension]),
       [enable_fts3=yes],[enable_fts3=no])
 if test "${enable_fts3}" = "yes" ; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS3"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS3"
 fi
 AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4],
       [Enable the FTS4 extension]),
       [enable_fts4=yes],[enable_fts4=no])
 if test "${enable_fts4}" = "yes" ; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS4"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS4"
   AC_SEARCH_LIBS([log],[m])
 fi
 AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5],
       [Enable the FTS5 extension]),
       [enable_fts5=yes],[enable_fts5=no])
 if test "${enable_fts5}" = "yes" ; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS5"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS5"
   AC_SEARCH_LIBS([log],[m])
 fi

@@ -641,7 +641,7 @@ AC_ARG_ENABLE(json1, AC_HELP_STRING([--e
       [Enable the JSON1 extension]),
       [enable_json1=yes],[enable_json1=no])
 if test "${enable_json1}" = "yes" ; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_JSON1"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_JSON1"
 fi

 #########
@@ -650,7 +650,7 @@ AC_ARG_ENABLE(rtree, AC_HELP_STRING([--e
       [Enable the RTREE extension]),
       [enable_rtree=yes],[enable_rtree=no])
 if test "${enable_rtree}" = "yes" ; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_RTREE"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_RTREE"
 fi

 #########
@@ -659,8 +659,8 @@ AC_ARG_ENABLE(session, AC_HELP_STRING([-
       [Enable the SESSION extension]),
       [enable_session=yes],[enable_session=no])
 if test "${enable_session}" = "yes" ; then
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_SESSION"
-  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_PREUPDATE_HOOK"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_SESSION"
+  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_PREUPDATE_HOOK"
 fi

 #########

Thanks.
With regards, Pavel.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Richard Hipp-3
On 4/4/17, Pavel Volkov <[hidden email]> wrote:
> The "+ =" operator works as you would expect in bash only.
> And it causes an error in the Bourne shell, for example.

You have piqued my curiosity.  Who is still using Bourne shell instead
of the Bourne-again shell (bash)?  Bash has been with us now for like
three decades, right?

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Gary R. Schmidt
On 04/04/2017 23:20, Richard Hipp wrote:
> On 4/4/17, Pavel Volkov <[hidden email]> wrote:
>> The "+ =" operator works as you would expect in bash only.
>> And it causes an error in the Bourne shell, for example.
>
> You have piqued my curiosity.  Who is still using Bourne shell instead
> of the Bourne-again shell (bash)?  Bash has been with us now for like
> three decades, right?
>
Anyone who is supporting Solaris/AIX/HP-UX or older systems.

Is SQLite going the way of "Sure it's portable, it works on Fedora Core
*and* Ubuntu"???

        Cheers,
                Gary B-)
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Pavel Volkov
Hello.
bash it's Bourne again shell. Not Bourne shell. Bash is more then POSIX
shell.
And you forgot the FreeBSD in your listing. As example. It does not use
bash at all.
Thank you.

On Apr 4, 2017 4:34 PM, "Gary R. Schmidt" <[hidden email]> wrote:

> On 04/04/2017 23:20, Richard Hipp wrote:
>
>> On 4/4/17, Pavel Volkov <[hidden email]> wrote:
>>
>>> The "+ =" operator works as you would expect in bash only.
>>> And it causes an error in the Bourne shell, for example.
>>>
>>
>> You have piqued my curiosity.  Who is still using Bourne shell instead
>> of the Bourne-again shell (bash)?  Bash has been with us now for like
>> three decades, right?
>>
>> Anyone who is supporting Solaris/AIX/HP-UX or older systems.
>
> Is SQLite going the way of "Sure it's portable, it works on Fedora Core
> *and* Ubuntu"???
>
>         Cheers,
>                 Gary    B-)
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Jens Alfke-2

> On Apr 4, 2017, at 8:33 PM, Pavel Volkov <[hidden email]> wrote:
>
> bash it's Bourne again shell. Not Bourne shell. Bash is more then POSIX
> shell.

Yes, that’s what they said. The Bourne shell is ‘sh’.

> And you forgot the FreeBSD in your listing. As example. It does not use bash at all.

It doesn’t come with bash installed (presumably as an aftereffect of the ancient religious war between BSD and System V; tcsh was a BSD invention.) But so what? You can easily install it through a package manager. If that means SQLite has a dependency on it, that’s nothing awful; most software has dependencies on other software, and package managers track those dependencies very well.

The issue here seems to be that some scripts in the SQLite source distribution are _implicitly_ assuming that the default shell is bash, or else that ‘sh’ is an alias of bash. The best fix, IMHO, would be to make those scripts explicitly invoke bash, using a shebang or whatever.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Scott Robison-2
On Tue, Apr 4, 2017 at 9:52 PM, Jens Alfke <[hidden email]> wrote:

>
>> On Apr 4, 2017, at 8:33 PM, Pavel Volkov <[hidden email]> wrote:
>>
>> bash it's Bourne again shell. Not Bourne shell. Bash is more then POSIX
>> shell.
>
> Yes, that’s what they said. The Bourne shell is ‘sh’.
>
>> And you forgot the FreeBSD in your listing. As example. It does not use bash at all.
>
> It doesn’t come with bash installed (presumably as an aftereffect of the ancient religious war between BSD and System V; tcsh was a BSD invention.) But so what? You can easily install it through a package manager. If that means SQLite has a dependency on it, that’s nothing awful; most software has dependencies on other software, and package managers track those dependencies very well.
>
> The issue here seems to be that some scripts in the SQLite source distribution are _implicitly_ assuming that the default shell is bash, or else that ‘sh’ is an alias of bash. The best fix, IMHO, would be to make those scripts explicitly invoke bash, using a shebang or whatever.

I'm not as conversant with posix systems, but there isn't a standard
location for bash on systems where it is not the default shell. Does
sh not provide the necessary functionality with some other syntax?

>
> —Jens
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



--
Scott Robison
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Richard Hipp-3
In reply to this post by Jens Alfke-2
On 4/4/17, Jens Alfke <[hidden email]> wrote:
>
> The issue here seems to be that some scripts in the SQLite source
> distribution are _implicitly_ assuming that the default shell is bash, or
> else that ‘sh’ is an alias of bash. The best fix, IMHO, would be to make
> those scripts explicitly invoke bash, using a shebang or whatever.
>

The deeper issue is that I do not have access to a machine that lacks
bash on which to test the modifications....

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Rowan Worth-2
On 5 April 2017 at 17:23, Richard Hipp <[hidden email]> wrote:

> On 4/4/17, Jens Alfke <[hidden email]> wrote:
> >
> > The issue here seems to be that some scripts in the SQLite source
> > distribution are _implicitly_ assuming that the default shell is bash, or
> > else that ‘sh’ is an alias of bash. The best fix, IMHO, would be to make
> > those scripts explicitly invoke bash, using a shebang or whatever.
>
> The deeper issue is that I do not have access to a machine that lacks
> bash on which to test the modifications....


Install dash and symlink /bin/sh to /bin/dash? (which is Ubuntu's default
configuration since 6.10: https://wiki.ubuntu.com/DashAsBinSh )

-Rowan
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Gary R. Schmidt
In reply to this post by Richard Hipp-3
On 05/04/2017 19:23, Richard Hipp wrote:

> On 4/4/17, Jens Alfke <[hidden email]> wrote:
>>
>> The issue here seems to be that some scripts in the SQLite source
>> distribution are _implicitly_ assuming that the default shell is bash, or
>> else that ‘sh’ is an alias of bash. The best fix, IMHO, would be to make
>> those scripts explicitly invoke bash, using a shebang or whatever.
>>
>
> The deeper issue is that I do not have access to a machine that lacks
> bash on which to test the modifications....
>
Install ksh, link /bin/sh and /usr/bin/sh to it.

        Cheers,
                Gary B-)
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Bob Friesenhahn
In reply to this post by Richard Hipp-3
On Wed, 5 Apr 2017, Richard Hipp wrote:

> On 4/4/17, Jens Alfke <[hidden email]> wrote:
>>
>> The issue here seems to be that some scripts in the SQLite source
>> distribution are _implicitly_ assuming that the default shell is bash, or
>> else that ‘sh’ is an alias of bash. The best fix, IMHO, would be to make
>> those scripts explicitly invoke bash, using a shebang or whatever.
>>
>
> The deeper issue is that I do not have access to a machine that lacks
> bash on which to test the modifications....

Specify the shell that configure will use like

   CONFIG_SHELL=/bin/dash ./configure ...

While bash is very popular, it is hardly a representation of a
standards-conformant/enforcing shell.  It is popular because of its
extensions and because of its interactive behavior.

Bob
--
Bob Friesenhahn
[hidden email], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Scott Robison-2
On Apr 5, 2017 7:28 AM, "Bob Friesenhahn" <[hidden email]>
wrote:

On Wed, 5 Apr 2017, Richard Hipp wrote:

>
> The deeper issue is that I do not have access to a machine that lacks
> bash on which to test the modifications....
>

Specify the shell that configure will use like

  CONFIG_SHELL=/bin/dash ./configure ...


Again, I'm not a posix guru, but according to
http://stackoverflow.com/questions/5725296/difference-between-sh-and-bash
...

bash supports a --posix switch, which makes it more POSIX-compliant. It
also tries to mimic POSIX if invoked as sh.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incompatibility into configure.ac

Rowan Worth-2
On 5 April 2017 at 21:37, Scott Robison <[hidden email]> wrote:

> bash supports a --posix switch, which makes it more POSIX-compliant. It
> also tries to mimic POSIX if invoked as sh.
>

And while these methods ensure _compatibility_ with POSIX scripts, they
don't ensure that all executed scripts are POSIX compliant since they don't
disable all of bash's extensions. In particular, += still works in both
cases.

-Rowan
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...