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: add and use TARNAME instead of NAME for paths #5310

Merged
merged 5 commits into from
Aug 14, 2022

Commits on Aug 13, 2022

  1. config.mk.in: move CC variable near CFLAGS

    Move it to the bottom, near other compilation-related flags.
    kmk3 committed Aug 13, 2022
    Configuration menu
    Copy the full SHA
    0d20026 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2022

  1. config.mk.in: move basic variables to the top

    Move up the variables that are defined in the `AC_INIT` call on
    configure.ac.
    
    And put VERSION last, to match the usual `$(NAME)-$(VERSION)` usage.
    kmk3 committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    3bb8064 View commit details
    Browse the repository at this point in the history
  2. build: rename DOCDIR to docdir

    To match other similar variables, such as datarootdir and mandir.
    kmk3 committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    9a45c34 View commit details
    Browse the repository at this point in the history
  3. build: add new TARNAME variable

    That expands to `@PACKAGE_TARNAME@`, similar to the existing
    PACKAGE_TARNAME variable.
    
    To make it easier to use (and read) and to be more consistent with the
    surrounding variables (NAME and VERSION).
    
    Note that the original PACKAGE_TARNAME is still needed, as by default
    (on autoconf v2.69) `docdir=@DocDir@` in config.mk.in expands to the
    following in config.mk:
    
        docdir=${datarootdir}/doc/${PACKAGE_TARNAME}
    kmk3 committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    891fd02 View commit details
    Browse the repository at this point in the history
  4. build: use TARNAME instead of NAME for paths

    PACKAGE_TARNAME is the same as PACKAGE_NAME but normalized, so it should
    be safer to use in paths.  For example, on a downstream project, if
    spaces or shell metacharacters are added to the package name, a path
    that uses PACKAGE_TARNAME should keep working.
    
    From the manual of GNU Autoconf (version 2.69):
    
    >  -- Macro: AC_INIT (PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
    >      Process any command-line arguments and perform initialization and
    >      verification.
    >
    >      Set the name of the PACKAGE and its VERSION.  These are typically
    >      used in '--version' support, including that of 'configure'.  The
    >      optional argument BUG-REPORT should be the email to which users
    >      should send bug reports.  The package TARNAME differs from
    >      PACKAGE: the latter designates the full package name (e.g., 'GNU
    >      Autoconf'), while the former is meant for distribution tar ball
    >      names (e.g., 'autoconf').  It defaults to PACKAGE with 'GNU '
    >      stripped, lower-cased, and all characters other than
    >      alphanumerics and underscores are changed to '-'.
    
    Note also that by default (on autoconf v2.69), `docdir=@DocDir@` in
    config.mk.in expands to the following in config.mk:
    
        docdir=${datarootdir}/doc/${PACKAGE_TARNAME}
    kmk3 committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    7bbcf7e View commit details
    Browse the repository at this point in the history