-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): Overhaul autoconf with modular components from other pro…
…jects
- Loading branch information
Showing
23 changed files
with
445 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,29 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_ADD_AM_MACRO([RULE]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Adds the specified rule to $AMINCLUDE. This macro will only work | ||
# properly with implementations of Make which allow include statements. | ||
# See also AX_ADD_AM_MACRO_STATIC. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2009 Tom Howard <[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 10 | ||
|
||
AC_DEFUN([AX_ADD_AM_MACRO],[ | ||
AC_REQUIRE([AX_AM_MACROS]) | ||
AX_APPEND_TO_FILE([$AMINCLUDE],[$1]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,44 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_am_macros.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_AM_MACROS | ||
# | ||
# DESCRIPTION | ||
# | ||
# Adds support for macros that create Make rules. You must manually add | ||
# the following line | ||
# | ||
# @INC_AMINCLUDE@ | ||
# | ||
# to your Makefile.in (or Makefile.am if you use Automake) files. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2009 Tom Howard <[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 11 | ||
|
||
AC_DEFUN([AX_AM_MACROS], | ||
[ | ||
AC_MSG_NOTICE([adding automake macro support]) | ||
AMINCLUDE="aminclude.am" | ||
AC_SUBST(AMINCLUDE) | ||
AC_MSG_NOTICE([creating $AMINCLUDE]) | ||
AMINCLUDE_TIME=`LC_ALL=C date` | ||
AX_PRINT_TO_FILE([$AMINCLUDE],[[ | ||
# generated automatically by configure from AX_AUTOMAKE_MACROS | ||
# on $AMINCLUDE_TIME | ||
]]) | ||
INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE" | ||
AC_SUBST(INC_AMINCLUDE) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,27 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_append_to_file.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_APPEND_TO_FILE([FILE],[DATA]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Appends the specified data to the specified file. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2008 Tom Howard <[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 9 | ||
|
||
AC_DEFUN([AX_APPEND_TO_FILE],[ | ||
AC_REQUIRE([AX_FILE_ESCAPES]) | ||
printf "%s" "$2" >> "$1" | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,30 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_FILE_ESCAPES | ||
# | ||
# DESCRIPTION | ||
# | ||
# Writes the specified data to the specified file. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2008 Tom Howard <[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 8 | ||
|
||
AC_DEFUN([AX_FILE_ESCAPES],[ | ||
AX_DOLLAR="\$" | ||
AX_SRB="\\135" | ||
AX_SLB="\\133" | ||
AX_BS="\\\\" | ||
AX_DQ="\"" | ||
]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,27 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_print_to_file.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_PRINT_TO_FILE([FILE],[DATA]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Writes the specified data to the specified file. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2008 Tom Howard <[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 8 | ||
|
||
AC_DEFUN([AX_PRINT_TO_FILE],[ | ||
AC_REQUIRE([AX_FILE_ESCAPES]) | ||
printf "$2" > "$1" | ||
]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
# Like AM_MAINTAINER_MODE, but doesn't touch automake internals and so | ||
# can be used freely to control access to project specific developer | ||
# tooling without breaking autotools if disabled. | ||
AC_DEFUN([QUE_DEVELOPER_MODE], [ | ||
m4_case(m4_default([$1], [disable]), | ||
[enable], [m4_define([_que_developer_def], [disable])], | ||
[disable], [m4_define([_que_developer_def], [enable])], | ||
[m4_define([_que_developer_def], [enable]) | ||
m4_warn([syntax], [unexpected argument to AM@&t@_DEVELOPER_MODE: $1])]) | ||
AC_MSG_CHECKING([whether to enable developer-specific portions of Makefiles]) | ||
AC_ARG_ENABLE([developer-mode], | ||
[AS_HELP_STRING([--]_que_developer_def[-developer-mode], | ||
_que_developer_def[ dependencies and make targets only useful for developers])], | ||
[USE_DEVELOPER_MODE=$enableval], | ||
[USE_DEVELOPER_MODE=]m4_if(_que_developer_def, [enable], [no], [yes])) | ||
AC_MSG_RESULT([$USE_DEVELOPER_MODE]) | ||
AM_CONDITIONAL([DEVELOPER_MODE], [test $USE_DEVELOPER_MODE = yes]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,21 @@ | ||
# Output both a file that can be attached to releases and also write STDOUT | ||
# for the sake of CI build logs so they can be audited as matching what is | ||
# eventually posted. The list of files checksummed is a glob (even though we | ||
# know an exact pattern) to avoid errors for formats not generated. | ||
checksum_dist = \ | ||
shopt -s nullglob ; \ | ||
$(SHA256SUM) $(distdir)*.{tar.{gz,bz2,lz,xz,zst},zip} |\ | ||
$(TEE) $(distdir).sha256.txt | ||
|
||
# Since the checksums file isn't an artifact produced by the default source dist | ||
# creation process, we have to clean it up ourselves so distcheck can see that | ||
# everything round-tripped cleanly. | ||
distclean-local: distclean-local-checksums | ||
|
||
distclean-local-checksums: | ||
rm -f $(distdir).sha256.txt | ||
|
||
# Append checksum operation to function that runs after compressing dist archives | ||
am__post_remove_distdir = $(am__remove_distdir); $(checksum_dist) | ||
|
||
# vim: ft=automake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,20 @@ | ||
AC_DEFUN_ONCE([QUE_DIST_CHECKSUMS], [ | ||
QUE_TRANSFORM_PACKAGE_NAME | ||
AC_REQUIRE([AX_AM_MACROS]) | ||
AX_ADD_AM_MACRO([dnl | ||
EXTRA_DIST = build-aux/que_dist_checksums.am | ||
])dnl | ||
AM_COND_IF([DEVELOPER_MODE], [ | ||
QUE_PROGVAR([sha256sum]) | ||
QUE_PROGVAR([tee]) | ||
AX_ADD_AM_MACRO([dnl | ||
$(cat build-aux/que_dist_checksums.am) | ||
])dnl | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,28 @@ | ||
export VERSION_FROM_AUTOTOOLS = v$(VERSION) | ||
|
||
DOCKER_DEVELOPER_TARGETS = docker | ||
.PHONY: $(DOCKER_DEVELOPER_TARGETS) | ||
|
||
export DOCKER_REGISTRY ?= ghcr.io | ||
export DOCKER_REPO ?= sile-typesetter/$(TRANSFORMED_PACKAGE_NAME) | ||
export DOCKER_TAG ?= HEAD | ||
|
||
docker: Dockerfile hooks/build .version | ||
./hooks/build $(VERSION) | ||
|
||
docker-build-push: docker | ||
docker tag $(DOCKER_REPO):$(DOCKER_TAG) $(DOCKER_REGISTRY)/$(DOCKER_REPO):$(DOCKER_TAG) | ||
$(docker_push) | ||
|
||
define docker_push = | ||
test -z "$(DOCKER_PAT)" || \ | ||
docker login https://$(DOCKER_REGISTRY) -u $(DOCKER_USERNAME) -p $(DOCKER_PAT) | ||
docker push $(DOCKER_REGISTRY)/$(DOCKER_REPO):$(DOCKER_TAG) | ||
if [[ "$(DOCKER_TAG)" == v*.*.* ]]; then \ | ||
tag=$(DOCKER_TAG) ; \ | ||
docker tag $(DOCKER_REPO):$(DOCKER_TAG) $(DOCKER_REGISTRY)/$(DOCKER_REPO):latest ; \ | ||
docker tag $(DOCKER_REPO):$(DOCKER_TAG) $(DOCKER_REGISTRY)/$(DOCKER_REPO):$${tag//.*} ; \ | ||
docker push $(DOCKER_REGISTRY)/$(DOCKER_REPO):latest ; \ | ||
docker push $(DOCKER_REGISTRY)/$(DOCKER_REPO):$${tag//.*} ; \ | ||
fi | ||
endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,18 @@ | ||
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 | ||
AM_COND_IF([DEVELOPER_MODE], [ | ||
QUE_PROGVAR([docker]) | ||
]) | ||
AC_REQUIRE([AX_AM_MACROS]) | ||
AX_ADD_AM_MACRO([dnl | ||
EXTRA_DIST = build-aux/que_docker_boilerplate.am | ||
$($SED -E "s/@PACKAGE_VAR@/$PACKAGE_VAR/g" build-aux/que_docker_boilerplate.am) | ||
])dnl | ||
]) |
Oops, something went wrong.