-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
76 lines (62 loc) · 2.06 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright 2023, Alistair Boyle, 3-clause BSD License
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([mcu-sim],
@@GIT_VERSION@@,
AC_COPYRIGHT([Copyright 2023, Alistair Boyle, 3-clause BSD License])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([src/config.h])
AC_USE_SYSTEM_EXTENSIONS
PKG_PROG_PKG_CONFIG
AC_CANONICAL_HOST
case $host_os in
darwin* ) HOST_EXTRA_CFLAGS="-fgnu89-inline " ;;
linux* ) ;;
*mingw* ) ;;
*) AC_MSG_ERROR([unsupported host platform $host_os]) ;;
esac
# makefile
AM_INIT_AUTOMAKE([1.11 subdir-objects]) # need at least v1.11 of automake for SILENT_RULES
AM_SILENT_RULES([yes]) # enable kernel like cleaner build
AC_CONFIG_FILES([Makefile])
# Checks for programs.
AC_PROG_CC
AX_COMPILER_VENDOR
AX_COMPILER_VERSION
CFLAGS+=" -std=c17 ${HOST_EXTRA_CFLAGS}-Wall -Werror"
AM_PROG_CC_C_O
AC_C_INLINE
AC_TYPE_SIZE_T
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_TYPE_UINT32_T
AC_FUNC_ERROR_AT_LINE
AC_FUNC_STRNLEN
AC_FUNC_STRTOD # argv.c
AC_HEADER_ASSERT
AC_CHECK_HEADERS_ONCE([malloc.h inttypes.h signal.h strings.h])
AC_CHECK_HEADERS([stdlib.h sys/time.h stddef.h limits.h],,AC_MSG_ERROR([missing header]))
AC_CHECK_FUNCS([malloc gettimeofday strndup memset strcasecmp strchr strdup strerror signal pow])
AC_CHECK_FUNCS([memmove strstr]) # cmocka.c
AC_CHECK_FUNCS([pow])
#AX_GNU_AUTOTEST
# Checks for libraries.
#AX_CHECK_ZLIB
# Setup the test suite
AC_CONFIG_TESTDIR([.],[.:tests])
AC_CONFIG_FILES([atlocal])
AC_MSG_CHECKING(for beer in the fridge)
AC_MSG_RESULT(all systems go)
AC_MSG_RESULT([])
AC_MSG_RESULT([m4_text_box([Configuration Summary])])
AC_MSG_RESULT([ C Compiler: $CC ($build_os->$host_os/$ax_cv_c_compiler_vendor-$ax_cv_c_compiler_version)])
AC_MSG_RESULT([ CFLAGS: $CFLAGS])
AC_MSG_RESULT([ LDFLAGS: $LDFLAGS])
AC_MSG_RESULT([ LIBS: $LIBS])
AC_MSG_RESULT([])
AC_OUTPUT
GIT_VERSION=`cat ${srcdir}/.version | sed 's/.*= *//'`
sed -i "s/@@GIT_VERSION@@/${GIT_VERSION}/" config.status