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

Sync autoconf macros with new form submitted upstream #2195

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions build-aux/ax_require_prog.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_require_prog.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_REQUIRE_PROG([EXECUTABLE], [VARIABLE])
#
# DESCRIPTION
#
# Locates an installed binary program that is a prerequisite to continue.
# Uses AX_WITH_PROG under the hood, but follows up the check with an error
# if no executable could be located.
#
# Example usage:
#
# AX_REQUIRE_PROG(git-warp-time)
#
# Note: If the second argument is not provided, a default value of
# VARIABLE is automatically derived from the executable name by upper
# casing it and substituting any dashes or periods with underscores. In
# the example above the resulting precious variable would be
# GIT_WARP_TIME.
#
# LICENSE
#
# Copyright (c) 2021 Caleb Maclennan <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 1

AC_DEFUN([AX_REQUIRE_PROG], [
AC_PREREQ([2.61])

pushdef([EXECUTABLE],$1)
pushdef([VARIABLE],m4_default($2,m4_toupper(m4_translit($1,-.,__))))

AX_WITH_PROG(VARIABLE,EXECUTABLE)
AS_IF([test "x$with_$1" != xno && test -z "$VARIABLE"], [
AC_MSG_ERROR([EXECUTABLE is required])
])

popdef([VARIABLE])
popdef([EXECUTABLE])
])
4 changes: 2 additions & 2 deletions build-aux/que_dist_checksums.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ EXTRA_DIST += build-aux/que_dist_checksums.am

