summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac67
1 files changed, 67 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..7e6764d
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,67 @@
1# Process this file with autoconf to produce a configure script.
2
3AC_PREREQ(2.59)
4AC_INIT(mysql-table-sizes-plugin, [dev])
5AC_CANONICAL_TARGET
6AC_CONFIG_MACRO_DIR([m4])
7
8AM_INIT_AUTOMAKE
9
10AC_CONFIG_SRCDIR([src/table_sizes.cc])
11AC_CONFIG_HEADER([src/config.h])
12
13AC_DEFUN([CHECK_DEBUG], [
14 debug_default="no"
15 AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging
16 [default=no]],, enable_debug=$debug_default)
17 AC_MSG_CHECKING(whether to enable debugging)
18
19 if test "x$enable_debug" = "xyes"
20 then
21 CPPFLAGS="$CPPFLAGS -g -D_DEBUG"
22 AC_MSG_RESULT(yes)
23 else
24 CPPFLAGS="$CPPFLAGS -g -O2 -DDBUG_OFF"
25 AC_MSG_RESULT(no)
26 fi
27])
28
29dnl Run tests using C++ compiler
30dnl AC_LANG(C++)
31
32#check debug
33CHECK_DEBUG
34
35#check for mysql src
36MYSQL_SRC_TEST
37MYSQL_PLUGIN_DIR_TEST
38#MYSQL_LIB_SERVICES_TEST
39AC_SUBST(MYSQL_INC)
40AC_SUBST(MYSQL_PLUGIN_DIR)
41#AC_SUBST(MYSQL_LIBSERVICES)
42
43#check for programs
44AC_PROG_CC
45AC_PROG_LIBTOOL
46AC_PROG_CXX
47AC_PROG_CPP
48
49#we can add the following flags for better error catching: -Werror -Wimplicit
50CPPFLAGS="$CPPFLAGS -Werror -Wimplicit"
51# From MySQL: Disable exceptions as they seams to create problems with gcc and threads.
52CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-rtti"
53
54#make sure we have const
55AC_C_CONST
56AC_TYPE_SIZE_T
57
58#subst the relevant variables
59AC_SUBST(CPPFLAGS)
60AC_SUBST(CXXLAGS)
61AC_SUBST(CFLAGS)
62
63AC_CONFIG_FILES([
64 Makefile
65 src/Makefile
66])
67AC_OUTPUT