1# configure.ac -*- autoconf -*- vim: filetype=config
2#
3# DDM4
4# Copyright (C) 2012 Data Differential, http://datadifferential.com/
5# All rights reserved.
6#
7# Use and distribution licensed under the BSD license.  See
8# the COPYING file in this directory for full text.
9
10AC_COPYRIGHT([2019 MariaDB Corporation Ab])
11#AC_REVISION([m4_esyscmd_s([git describe --always])])
12AC_PREREQ([2.63])
13
14# These two needed for RHEL/CentOS 6
15m4_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]))])])
16
17m4_ifndef([AS_VAR_COPY], [m4_define([AS_VAR_COPY], [AS_LITERAL_IF([$1[]$2], [$1=$$2],[eval $1=\$$2])])])
18
19# NOTE: Major version should be < 100 and minor/patch < 256 or bad things will
20# happen in src/asql/utility.cc
21AC_INIT([libmarias3],m4_esyscmd_s([tr -d '\n' < VERSION]),[linuxjedi@mariadb.com],[libmarias3],[https://mariadb.com])
22m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
23
24# Must come before AM_INIT_AUTOMAKE.
25AC_CONFIG_AUX_DIR([build-aux])
26AC_CANONICAL_HOST
27AC_CONFIG_MACRO_DIR([m4])
28
29# Setup the compilers early on
30AC_PROG_CC([cc gcc clang])
31
32# Automake version before 1.13 (when the serial-tests option was dnl still the default) still defined the badly obsolete macro.  'AC_PROG_INSTALL'.
33AM_INIT_AUTOMAKE(1.11 no-define color-tests -Wno-portability subdir-objects foreign tar-ustar m4_ifndef([AC_PROG_INSTALL], [serial-tests]))
34
35AC_ARG_PROGRAM
36AC_USE_SYSTEM_EXTENSIONS
37
38AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
39
40# shared library versioning
41LIBMARIAS3_LIBRARY_VERSION=4:2:1
42#                          | | |
43#                   +------+ | +---+
44#                   |        |     |
45#                current:revision:age
46#                   |        |     |
47#                   |        |     +- increment if interfaces have been added
48#                   |        |        set to zero if interfaces have been removed or changed
49#                   |        +- increment if source code has changed
50#                   |           set to zero if current is incremented
51#                   +- increment if interfaces have been added, removed or changed
52AC_SUBST([LIBMARIAS3_LIBRARY_VERSION])
53
54LT_PREREQ([2.2])
55LT_INIT
56LT_LANG([C])
57
58AX_PLATFORM
59
60CONFIG_EXTRA
61
62# Checks for programs.
63AC_CHECK_PROGS([LSB_RELEASE],[lsb_release])
64AC_CHECK_PROGS([DPKG_GENSYMBOLS],[dpkg-gensymbols])
65AX_PROG_SPHINX_BUILD(,[AC_MSG_WARN([sphinx-build version 1.0 or greater is required to build man pages])])
66#AX_PROG_VALGRIND([memcheck],[--error-exitcode=1 --leak-check=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE --suppressions=valgrind.supp])
67AC_CHECK_PROGS([RPMBUILD],[rpmbuild --nocheck])
68AC_CHECK_PROGS([RPMDEV_SETUPTREE],[rpmdev-setuptree])
69AC_CHECK_PROGS([RPM],[rpm])
70
71# Checks for typedefs, structures, and compiler characteristics.
72
73PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.0], [ax_cv_libcurl=yes], [AC_MSG_ERROR(could not find a suitable version of libcurl)])
74LT_LIB_M
75
76AX_ENDIAN
77AX_HEX_VERSION([LIBMARIAS3],[$VERSION])
78AC_SUBST([RPM_RELEASE],[1])
79
80AX_HARDEN_COMPILER_FLAGS
81
82AC_DEFINE_UNQUOTED([C_COMPILER_VENDOR],["$ax_cv_c_compiler_vendor"],[Compiler vendor])
83AC_DEFINE_UNQUOTED([CC],["$CC"],[Compiler information for CC compiler])
84AC_DEFINE_UNQUOTED([CC_VERSION],["$CC_VERSION"],[Version information for CC compiler])
85AC_DEFINE_UNQUOTED([CFLAGS],["$CFLAGS"],[CFLAGS used for compiling binary])
86
87AS_IF([test -n "${LSB_RELEASE}"],[
88       LSB_DESCRIPTION="`lsb_release -d -s`"
89       ],[LSB_DESCRIPTION="unknown"])
90
91AX_AM_JOBSERVER([yes])
92
93AC_CONFIG_FILES([Makefile
94                 rpm/libmarias3.spec
95                 version.h
96                 libmarias3.pc
97                 ])
98
99AX_CREATE_GENERIC_CONFIG
100
101AC_OUTPUT
102
103echo "---"
104echo "Configuration summary for $PACKAGE_NAME version $VERSION"
105echo ""
106echo "   * Installation prefix:       $prefix"
107echo "   * LSB Release:               $LSB_RELEASE"
108echo "   * System type:               $host_vendor-$host_os"
109echo "   * Host CPU:                  $host_cpu"
110echo "   * Compiler Vendor:           $ax_cv_c_compiler_vendor"
111echo "   * C Compiler:                $CC"
112echo "   * C Compiler Version:        $ax_c_compiler_version"
113echo "   * C Flags:                   $CFLAGS"
114echo "   * LIBS Flags:                $LIBS"
115echo "   * LDFLAGS Flags:             $LDFLAGS"
116echo "   * Assertions enabled:        $ax_enable_assert"
117echo "   * Debug enabled:             $ax_enable_debug"
118echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
119echo "   * make -j:                   $enable_jobserver"
120echo "   * VCS checkout:              $ac_cv_vcs_system"
121echo ""
122echo "---"
123