-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
173 lines (142 loc) · 6.42 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# configure.ac -*- autoconf -*- vim: filetype=config
#
# DDM4
# Copyright (C) 2012 Data Differential, http://datadifferential.com/
# All rights reserved.
#
# Use and distribution licensed under the BSD license. See
# the COPYING file in this directory for full text.
# These two needed for RHEL/CentOS 6
m4_ifndef([m4_esyscmd_s], [m4_define([m4_chomp_all],[m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]],[/],[/]),[/*$]), [$1])])] [m4_define([m4_esyscmd_s], [m4_chomp_all(m4_esyscmd([$1]))])])
m4_ifndef([AS_VAR_COPY], [m4_define([AS_VAR_COPY], [AS_LITERAL_IF([$1[]$2], [$1=$$2],[eval $1=\$$2])])])
AC_COPYRIGHT([2014 Hewlett-Packard Development Company, L.P.])
#AC_REVISION([m4_esyscmd_s([git describe --always])])
AC_PREREQ([2.63])
# NOTE: Major version should be < 100 and minor/patch < 256 or bad things will
# happen in src/asql/utility.cc
AC_INIT([attachbench],m4_esyscmd_s([tr -d '\n' < VERSION]),[[email protected]],[attachbench],[http://libattachsql.org])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Setup the compilers early on
AC_PROG_CC([cc gcc clang])
AC_PROG_CXX([c++ g++ clang++])
# Must come before AM_INIT_AUTOMAKE.
AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
# Automake version before 1.13 (when the serial-tests option was dnl still the default) still defined the badly obsolete macro. 'AC_PROG_INSTALL'.
AM_INIT_AUTOMAKE(1.11 no-define color-tests -Wno-portability subdir-objects foreign tar-ustar m4_ifndef([AC_PROG_INSTALL], [serial-tests]))
AC_ARG_PROGRAM
AC_DEFUN([PROTECT_AC_USE_SYSTEM_EXTENSIONS],
[AX_SAVE_FLAGS
AC_LANG_PUSH([C++])
AC_USE_SYSTEM_EXTENSIONS
AC_LANG_POP([C++])
AX_RESTORE_FLAGS
])
PROTECT_AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
# shared library versioning
ATTACHBENCH_LIBRARY_VERSION= 1:0:0
# | | |
# +------+ | +---+
# | | |
# current:revision:age
# | | |
# | | +- increment if interfaces have been added
# | | set to zero if interfaces have been removed or changed
# | +- increment if source code has changed
# | set to zero if current is incremented
# +- increment if interfaces have been added, removed or changed
AC_SUBST([ATTACHBENCH_LIBRARY_VERSION])
LT_PREREQ([2.2])
LT_INIT
LT_LANG([C++])
AC_PROG_CC_C99
AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
AX_PLATFORM
CONFIG_EXTRA
AC_DEFUN([CHECK_FOR_MINGW],
[AS_IF([test "x${TARGET_WINDOWS}" == "xtrue"],
[AX_APPEND_LINK_FLAGS([-static-libstdc++],[LDFLAGS])
AX_APPEND_LINK_FLAGS([-lmingw64],[LIBS])
AX_APPEND_LINK_FLAGS([-lssp],[LIBS])
])
])
CHECK_FOR_MINGW
# Specialty checks
AX_CXX_CINTTYPES
# Checks for programs.
AC_CHECK_PROGS([LSB_RELEASE],[lsb_release])
AC_CHECK_PROGS([DPKG_GENSYMBOLS],[dpkg-gensymbols])
AC_CHECK_PROGS([PERL],[perl])
AC_CHECK_PROGS([WINE],['wine'])
AX_PROG_SPHINX_BUILD(,[AC_MSG_WARN([sphinx-build version 1.0 or greater is required to build man pages])])
#AX_PROG_VALGRIND([memcheck],[--error-exitcode=1 --leak-check=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE --suppressions=valgrind.supp])
AX_WITH_PROG([LCOV],[lcov])
AX_WITH_PROG([LCOV_GENHTML],[genhtml])
AC_CHECK_PROGS([RPMBUILD],[rpmbuild --nocheck])
AC_CHECK_PROGS([RPMDEV_SETUPTREE],[rpmdev-setuptree])
AC_CHECK_PROGS([RPM],[rpm])
# Checks for libraries.
AX_CXX_GCC_ABI_DEMANGLE
# Checks for header files.
AC_CHECK_HEADERS_ONCE([features.h])
# We use the header to cross test our m4 rules that also test
AC_DEFUN([CHECK_FOR_CXXABI],
[AC_LANG_PUSH([C++])
AS_IF([test "x${TARGET_WINDOWS}" != "xtrue"],
[AC_CHECK_HEADERS([cxxabi.h])])
AC_LANG_POP
])
CHECK_FOR_CXXABI
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AX_PRINTF_STRERROR
AX_PTHREAD_TIMEDJOIN_NP
AX_CHECK_LIBRARY([LIBATTACHSQL], [libattachsql-1.0/attachsql.h], [attachsql], [], [AC_MSG_ERROR(could not find libAttachSQL)])
AX_ENDIAN
AX_HEX_VERSION([ATTACHBENCH],[$VERSION])
AC_SUBST([RPM_RELEASE],[1])
AX_HARDEN_COMPILER_FLAGS
AC_DEFINE_UNQUOTED([C_COMPILER_VENDOR],["$ax_cv_c_compiler_vendor"],[Compiler vendor])
AC_DEFINE_UNQUOTED([CXX_COMPILER_VENDOR],["$ax_cv_cxx_compiler_vendor"],[Compiler vendor])
AC_DEFINE_UNQUOTED([CC],["$CC"],[Compiler information for CC compiler])
AC_DEFINE_UNQUOTED([CXX],["$CXX"],[Compiler information for CXX compiler])
AC_DEFINE_UNQUOTED([CC_VERSION],["$CC_VERSION"],[Version information for CC compiler])
AC_DEFINE_UNQUOTED([CXX_VERSION],["$CXX_VERSION"],[Version information for CXX compiler])
AC_DEFINE_UNQUOTED([CFLAGS],["$CFLAGS"],[CFLAGS used for compiling binary])
AC_DEFINE_UNQUOTED([CXXFLAGS],["$CXXFLAGS"],[CXXFLAGS used for compiling binary])
AS_IF([test -n "${LSB_RELEASE}"],[
LSB_DESCRIPTION="`lsb_release -d -s`"
],[LSB_DESCRIPTION="unknown"])
AX_AM_JOBSERVER([yes])
AC_CONFIG_FILES([Makefile
version.h
])
AX_CREATE_GENERIC_CONFIG
AC_OUTPUT
echo "---"
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
echo ""
echo " * Installation prefix: $prefix"
echo " * LSB Release: $LSB_RELEASE"
echo " * System type: $host_vendor-$host_os"
echo " * Host CPU: $host_cpu"
echo " * Compiler Vendor: $ax_cv_c_compiler_vendor"
echo " * C Compiler: $CC"
echo " * C Compiler Version: $ax_c_compiler_version"
echo " * C Flags: $CFLAGS"
echo " * C++ Compiler: $CXX"
echo " * C++ Version: $ax_cxx_compiler_version"
echo " * C++ Flags: $CXXFLAGS"
echo " * CPP Flags: $CPPFLAGS"
echo " * LIBS Flags: $LIBS"
echo " * LDFLAGS Flags: $LDFLAGS"
echo " * Assertions enabled: $ax_enable_assert"
echo " * Debug enabled: $ax_enable_debug"
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
echo " * libAttachSQL: $ax_cv_have_LIBATTACHSQL"
echo " * make -j: $enable_jobserver"
echo " * VCS checkout: $ac_cv_vcs_system"
echo ""
echo "---"