-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfigure.ac
92 lines (76 loc) · 2.91 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright 2019 Tresys Technology, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([selint], [1.5.0], [[email protected]])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([subdir-objects])
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_LEX
AC_PROG_YACC
# Check for testsuite Check library
AC_ARG_WITH([check],
[AS_HELP_STRING([--without-check],
[Build without testsuite depending on Check (default: Build with testsuite)])],
[with_check=${withval}],
[with_check=yes])
AM_CONDITIONAL([WITH_CHECK], [test "x$with_check" = "xyes"])
AS_IF([test "x$with_check" = "xyes"], [PKG_CHECK_MODULES([CHECK], [check >= 0.11.0], [], [AC_MSG_ERROR([Check not found])])])
# Checks for libraries.
AC_SEARCH_LIBS([cfg_init], [confuse], [], [
AC_MSG_ERROR([Unable to find libconfuse])
])
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h unistd.h stdbool.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([memset strdup])
AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov],
[use Gcov to test the test suite])],
[enable_gcov=${enableval}],
[])
AM_CONDITIONAL([COND_GCOV],[ test "x$enable_gcov" "=" "xyes" ])
AC_CHECK_PROGS([HELP2MAN], [help2man])
if ! test -z "$HELP2MAN"
then
AC_SUBST(MANPAGES, selint.1)
HAVE_HELP2MAN=true
fi
AM_CONDITIONAL([HAVE_HELP2MAN], [test "x$HAVE_HELP2MAN" "=" "xtrue"])
AX_VALGRIND_DFLT([drd], [off])
AX_VALGRIND_DFLT([helgrind], [off])
AX_VALGRIND_DFLT([sgcheck], [off])
AX_VALGRIND_CHECK
AC_CHECK_HEADER([uthash.h], [], [AC_MSG_ERROR([Unable to find uthash header])])
AM_CFLAGS="-Wall -Wextra -Wcast-qual -Wconversion -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings"
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--enable-werror],
[Treat compiler warnings as errors (default: Do not treat as errors)])],
[AM_CFLAGS+=" -Werror"])
AC_SUBST([AM_CFLAGS])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile man/Makefile])
AC_OUTPUT()