Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix formatting and misc in configure #5488

Merged
merged 9 commits into from
Dec 1, 2022

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Nov 28, 2022

Commits:

$ git log --reverse --pretty='* %s' master..
* configure*: fix typo of "been"
* configure*: fix trailing comma in HAVE_CONTRIB_INSTALL
* configure*: fix indentation
* configure*: remove extraneous blank lines
* configure*: remove extraneous blank lines (warning)
* configure*: wrap long shell command output lines
* configure*: wrap long AS_HELP_STRING line (sanitizer)
* configure*: fix quotes/parens alignment (sanitizer)
* configure*: quote and line-wrap AC_CHECK_HEADER line

Relates to #4712.

kmk3 added 9 commits November 28, 2022 04:50
s/bean/been

Added on commit d1acb31 ("compile time: enable LTS", 2021-02-28).
Consider the current code:

    AS_IF([test "x$enable_lts" = "xyes"], [
    # ...
            HAVE_CONTRIB_INSTALL="no",

Result of testing the value:

    $ HAVE_CONTRIB_INSTALL="no",
    $ printf '%s\n' "$HAVE_CONTRIB_INSTALL"
    no,
    $ test "x$HAVE_CONTRIB_INSTALL" = "xno" &&
      echo equal || echo 'not equal'
    not equal

This means that whenever HAVE_LTS is enabled, HAVE_CONTRIB_INSTALL is
always considered enabled when testing against "no".

But luckily, in the current code the latter variable is only tested
against "yes", so nothing should be affected:

    $ git grep HAVE_CONTRIB_INSTALL |
      grep -v -e '^configure:' -e '^configure.ac:'
    Makefile:ifeq ($(HAVE_CONTRIB_INSTALL),yes)
    config.mk.in:HAVE_CONTRIB_INSTALL=@HAVE_CONTRIB_INSTALL@

Added on commit d1acb31 ("compile time: enable LTS", 2021-02-28).
Added on commit d1acb31 ("compile time: enable LTS", 2021-02-28).

Note: Do not print a preceding blank line because one is already printed
right before the warning message, right after the items on "Features:".

Example of the resulting warning message:

    $ autoconf && ./configure
    [...]
    configure: creating ./config.status
    config.status: creating config.mk
    config.status: creating config.sh

    Compile options:
       [...]
       prefix: /usr/local
       sysconfdir: ${prefix}/etc
       Spectre compiler patch: yes

    Features:
       [...]
       SELinux labeling support:
       user namespace: -DHAVE_USERNS
       X11 sandboxing support: -DHAVE_X11

    *********************************************************
    *    Warning: Long-term support (LTS) was enabled!      *
    *    Most compile-time options have been rewritten!     *
    *********************************************************

    $
Instead of binding them together with conditionals in a single line,
split shell commands into multiple lines to make them more readable.

Note that for the macro arguments in question, the content inside []
quotes is output literally into ./configure, so the commands can be
written as if they were in a shell script directly (save for any special
characters/tokens in Autoconf).

Misc: Relates to commit 2c64d1f ("use AX_CHECK_COMPILE_FLAG to check
for spectre flags", 2019-06-21).
Misc: I missed this one on commit 221c101 ("configure*: Add missing
quotes to arguments", 2021-06-03) / PR netblue30#4712.
@kmk3 kmk3 changed the title build: configure: formatting and misc fixes build: fix formatting and misc in configure Nov 28, 2022
Copy link
Collaborator

@glitsj16 glitsj16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@reinerh reinerh merged commit d6b0d40 into netblue30:master Dec 1, 2022
@kmk3 kmk3 deleted the configure-fix-format-misc branch December 2, 2022 06:35
kmk3 added a commit that referenced this pull request Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

3 participants