Bug 30196 - [0.189 regression] configure.ac contains Bashisms
Summary: [0.189 regression] configure.ac contains Bashisms
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-05 02:44 UTC by Matt Whitlock
Modified: 2023-03-05 12:14 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
elfutils-0.189-fix-configure-bashisms.patch (567 bytes, patch)
2023-03-05 02:44 UTC, Matt Whitlock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2023-03-05 02:44:19 UTC
Created attachment 14729 [details]
elfutils-0.189-fix-configure-bashisms.patch

Autoconf scripts are supposed to be written in POSIX-compatible shell language. elfutils commits 0ffe2874e75d48cb88936e119e5284ff2bf664d9 and 3fa98a6f29b0f370e32549ead7eb897c839af980 introduced Bashisms to configure.ac that cause errors when /bin/sh is not Bash.

Example error when /bin/sh is Dash:

./configure: 8748: test: xyes: unexpected operator


The cause of the error is the use of a non-existent == operator in expressions passed to the 'test' built-in command. POSIX shell specifies only an = operator for testing string equality.

Please make the corrections indicated in the attached patch.
Comment 1 Mark Wielaard 2023-03-05 12:14:46 UTC
You are completely right. Committed as:

commit a9834d7df68afde4ee44ee8fef888cf7e799171a
Author: Mark Wielaard <mark@klomp.org>
Date:   Sun Mar 5 13:09:34 2023 +0100

    configure.ac contains Bashisms
    
    Autoconf scripts are supposed to be written in POSIX-compatible shell
    language. elfutils commits 0ffe2874e75d48cb88936e119e5284ff2bf664d9
    and 3fa98a6f29b0f370e32549ead7eb897c839af980 introduced Bashisms to
    configure.ac that cause errors when /bin/sh is not Bash.
    
    Example error when /bin/sh is Dash:
    
    ./configure: 8748: test: xyes: unexpected operator
    
    The cause of the error is the use of a non-existent == operator in
    expressions passed to the 'test' built-in command. POSIX shell
    specifies only an = operator for testing string equality.
    
      * configure.ac: Replace == by = in use_msan and enable_demangler
      comparisons.
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=30196
    
    Reported-by: Matt Whitlock <sourceware@mattwhitlock.name>
    Signed-off-by: Mark Wielaard <mark@klomp.org>