-
Notifications
You must be signed in to change notification settings - Fork 39
/
configure.ac
132 lines (107 loc) · 3.68 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 2016, Chris Leishman (http://github.com/cleishm)
#
# 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.
#
dnl Process this file with autoconf to produce a configure script
AC_PREREQ([2.71])
AC_INIT([libcypher-parser],[0.6.4~devel])
AC_CONFIG_SRCDIR([lib/src/cypher-parser.h.in])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE([enable])
DECLARE_VERSIONS
WITH_LIBS
GCC_CFLAGS="-fvisibility=hidden -pipe -Wall -W -Wno-unused-parameter \
-Wno-missing-field-initializers -Wpointer-arith -Wstrict-prototypes \
-Wcast-qual -Wcast-align -Wno-error=unused-function \
-Wno-error=unused-variable -Wno-error=deprecated-declarations"
AC_ARG_ENABLE([werror],
AS_HELP_STRING([--disable-werror],
[Do not make warnings into errors even if the compiler supports -Werror.]),
[werror_flag=$enableval], [werror_flag=yes])
AS_IF([test "X$werror_flag" = "Xyes"], [GCC_CFLAGS="$GCC_CFLAGS -Werror"])
LT_INIT
AC_LANG([C])
AC_PROG_CC
PROG_CC_C11
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_ARG_VAR([LEG], [leg parser generator command])
AC_CHECK_PROG([LEG], [leg], [leg])
AM_CONDITIONAL([HAVE_LEG], [test -n "$LEG"])
AS_IF([test -n "$LEG" -o -f ./lib/src/parser_leg.c], [],
[AC_MSG_ERROR([leg is required: please install http://piumarta.com/software/peg/])])
AC_C_CONST
AC_C_INLINE
AC_C_VARARRAYS
AS_IF([test "X$ac_cv_c_vararrays" != "Xyes"],
[AC_MSG_ERROR([compiler support for variable-length arrays is required])])
AC_HEADER_ASSERT
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h])
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_FUNC_STRERROR_R
STATIC_ASSERT
LT_LIB_M
AC_CHECK_FUNCS([open_memstream],[],[],
[
#include <stdio.h>
])
AX_TLS()
AX_PTHREAD([has_pthreads=yes])
AS_IF([test "X$has_pthreads" = "Xyes"],
[AC_DEFINE([HAVE_PTHREADS], [1], [Define to 1 if you have pthreads.])])
dnl Check for check test support
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [has_check=yes], [has_check=no])
AM_CONDITIONAL([HAVE_CHECK], [test "X$has_check" = "Xyes"])
dnl Check if command line tools should be built
AC_ARG_ENABLE([tools],
AS_HELP_STRING([--disable-tools], [Do not build command line tools]))
AM_CONDITIONAL([WANT_TOOLS], [test "X$enable_tools" != "Xno"])
dnl Check if assertions should be disabled
AC_ARG_ENABLE([debug], AS_HELP_STRING([--disable-debug], [Disable debug]))
AS_IF([test "X$enable_debug" = "Xno"],
[AC_DEFINE([NDEBUG], [1], [Define to 1 to disable assertions.])])
dnl Add GCC flags
AS_IF([test "X$GCC" = "Xyes"], [CFLAGS="$CFLAGS $GCC_CFLAGS"])
dnl Capture required dependencies for pkg-check
AC_SUBST([REQUIRES], [`echo "$REQUIRES" | cut -c3-`])
dnl Check for doxygen support
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(ON)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(ON)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(libcypher-parser, doxygen.cfg, .)
AC_CONFIG_FILES([
Makefile \
lib/Makefile \
lib/cypher-parser.pc \
lib/doc/Makefile \
lib/src/Makefile \
lib/src/cypher-parser.h \
lib/test/Makefile \
linter/Makefile \
linter/doc/Makefile \
linter/doc/cypher-lint.1 \
linter/src/Makefile
])
AC_OUTPUT