AM_COND_IF([DEVELOPER_MODE], [

QUE_PROGVAR([sha256sum])
QUE_PROGVAR([tee])
AX_REQUIRE_PROG([sha256sum])
AX_REQUIRE_PROG([tee])

AX_ADD_AM_MACRO([dnl
$(cat build-aux/que_dist_checksums.am)
Expand Down
4 changes: 2 additions & 2 deletions build-aux/que_docker_boilerplate.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ AC_DEFUN_ONCE([QUE_DOCKER_BOILERPLATE], [
QUE_TRANSFORM_PACKAGE_NAME

AC_MSG_NOTICE([checking for tools used by automake to build Docker projects])
AC_PROG_INSTALL
AC_REQUIRE([AC_PROG_INSTALL])
AM_COND_IF([DEVELOPER_MODE], [
QUE_PROGVAR([docker])
AX_REQUIRE_PROG([docker])
])

AC_REQUIRE([AX_AM_MACROS])
Expand Down
2 changes: 1 addition & 1 deletion build-aux/que_font.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_DEFUN([QUE_FONT], [
AC_PROG_GREP
AC_REQUIRE([AC_PROG_GREP])
if test -z "$FCMATCH"; then
AC_PATH_PROG(FCMATCH, fc-match)
if test -z "$FCMATCH"; then
Expand Down
6 changes: 3 additions & 3 deletions build-aux/que_git_version.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ AC_DEFUN_ONCE([QUE_GIT_VERSION], [
AM_CONDITIONAL([SOURCE_IS_ARCHIVE],
[test ! -d .git -a ! -f .tarball-version])

AC_PROG_AWK
AC_PROG_GREP
AC_REQUIRE([AC_PROG_AWK])
AC_REQUIRE([AC_PROG_GREP])

QUE_TRANSFORM_PACKAGE_NAME

AM_COND_IF([SOURCE_IS_DIST], [], [QUE_PROGVAR([cmp])])
AM_COND_IF([SOURCE_IS_DIST], [], [AX_REQUIRE_PROG([cmp])])

AC_REQUIRE([AX_AM_MACROS])
AX_ADD_AM_MACRO([dnl
Expand Down
11 changes: 0 additions & 11 deletions build-aux/que_progvar.m4

This file was deleted.

18 changes: 9 additions & 9 deletions build-aux/que_rust_boilerplate.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ AC_DEFUN_ONCE([QUE_RUST_BOILERPLATE], [
AM_CONDITIONAL([DEBUG_RELEASE], [test "x$debug_release" = "xyes"])

AC_MSG_NOTICE([checking for tools used by automake to build Rust projects])
AC_PROG_INSTALL
AC_PROG_SED
QUE_PROGVAR([cargo])
QUE_PROGVAR([jq])
QUE_PROGVAR([rustc])
QUE_PROGVAR([cmp])
QUE_PROGVAR([xargs])
AC_REQUIRE([AC_PROG_INSTALL])
AC_REQUIRE([AC_PROG_SED])
AX_REQUIRE_PROG([cargo])
AX_REQUIRE_PROG([jq])
AX_REQUIRE_PROG([rustc])
AX_REQUIRE_PROG([cmp])
AX_REQUIRE_PROG([xargs])
AM_COND_IF([DEVELOPER_MODE], [
QUE_PROGVAR([git])
QUE_PROGVAR([rustfmt])
AX_REQUIRE_PROG([git])
AX_REQUIRE_PROG([rustfmt])
])

AC_ARG_VAR(CARGO_TARGET_TRIPLE, "Target triple for Rust compilations")
Expand Down
4 changes: 2 additions & 2 deletions build-aux/que_subst_man_date.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ AC_DEFUN([QUE_SUBST_MAN_DATE], [
ax_src_file="m4_default($2,*.1.in)"
AS_IF([test ! -e .gitignore],
[
QUE_PROGVAR([date])
AX_REQUIRE_PROG([date])
AX_BUILD_DATE_EPOCH(MAN_DATE, "$ax_date_fmt")
], [
QUE_PROGVAR([git])
AX_REQUIRE_PROG([git])
MAN_DATE=$($GIT log -1 --format="%cd" --date=format:"$ax_date_fmt" -- $ax_src_file)
])
AC_SUBST([MAN_DATE])
Expand Down
2 changes: 1 addition & 1 deletion build-aux/que_transform_package_name.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

AC_DEFUN_ONCE([QUE_TRANSFORM_PACKAGE_NAME], [

AC_PROG_SED
AC_REQUIRE([AC_PROG_SED])

TRANSFORMED_PACKAGE_NAME="$(printf "$PACKAGE_NAME" | $SED -e "$(printf "$program_transform_name" | $SED -e 's/\$\$/\$/')")"
AC_SUBST([TRANSFORMED_PACKAGE_NAME])
Expand Down
54 changes: 27 additions & 27 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ AC_PROG_CC
AC_PROG_GREP
AC_PROG_OBJC
AC_PROG_SED
QUE_PROGVAR([cmp])
QUE_PROGVAR([diff])
QUE_PROGVAR([find])
QUE_PROGVAR([head])
QUE_PROGVAR([jq])
QUE_PROGVAR([luarocks])
QUE_PROGVAR([pdfinfo])
QUE_PROGVAR([sort])
QUE_PROGVAR([xargs])
AX_REQUIRE_PROG([cmp])
AX_REQUIRE_PROG([diff])
AX_REQUIRE_PROG([find])
AX_REQUIRE_PROG([head])
AX_REQUIRE_PROG([jq])
AX_REQUIRE_PROG([luarocks])
AX_REQUIRE_PROG([pdfinfo])
AX_REQUIRE_PROG([sort])
AX_REQUIRE_PROG([xargs])

# Disable ranlib to avoid it being run on our rusile.so module, already LTO
# optimized but libtool wants to relink it...
Expand Down Expand Up @@ -119,8 +119,8 @@ AM_CONDITIONAL([FONT_DOWNLOAD_TOOLS], [test -z ${DEVELOPER_MODE_TRUE} || (test -
AC_SUBST([FONT_DOWNLOAD_TOOLS])

AM_COND_IF([MANUAL], [
QUE_PROGVAR([dot])
QUE_PROGVAR([gs])
AX_REQUIRE_PROG([dot])
AX_REQUIRE_PROG([gs])
])

AC_MSG_CHECKING([for OS X])
Expand Down Expand Up @@ -189,8 +189,8 @@ AM_CONDITIONAL([ICU], [test "x$with_icu" = "xyes"])
# Required for downloading fonts for the manual and for tests
# Since the source tarball includes a prebuilt manual we only need this for Git source builds
AM_COND_IF([FONT_DOWNLOAD_TOOLS], [
QUE_PROGVAR([bsdtar])
QUE_PROGVAR([curl])
AX_REQUIRE_PROG([bsdtar])
AX_REQUIRE_PROG([curl])
])

AM_COND_IF([DEVELOPER_MODE], [
Expand All @@ -199,19 +199,19 @@ AM_COND_IF([DEVELOPER_MODE], [
])

AM_COND_IF([DEVELOPER_TOOLS], [
QUE_PROGVAR([busted])
QUE_PROGVAR([cargosetversion], [cargo-set-version])
QUE_PROGVAR([curl])
QUE_PROGVAR([ldoc])
QUE_PROGVAR([luacheck])
QUE_PROGVAR([nix])
QUE_PROGVAR([npm])
QUE_PROGVAR([perl])
QUE_PROGVAR([stylua])
QUE_PROGVAR([taplo])
QUE_PROGVAR([tr])
QUE_PROGVAR([typos])
QUE_PROGVAR([xsltproc])
AX_REQUIRE_PROG([busted])
AX_REQUIRE_PROG([cargo-set-version])
AX_REQUIRE_PROG([curl])
AX_REQUIRE_PROG([ldoc])
AX_REQUIRE_PROG([luacheck])
AX_REQUIRE_PROG([nix])
AX_REQUIRE_PROG([npm])
AX_REQUIRE_PROG([perl])
AX_REQUIRE_PROG([stylua])
AX_REQUIRE_PROG([taplo])
AX_REQUIRE_PROG([tr])
AX_REQUIRE_PROG([typos])
AX_REQUIRE_PROG([xsltproc])
])

AX_PROG_LUA([5.1], [], [], [], [prefer])
Expand Down Expand Up @@ -242,7 +242,7 @@ AM_COND_IF([SYSTEM_LUAROCKS], [
AX_LUA_MODULE(penlight, pl)
AX_LUA_MODULE(vstruct)
], [
QUE_PROGVAR([git]) # required for luarocks to install zlib rock
AX_REQUIRE_PROG([git]) # required for luarocks to install zlib rock
])

QUE_FONT(Gentium Plus)
Expand Down
Loading