Skip to content

Commit 6c2cdac

Browse files
authored
Merge pull request #12 from asdf-format/issue-11
Fix build issue #11
2 parents 1db7f0f + a60c9af commit 6c2cdac

File tree

11 files changed

+663
-56
lines changed

11 files changed

+663
-56
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,9 @@ jobs:
6161
- name: Check
6262
run: make check ${{ github.event.inputs.make_flags }}
6363

64+
- name: Output test logs on failure
65+
if: failure()
66+
run: |
67+
tail -n +1 tests/*.log
68+
tail -n +1 tests/tmp/*.out.txt
69+

configure.ac

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ AC_CONFIG_MACRO_DIR([m4])
1414

1515
AC_LANG([C])
1616
AC_PROG_CC
17-
AC_PROG_CC_STDC
1817

1918
AS_IF([test "x$ac_cv_prog_cc_c11" = "xno"],
2019
[AC_MSG_ERROR([C11 support is required but not available])])
@@ -48,6 +47,7 @@ AX_VALGRIND_CHECK
4847
AX_CODE_COVERAGE
4948

5049
# Additional enable flags
50+
# --enable-debug
5151
AC_ARG_ENABLE([debug],
5252
[AS_HELP_STRING([--enable-debug], [Enable debug build (-g -O0)])],
5353
[enable_debug=yes],
@@ -59,13 +59,26 @@ if test "x$enable_debug" = "xyes"; then
5959
AC_DEFINE([DEBUG], [1], [Define if debugging is enabled])
6060
fi
6161

62+
# --disable-tool
6263
AC_ARG_ENABLE([tool],
6364
[AS_HELP_STRING([--disable-tool], [Do not build the asdf command-line tool])],
6465
[asdf_build_tool=$enableval],
6566
[asdf_build_tool=yes])
6667

6768
AM_CONDITIONAL([ASDF_BUILD_TOOL], [test "x$asdf_build_tool" = xyes])
6869

70+
# --with-asan
71+
AC_ARG_WITH([asan],
72+
[AS_HELP_STRING([--with-asan], [Build with AddressSanitizer support])],
73+
[with_asan=yes],
74+
[with_asan=no])
75+
76+
if test "x$with_asan" = "xyes"; then
77+
CFLAGS="$CFLAGS -O1 -g -fsanitize=address -fno-omit-frame-pointer"
78+
LDFLAGS="$LDFLAGS -fsanitize=address"
79+
AC_DEFINE([WITH_ASAN], [1], [Defined if building with AddressSanitizer])
80+
fi
81+
6982
# Checks for libraries.
7083
# Preferably using pkg-config, could fall back on AC_SEARCH_LIBS if not
7184
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])

m4/ax_ac_append_to_file.m4

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ===========================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_ac_append_to_file.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_AC_APPEND_TO_FILE([FILE],[DATA])
8+
#
9+
# DESCRIPTION
10+
#
11+
# Appends the specified data to the specified Autoconf is run. If you want
12+
# to append to a file when configure is run use AX_APPEND_TO_FILE instead.
13+
#
14+
# LICENSE
15+
#
16+
# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
17+
#
18+
# Copying and distribution of this file, with or without modification, are
19+
# permitted in any medium without royalty provided the copyright notice
20+
# and this notice are preserved. This file is offered as-is, without any
21+
# warranty.
22+
23+
#serial 10
24+
25+
AC_DEFUN([AX_AC_APPEND_TO_FILE],[
26+
AC_REQUIRE([AX_FILE_ESCAPES])
27+
m4_esyscmd(
28+
AX_FILE_ESCAPES
29+
[
30+
printf "%s" "$2" >> "$1"
31+
])
32+
])

m4/ax_ac_print_to_file.m4

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ===========================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_ac_print_to_file.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_AC_PRINT_TO_FILE([FILE],[DATA])
8+
#
9+
# DESCRIPTION
10+
#
11+
# Writes the specified data to the specified file when Autoconf is run. If
12+
# you want to print to a file when configure is run use AX_PRINT_TO_FILE
13+
# instead.
14+
#
15+
# LICENSE
16+
#
17+
# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
18+
#
19+
# Copying and distribution of this file, with or without modification, are
20+
# permitted in any medium without royalty provided the copyright notice
21+
# and this notice are preserved. This file is offered as-is, without any
22+
# warranty.
23+
24+
#serial 10
25+
26+
AC_DEFUN([AX_AC_PRINT_TO_FILE],[
27+
m4_esyscmd(
28+
AC_REQUIRE([AX_FILE_ESCAPES])
29+
[
30+
printf "%s" "$2" > "$1"
31+
])
32+
])

m4/ax_add_am_macro_static.m4

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ===========================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_add_am_macro_static.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_ADD_AM_MACRO_STATIC([RULE])
8+
#
9+
# DESCRIPTION
10+
#
11+
# Adds the specified rule to $AMINCLUDE.
12+
#
13+
# LICENSE
14+
#
15+
# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
16+
# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
17+
#
18+
# Copying and distribution of this file, with or without modification, are
19+
# permitted in any medium without royalty provided the copyright notice
20+
# and this notice are preserved. This file is offered as-is, without any
21+
# warranty.
22+
23+
#serial 8
24+
25+
AC_DEFUN([AX_ADD_AM_MACRO_STATIC],[
26+
AC_REQUIRE([AX_AM_MACROS_STATIC])
27+
AX_AC_APPEND_TO_FILE(AMINCLUDE_STATIC,[$1])
28+
])

m4/ax_am_macros_static.m4

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ===========================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_am_macros_static.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_AM_MACROS_STATIC
8+
#
9+
# DESCRIPTION
10+
#
11+
# Adds support for macros that create Automake rules. You must manually
12+
# add the following line
13+
#
14+
# include $(top_srcdir)/aminclude_static.am
15+
#
16+
# to your Makefile.am files.
17+
#
18+
# LICENSE
19+
#
20+
# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
21+
# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
22+
#
23+
# Copying and distribution of this file, with or without modification, are
24+
# permitted in any medium without royalty provided the copyright notice
25+
# and this notice are preserved. This file is offered as-is, without any
26+
# warranty.
27+
28+
#serial 11
29+
30+
AC_DEFUN([AMINCLUDE_STATIC],[aminclude_static.am])
31+
32+
AC_DEFUN([AX_AM_MACROS_STATIC],
33+
[
34+
AX_AC_PRINT_TO_FILE(AMINCLUDE_STATIC,[
35+
# ]AMINCLUDE_STATIC[ generated automatically by Autoconf
36+
# from AX_AM_MACROS_STATIC on ]m4_esyscmd([LC_ALL=C date])[
37+
])
38+
])

m4/ax_check_gnu_make.m4

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# ===========================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_CHECK_GNU_MAKE([run-if-true],[run-if-false])
8+
#
9+
# DESCRIPTION
10+
#
11+
# This macro searches for a GNU version of make. If a match is found:
12+
#
13+
# * The makefile variable `ifGNUmake' is set to the empty string, otherwise
14+
# it is set to "#". This is useful for including a special features in a
15+
# Makefile, which cannot be handled by other versions of make.
16+
# * The makefile variable `ifnGNUmake' is set to #, otherwise
17+
# it is set to the empty string. This is useful for including a special
18+
# features in a Makefile, which can be handled
19+
# by other versions of make or to specify else like clause.
20+
# * The variable `_cv_gnu_make_command` is set to the command to invoke
21+
# GNU make if it exists, the empty string otherwise.
22+
# * The variable `ax_cv_gnu_make_command` is set to the command to invoke
23+
# GNU make by copying `_cv_gnu_make_command`, otherwise it is unset.
24+
# * If GNU Make is found, its version is extracted from the output of
25+
# `make --version` as the last field of a record of space-separated
26+
# columns and saved into the variable `ax_check_gnu_make_version`.
27+
# * Additionally if GNU Make is found, run shell code run-if-true
28+
# else run shell code run-if-false.
29+
#
30+
# Here is an example of its use:
31+
#
32+
# Makefile.in might contain:
33+
#
34+
# # A failsafe way of putting a dependency rule into a makefile
35+
# $(DEPEND):
36+
# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
37+
#
38+
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
39+
# @ifGNUmake@ include $(DEPEND)
40+
# @ifGNUmake@ else
41+
# fallback code
42+
# @ifGNUmake@ endif
43+
#
44+
# Then configure.in would normally contain:
45+
#
46+
# AX_CHECK_GNU_MAKE()
47+
# AC_OUTPUT(Makefile)
48+
#
49+
# Then perhaps to cause gnu make to override any other make, we could do
50+
# something like this (note that GNU make always looks for GNUmakefile
51+
# first):
52+
#
53+
# if ! test x$_cv_gnu_make_command = x ; then
54+
# mv Makefile GNUmakefile
55+
# echo .DEFAULT: > Makefile ;
56+
# echo \ $_cv_gnu_make_command \$@ >> Makefile;
57+
# fi
58+
#
59+
# Then, if any (well almost any) other make is called, and GNU make also
60+
# exists, then the other make wraps the GNU make.
61+
#
62+
# LICENSE
63+
#
64+
# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
65+
# Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
66+
#
67+
# Copying and distribution of this file, with or without modification, are
68+
# permitted in any medium without royalty provided the copyright notice
69+
# and this notice are preserved. This file is offered as-is, without any
70+
# warranty.
71+
72+
#serial 11
73+
74+
AC_DEFUN([AX_CHECK_GNU_MAKE],dnl
75+
[AC_PROG_AWK
76+
AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl
77+
_cv_gnu_make_command="" ;
78+
dnl Search all the common names for GNU make
79+
for a in "$MAKE" make gmake gnumake ; do
80+
if test -z "$a" ; then continue ; fi ;
81+
if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
82+
_cv_gnu_make_command=$a ;
83+
AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
84+
ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
85+
break ;
86+
fi
87+
done ;])
88+
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
89+
AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])])
90+
AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])], [AS_VAR_SET([ifGNUmake], ["#"])])
91+
AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])])
92+
AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1])
93+
AC_SUBST([ifGNUmake])
94+
AC_SUBST([ifnGNUmake])
95+
])

m4/ax_file_escapes.m4

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# ===========================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_FILE_ESCAPES
8+
#
9+
# DESCRIPTION
10+
#
11+
# Writes the specified data to the specified file.
12+
#
13+
# LICENSE
14+
#
15+
# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
16+
#
17+
# Copying and distribution of this file, with or without modification, are
18+
# permitted in any medium without royalty provided the copyright notice
19+
# and this notice are preserved. This file is offered as-is, without any
20+
# warranty.
21+
22+
#serial 8
23+
24+
AC_DEFUN([AX_FILE_ESCAPES],[
25+
AX_DOLLAR="\$"
26+
AX_SRB="\\135"
27+
AX_SLB="\\133"
28+
AX_BS="\\\\"
29+
AX_DQ="\""
30+
])

0 commit comments

Comments
 (0)