summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 8816c6c13940754c17f3487ebfb462df20bcdbab (plain) (blame)
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# vim: set sw=4 ts=4 sts=4 et:

AC_INIT([ccmmc], [0.1])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/lexer.l])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])

# We need POSIX functions. OS specific notes:
# FreeBSD: Defining these macros limits C standard version to C99.
# NetBSD: libc doesn't define static_assert.
# OpenBSD: libc doesn't define static_assert.
case "$host_os" in
    *freebsd*)
        ;;
    *netbsd*|*openbsd*)
        AC_DEFINE([static_assert], [_Static_assert], [C11 compatiblity])
        ;;
    *)
        AC_DEFINE([_POSIX_C_SOURCE], [200809L], [Enable POSIX.1-2008 support])
        AC_DEFINE([_XOPEN_SOURCE], [700], [Enable X/OPEN system interfaces])
        ;;
esac

# Checks for programs.
AC_PROG_CC
CCMMC_COMPILE_C11
AC_PROG_CC_STDC
AC_PROG_RANLIB
AC_PROG_LEX
AC_PROG_YACC

if test x${HAVE_C11} = x0; then
    AC_MSG_ERROR([C compiler with C11 support is required.])
fi

# Checks for warning flags.
AX_IS_RELEASE([git-directory])
AX_COMPILER_FLAGS()
case "$WARN_CFLAGS" in
    *-Wdeclaration-after-statement*)
        WARN_CFLAGS="$WARN_CFLAGS -Wno-declaration-after-statement"
        ;;
esac

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_FUNC_STRERROR_R

AC_CONFIG_FILES([Makefile])
AC_OUTPUT