summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-02-10 17:18:44 +0000
committerMonty Taylor <mordred@inaugust.com>2019-02-10 17:31:33 +0000
commit31d726c6e6aa02957e6885a2c733ea0288f60525 (patch)
tree41d295227c65efd5df850e11098b9af4096b4131
parentb1063b17e04b97fa57adda1ab75093062a85286e (diff)
Overhaul warnings, debug and optimize settings
There's a ton of stuff in here that's holdovers from the days of Drizzle, such as intel c compiler and solaris support, that can just flat go away. There's also support for being able to turn off a bunch of various things with m4 parameters that were there to let us deal with legacy MySQL code. We don't need any of those. We can also just depend on autoconf archive for more functions and align with the behavior there rather than carrying local logic. While we're at it, rename both pandora and zuul prefixed things to opendev. pandora-build is what we were calling the collection of autoconf stuff 10 years ago, but is a long-dead project. That said, none of this is specific to zuul, but might still be useful for general C++ "I want to build things cleanly and stricly like Drizzle did". Use opendev for now, with the thought that perhaps we'll extract these into their own repo to be used by people should they choose. Perhaps a better prefix choice would be "DRIZZLE_" - since these are "build things inspired by Drizzle" - but maybe that implies a provenance that doesn't exist. Update copyright for the files that have essentially been rewritten. For the ones that are still legitimately based on the original code, add a Red Hat header line.
-rw-r--r--Dockerfile4
-rw-r--r--configure.ac51
-rw-r--r--m4/ax_vcs_checkout.m475
-rw-r--r--m4/opendev_canonical.m458
-rw-r--r--m4/opendev_optimize.m449
-rw-r--r--m4/opendev_warnings.m4169
-rw-r--r--m4/pandora_64bit.m460
-rw-r--r--m4/pandora_have_libcpprest.m429
-rw-r--r--m4/pandora_optimize.m434
-rw-r--r--m4/pandora_vc_build.m478
-rw-r--r--m4/pandora_warnings.m4428
-rw-r--r--m4/require_libcpprest.m443
-rw-r--r--m4/zuul_canonical.m496
13 files changed, 332 insertions, 842 deletions
diff --git a/Dockerfile b/Dockerfile
index 5cbdedc..dfe4c5b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,14 +16,14 @@
16FROM debian:testing as builder 16FROM debian:testing as builder
17 17
18RUN mkdir -p /output/bindep 18RUN mkdir -p /output/bindep
19RUN apt-get update && apt-get install -y python3-pip && pip3 install bindep 19RUN apt-get update && apt-get install -y python3-pip git && pip3 install bindep
20COPY bindep.txt /bindep.txt 20COPY bindep.txt /bindep.txt
21RUN cd / && bindep -l newline > /output/bindep/run.txt 21RUN cd / && bindep -l newline > /output/bindep/run.txt
22RUN apt-get install -y $(bindep -b compile) 22RUN apt-get install -y $(bindep -b compile)
23COPY . /src 23COPY . /src
24RUN cd /src \ 24RUN cd /src \
25 && autoreconf -fi \ 25 && autoreconf -fi \
26 && ./configure \ 26 && ./configure --with-comment=$(git describe --always) \
27 && make \ 27 && make \
28 && make install 28 && make install
29 29
diff --git a/configure.ac b/configure.ac
index 3636b30..86e4fe9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,8 @@
1dnl -*- bash -*- 1dnl -*- bash -*-
2dnl Process this file with autoconf to produce a configure script. 2dnl Process this file with autoconf to produce a configure script.
3 3
4dnl Copyright (C) 2009 Sun Microsystems, Inc. 4dnl Copyright 2009 Sun Microsystems, Inc.
5dnl Copyright 2019 Red Hat, Inc.
5dnl 6dnl
6dnl This program is free software; you can redistribute it and/or modify 7dnl This program is free software; you can redistribute it and/or modify
7dnl it under the terms of the GNU General Public License as published by 8dnl it under the terms of the GNU General Public License as published by
@@ -41,35 +42,13 @@ AC_CONFIG_HEADERS([config.h])
41 42
42AC_CONFIG_SRCDIR([zuul-preview/main.cc]) 43AC_CONFIG_SRCDIR([zuul-preview/main.cc])
43 44
44ZUUL_CANONICAL_TARGET([require-cxx, version-from-vc]) 45OPENDEV_CANONICAL_TARGET
45 46
46LT_PREREQ([2.4]) 47LT_PREREQ([2.4])
47LT_INIT 48LT_INIT
48LT_LANG([C++]) 49LT_LANG([C++])
49 50
50AS_IF([test "x${pandora_cv_skip_requires}" != "xno"],[ 51REQUIRE_LIBCPPREST
51
52 AC_ARG_WITH([comment],
53 [AS_HELP_STRING([--with-comment],
54 [Comment about compilation environment. @<:@default=off@:>@])],
55 [with_comment=$withval],
56 [with_comment=no])
57 AS_IF([test "$with_comment" != "no"],[
58 COMPILATION_COMMENT=$with_comment
59 ],[
60 COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
61 ])
62 AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
63 [Comment about compilation environment])
64])
65
66AX_PTHREAD([
67 AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
68 AM_LDFLAGS="${PTHREAD_LIBS} ${AM_LDFLAGS}"
69 LIBS="${PTHREAD_LIBS} ${LIBS}"
70 ], [AC_MSG_ERROR([zuul-preview requires pthreads])])
71
72PANDORA_REQUIRE_LIBCPPREST
73 52
74######################################################################### 53#########################################################################
75 54
@@ -77,8 +56,6 @@ AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
77 LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}" 56 LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
78 ]) 57 ])
79 58
80AM_CXXFLAGS="-std=c++14 $AM_CXXFLAGS"
81
82AC_CONFIG_FILES([Makefile]) 59AC_CONFIG_FILES([Makefile])
83 60
84AC_OUTPUT 61AC_OUTPUT
@@ -86,19 +63,13 @@ AC_OUTPUT
86echo "---" 63echo "---"
87echo "Configuration summary for $PACKAGE_NAME version $VERSION" 64echo "Configuration summary for $PACKAGE_NAME version $VERSION"
88echo "" 65echo ""
89echo " * Installation prefix: $prefix" 66echo " * Installation prefix: $prefix"
90echo " * System type: $host_vendor-$host_os" 67echo " * System type: $host_vendor-$host_os"
91echo " * Host CPU: $host_cpu" 68echo " * Host CPU: $host_cpu"
92echo " * C++ Compiler: $CXX_VERSION" 69echo " * C++ Flags: $AM_CXXFLAGS"
93echo " * C++ Flags: $CXXFLAGS" 70echo " * CPP Flags: $AM_CPPFLAGS"
94echo " * C++ AM Flags: $AM_CXXFLAGS" 71echo " * Debug enabled: $enable_debug"
95echo " * CPP Flags: $CPPFLAGS" 72echo " * Coverage enabled: $enable_code_coverage"
96echo " * CPP AM Flags: $AM_CPPFLAGS"
97echo " * Assertions enabled: $ac_cv_assert"
98echo " * Debug enabled: $with_debug"
99echo " * Profiling enabled: $ac_profiling"
100echo " * Coverage enabled: $ac_coverage"
101echo " * Warnings as failure: $ac_cv_warnings_as_errors"
102echo "" 73echo ""
103echo "---" 74echo "---"
104 75
diff --git a/m4/ax_vcs_checkout.m4 b/m4/ax_vcs_checkout.m4
deleted file mode 100644
index 8047b65..0000000
--- a/m4/ax_vcs_checkout.m4
+++ /dev/null
@@ -1,75 +0,0 @@
1# ===========================================================================
2# http://
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_VCS_CHECKOUT
8#
9# DESCRIPTION
10#
11# Discover whether or not we are operating with a tree which
12# has been checked out of a version control system.
13#
14#
15# LICENSE
16#
17# Copyright (C) 2012 Brian Aker
18# All rights reserved.
19#
20# Redistribution and use in source and binary forms, with or without
21# modification, are permitted provided that the following conditions are
22# met:
23#
24# * Redistributions of source code must retain the above copyright
25# notice, this list of conditions and the following disclaimer.
26#
27# * Redistributions in binary form must reproduce the above
28# copyright notice, this list of conditions and the following disclaimer
29# in the documentation and/or other materials provided with the
30# distribution.
31#
32# * The names of its contributors may not be used to endorse or
33# promote products derived from this software without specific prior
34# written permission.
35#
36# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
48#serial 6
49
50AC_DEFUN([AX_VCS_SYSTEM],
51 [AC_PREREQ([2.63])dnl
52 AC_CACHE_CHECK([for vcs system], [ac_cv_vcs_system],
53 [ac_cv_vcs_system="none"
54 AS_IF([test -d ".bzr"],[ac_cv_vcs_system="bazaar"])
55 AS_IF([test -d ".svn"],[ac_cv_vcs_system="svn"])
56 AS_IF([test -d ".hg"],[ac_cv_vcs_system="mercurial"])
57 AS_IF([test -d ".git"],[ac_cv_vcs_system="git"])
58 ])
59 AC_DEFINE_UNQUOTED([VCS_SYSTEM],["$ac_cv_vcs_system"],[VCS system])
60 ])
61
62AC_DEFUN([AX_VCS_CHECKOUT],
63 [AC_PREREQ([2.63])dnl
64 AC_REQUIRE([AX_VCS_SYSTEM])
65 AC_CACHE_CHECK([for vcs checkout],[ac_cv_vcs_checkout],
66 [AS_IF([test "x$ac_cv_vcs_system" != "xnone"],
67 [ac_cv_vcs_checkout=yes],
68 [ac_cv_vcs_checkout=no])
69 ])
70
71 AM_CONDITIONAL([IS_VCS_CHECKOUT],[test "x$ac_cv_vcs_checkout" = "xyes"])
72 AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"],
73 [AC_DEFINE([VCS_CHECKOUT],[1],[Define if the code was built from VCS.])],
74 [AC_DEFINE([VCS_CHECKOUT],[0],[Define if the code was built from VCS.])])
75 ])
diff --git a/m4/opendev_canonical.m4 b/m4/opendev_canonical.m4
new file mode 100644
index 0000000..9dccd1e
--- /dev/null
+++ b/m4/opendev_canonical.m4
@@ -0,0 +1,58 @@
1# Copyright (C) 2009 Sun Microsystems, Inc.
2# Copyright (C) 2019 Red Hat, Inc
3# This file is free software; The Autoconf Macro copyright holders
4# give unlimited permission to copy and/or distribute it,
5# with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([OPENDEV_CANONICAL_TARGET],[
8
9 AC_REQUIRE([AC_PROG_CC])
10 AC_REQUIRE([AC_PROG_CXX])
11
12 # We need to prevent canonical target
13 # from injecting -O2 into CFLAGS - but we won't modify anything if we have
14 # set CFLAGS on the command line, since that should take ultimate precedence
15 AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
16 [CFLAGS=""])
17 AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
18 [CXXFLAGS=""])
19
20 AX_IS_RELEASE(always)
21 AM_SILENT_RULES([yes])
22
23 AX_CXX_COMPILE_STDCXX([14],[],[mandatory])
24 AM_PROG_CC_C_O
25 AC_PROG_CC_STDC
26 gl_VISIBILITY
27
28 OPENDEV_OPTIMIZE
29 OPENDEV_WARNINGS
30
31 AC_ARG_WITH([comment],
32 [AS_HELP_STRING([--with-comment],
33 [Comment about compilation environment. @<:@default=off@:>@])],
34 [with_comment=$withval],
35 [with_comment=no])
36 AS_IF([test "$with_comment" != "no"],[
37 COMPILATION_COMMENT=$with_comment
38 ],[
39 COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
40 ])
41 AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
42 [Comment about compilation environment])
43
44 AX_PTHREAD([
45 AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
46 AM_LDFLAGS="${PTHREAD_LIBS} ${AM_LDFLAGS}"
47 LIBS="${PTHREAD_LIBS} ${LIBS}"
48 ], [AC_MSG_ERROR([${PACKAGE} requires pthreads])])
49
50 AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
51 AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
52
53 AC_SUBST([AM_CFLAGS])
54 AC_SUBST([AM_CXXFLAGS])
55 AC_SUBST([AM_CPPFLAGS])
56 AC_SUBST([AM_LDFLAGS])
57
58])
diff --git a/m4/opendev_optimize.m4 b/m4/opendev_optimize.m4
new file mode 100644
index 0000000..23db06e
--- /dev/null
+++ b/m4/opendev_optimize.m4
@@ -0,0 +1,49 @@
1# Copyright (C) 2019 Red Hat, Inc
2#
3# This program is free software; you can redistribute it and/or modify it
4# under the terms of the GNU General Public License as published by the
5# Free Software Foundation; either version 3 of the License, or (at your
6# option) any later version.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11# Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program. If not, see <http://www.gnu.org/licenses/>.
15#
16# As a special exception, the respective Autoconf Macro's copyright owner
17# gives unlimited permission to copy, distribute and modify the configure
18# scripts that are the output of Autoconf when processing the Macro. You
19# need not follow the terms of the GNU General Public License when using
20# or distributing such scripts, even though portions of the text of the
21# Macro appear in them. The GNU General Public License (GPL) does govern
22# all other use of the material that constitutes the Autoconf Macro.
23#
24# This special exception to the GPL applies to versions of the Autoconf
25# Macro released by the Autoconf Macro's copyright owner. When you make
26# and distribute a modified version of the Autoconf Macro, you may extend
27# this special exception to the GPL to apply to your modified version as well.
28
29AC_DEFUN([OPENDEV_OPTIMIZE],[
30 AC_REQUIRE([AX_CODE_COVERAGE])
31
32 AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
33
34 AS_IF([test "$enable_code_coverage" = "yes"],[
35 AM_CPPFLAGS="${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS}"
36 AM_CFLAGS="${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS}"
37 AM_CXXFLAGS="${AM_CXXFLAGS} ${CODE_COVERAGE_CXXFLAGS}"
38 AM_LDFLAGS="${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS}"
39 ])
40
41 OPTIMIZE_CFLAGS="-O2"
42 OPTIMIZE_CXXFLAGS="-O2"
43
44 AS_IF([test "$enable_debug" = "no"],[
45 # Optimized version. No debug
46 AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
47 AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
48 ])
49])
diff --git a/m4/opendev_warnings.m4 b/m4/opendev_warnings.m4
new file mode 100644
index 0000000..7e2c896
--- /dev/null
+++ b/m4/opendev_warnings.m4
@@ -0,0 +1,169 @@
1# Copyright (C) 2009 Sun Microsystems, Inc.
2# Copyright (C) 2019 Red Hat, Inc
3# This file is free software; The Autoconf Macro copyright holders
4# give unlimited permission to copy and/or distribute it,
5# with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([OPENDEV_WARNINGS],[
8
9 AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
10 [ac_cv_safe_to_use_fdiagnostics_show_option_],
11 [save_CFLAGS="$CFLAGS"
12 CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
13 AC_COMPILE_IFELSE(
14 [AC_LANG_PROGRAM([],[])],
15 [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
16 [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
17 CFLAGS="$save_CFLAGS"])
18
19 AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
20 [F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"])
21
22 AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
23 [ac_cv_safe_to_use_floop_parallelize_all_],
24 [save_CFLAGS="$CFLAGS"
25 CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
26 AC_COMPILE_IFELSE(
27 [AC_LANG_PROGRAM([],[])],
28 [ac_cv_safe_to_use_floop_parallelize_all_=yes],
29 [ac_cv_safe_to_use_floop_parallelize_all_=no])
30 CFLAGS="$save_CFLAGS"])
31
32 AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
33 [F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"])
34
35 BASE_WARNINGS="-Wextra -pedantic -Wall -Wundef -Wshadow ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} -Wstrict-aliasing -Wswitch-enum "
36 CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
37 CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
38
39 AC_CACHE_CHECK([whether it is safe to use -Wextra],[ac_cv_safe_to_use_Wextra_],[
40 save_CFLAGS="$CFLAGS"
41 CFLAGS="-Wextra -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
42 AC_COMPILE_IFELSE([
43 AC_LANG_PROGRAM(
44 [[
45#include <stdio.h>
46 ]], [[]]
47 )],
48 [ac_cv_safe_to_use_Wextra_=yes],
49 [ac_cv_safe_to_use_Wextra_=no])
50 CFLAGS="$save_CFLAGS"
51 ])
52
53 AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
54 [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
55 [BASE_WARNINGS="${BASE_WARNINGS} -W"])
56
57 AC_CACHE_CHECK([whether it is safe to use -Wformat],[ac_cv_safe_to_use_wformat_],[
58 save_CFLAGS="$CFLAGS"
59 dnl Use -Werror here instead of -Wextra so that we don't spew
60 dnl conversion warnings to all the tarball folks
61 CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
62 AC_COMPILE_IFELSE([
63 AC_LANG_PROGRAM(
64 [[
65#include <stdio.h>
66#include <stdint.h>
67#include <inttypes.h>
68void foo();
69void foo()
70{
71 uint64_t test_u= 0;
72 printf("This is a %" PRIu64 "test\n", test_u);
73}
74 ]],[[
75foo();
76 ]]
77 )],
78 [ac_cv_safe_to_use_wformat_=yes],
79 [ac_cv_safe_to_use_wformat_=no])
80 CFLAGS="$save_CFLAGS"])
81
82 AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],
83 [BASE_WARNINGS="${BASE_WARNINGS} -Wformat=2"],
84 [BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"])
85
86 AC_CACHE_CHECK([whether it is safe to use -Wconversion],[ac_cv_safe_to_use_wconversion_],[
87 save_CFLAGS="$CFLAGS"
88 dnl Use -Werror here instead of -Wextra so that we don't spew
89 dnl conversion warnings to all the tarball folks
90 CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
91 AC_COMPILE_IFELSE([
92 AC_LANG_PROGRAM(
93 [[
94#include <stdbool.h>
95void foo(bool a)
96{
97 (void)a;
98}
99 ]],[[
100foo(0);
101 ]]
102 )],
103 [ac_cv_safe_to_use_wconversion_=yes],
104 [ac_cv_safe_to_use_wconversion_=no])
105 CFLAGS="$save_CFLAGS"])
106
107 AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
108 [W_CONVERSION="-Wconversion"])
109
110 CC_WARNINGS="${BASE_WARNINGS} -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL} ${W_CONVERSION}"
111 CXX_WARNINGS="${BASE_WARNINGS} -Wattributes -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${CXX_WARNINGS_FULL} ${W_CONVERSION}"
112
113 AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],[ac_cv_safe_to_use_Wframe_larger_than_],[
114 AC_LANG_PUSH(C++)
115 save_CXXFLAGS="$CXXFLAGS"
116 CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
117 AC_COMPILE_IFELSE([
118 AC_LANG_PROGRAM(
119 [[
120#include <stdio.h>
121 ]], [[]]
122 )],
123 [ac_cv_safe_to_use_Wframe_larger_than_=yes],
124 [ac_cv_safe_to_use_Wframe_larger_than_=no])
125 CXXFLAGS="$save_CXXFLAGS"
126 AC_LANG_POP()
127 ])
128
129 AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
130 [CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
131
132 AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],[ac_cv_safe_to_use_Wlogical_op_],[
133 save_CFLAGS="$CFLAGS"
134 CFLAGS="-Wextra -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
135 AC_COMPILE_IFELSE([
136 AC_LANG_PROGRAM(
137 [[
138#include <stdio.h>
139 ]], [[]]
140 )],
141 [ac_cv_safe_to_use_Wlogical_op_=yes],
142 [ac_cv_safe_to_use_Wlogical_op_=no])
143 CFLAGS="$save_CFLAGS"])
144
145 AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
146 [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
147
148 AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],[ac_cv_safe_to_use_Wredundant_decls_],[
149 AC_LANG_PUSH(C++)
150 save_CXXFLAGS="${CXXFLAGS}"
151 CXXFLAGS="-Wextra -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
152 AC_COMPILE_IFELSE([
153 AC_LANG_PROGRAM(
154 [
155template <typename E> struct C { void foo(); };
156template <typename E> void C<E>::foo() { }
157template <> void C<int>::foo();
158AC_INCLUDES_DEFAULT
159 ])],
160 [ac_cv_safe_to_use_Wredundant_decls_=yes],
161 [ac_cv_safe_to_use_Wredundant_decls_=no])
162 CXXFLAGS="${save_CXXFLAGS}"
163 AC_LANG_POP()])
164
165 AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
166 [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
167 [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
168
169])
diff --git a/m4/pandora_64bit.m4 b/m4/pandora_64bit.m4
deleted file mode 100644
index 5d9983b..0000000
--- a/m4/pandora_64bit.m4
+++ /dev/null
@@ -1,60 +0,0 @@
1dnl Copyright (C) 2009 Sun Microsystems, Inc.
2dnl This file is free software; Sun Microsystems, Inc.
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6dnl ---------------------------------------------------------------------------
7dnl Macro: PANDORA_64BIT
8dnl ---------------------------------------------------------------------------
9AC_DEFUN([PANDORA_64BIT],[
10 AC_BEFORE([$0], [AC_LIB_PREFIX])
11
12 AC_ARG_ENABLE([64bit],
13 [AS_HELP_STRING([--disable-64bit],
14 [Build 64 bit binary @<:@default=on@:>@])],
15 [ac_enable_64bit="$enableval"],
16 [ac_enable_64bit="yes"])
17
18 AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
19 AS_IF([test "x$ISAINFO" != "xno"],
20 [isainfo_b=`${ISAINFO} -b`],
21 [isainfo_b="x"])
22
23 AS_IF([test "$isainfo_b" != "x" -a "$isainfo_b" != "32"],[
24
25 isainfo_k=`${ISAINFO} -k`
26 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
27
28 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
29
30 AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
31 LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
32 ])
33
34 AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
35 dnl The user hasn't overridden the default libdir, so we'll
36 dnl the dir suffix to match solaris 32/64-bit policy
37 libdir="${libdir}/${isainfo_k}"
38 ])
39
40 AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
41 CFLAGS="${CFLAGS} -m64"
42 ac_cv_env_CFLAGS_set=set
43 ac_cv_env_CFLAGS_value='-m64'
44 ])
45 AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
46 CXXFLAGS="${CXXFLAGS} -m64"
47 ac_cv_env_CXXFLAGS_set=set
48 ac_cv_env_CXXFLAGS_value='-m64'
49 ])
50
51 AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
52 AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
53 AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
54 ])
55 ])
56 ])
57])
58dnl ---------------------------------------------------------------------------
59dnl End Macro: PANDORA_64BIT
60dnl ---------------------------------------------------------------------------
diff --git a/m4/pandora_have_libcpprest.m4 b/m4/pandora_have_libcpprest.m4
deleted file mode 100644
index 2f99d2e..0000000
--- a/m4/pandora_have_libcpprest.m4
+++ /dev/null
@@ -1,29 +0,0 @@
1dnl Copyright (C) 2019 Red Hat, Inc
2dnl This file is free software; Red Hat, Inc
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6dnl Provides support for finding libcpprest.
7dnl LIBCPPREST_CFLAGS will be set, in addition to LIBCPPREST and LTLIBCPPREST
8
9AC_DEFUN([_PANDORA_SEARCH_LIBCPPREST],[
10 dnl --------------------------------------------------------------------
11 dnl Check for libcpprest
12 dnl --------------------------------------------------------------------
13
14 AC_SEARCH_LIBS([CONF_modules_unload], [crypto])
15 AC_LANG_PUSH([C++])
16 AX_CXX_CHECK_LIB(boost_system, [boost::system::system_category()])
17 AX_CXX_CHECK_LIB(cpprest, [utility::datetime::utc_now()])
18 AC_LANG_POP()
19])
20
21AC_DEFUN([PANDORA_HAVE_LIBCPPREST],[
22 AC_REQUIRE([_PANDORA_SEARCH_LIBCPPREST])
23])
24
25AC_DEFUN([PANDORA_REQUIRE_LIBCPPREST],[
26 AC_REQUIRE([_PANDORA_SEARCH_LIBCPPREST])
27 AS_IF([test "x${ac_cv_lib_cpprest_utility__datetime__utc_now__}" = "xno"],
28 PANDORA_MSG_ERROR([libcpprest is required for ${PACKAGE}.]))
29])
diff --git a/m4/pandora_optimize.m4 b/m4/pandora_optimize.m4
deleted file mode 100644
index 07eabcf..0000000
--- a/m4/pandora_optimize.m4
+++ /dev/null
@@ -1,34 +0,0 @@
1dnl Copyright (C) 2009 Sun Microsystems, Inc.
2dnl This file is free software; Sun Microsystems, Inc.
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([PANDORA_OPTIMIZE],[
7 dnl Build optimized or debug version ?
8 dnl First check for gcc and g++
9 AS_IF([test "$GCC" = "yes"],[
10
11 AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
12
13 DEBUG_CFLAGS="-O0"
14 DEBUG_CXXFLAGS="-O0"
15
16 OPTIMIZE_CFLAGS="-O2"
17 OPTIMIZE_CXXFLAGS="-O2"
18 ])
19
20 AC_ARG_WITH([debug],
21 [AS_HELP_STRING([--with-debug],
22 [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
23 [with_debug=$withval],
24 [with_debug=no])
25 AS_IF([test "$with_debug" = "yes"],[
26 # Debugging. No optimization.
27 AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG"
28 AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG"
29 ],[
30 # Optimized version. No debug
31 AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
32 AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
33 ])
34])
diff --git a/m4/pandora_vc_build.m4 b/m4/pandora_vc_build.m4
deleted file mode 100644
index fe8c85b..0000000
--- a/m4/pandora_vc_build.m4
+++ /dev/null
@@ -1,78 +0,0 @@
1dnl Copyright (C) 2009 Sun Microsystems, Inc.
2dnl This file is free software; Sun Microsystems, Inc.
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([PANDORA_TEST_VC_DIR],[
7 pandora_building_from_vc=no
8
9 if test -d ".git" ; then
10 pandora_building_from_git=yes
11 pandora_building_from_vc=yes
12 else
13 pandora_building_from_git=no
14 fi
15])
16
17AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
18 m4_syscmd(PANDORA_TEST_VC_DIR
19 m4_if(PCT_NO_VC_CHANGELOG,yes,[
20 vc_changelog=no
21 ],[
22 vc_changelog=yes
23 ])
24
25 [
26
27 if test "${pandora_building_from_git}" = "yes"; then
28 echo "# Grabbing changelog and version information from git"
29 # Fix this for git
30 PANDORA_RELEASE_VERSION=0.0.1
31 fi
32
33 if ! test -d config ; then
34 mkdir -p config
35 fi
36
37 if test "${pandora_building_from_git}" = "yes" -o ! -f config/pandora_vc_revinfo ; then
38 cat > config/pandora_vc_revinfo.tmp <<EOF
39PANDORA_RELEASE_VERSION=${PANDORA_RELEASE_VERSION}
40EOF
41 if ! diff config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo >/dev/null 2>&1 ; then
42 mv config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo
43 fi
44 rm -f config/pandora_vc_revinfo.tmp
45 fi
46 ])
47])
48
49AC_DEFUN([_PANDORA_READ_FROM_FILE],[
50 $1=`grep $1 $2 | cut -f2 -d=`
51])
52
53AC_DEFUN([PANDORA_VC_VERSION],[
54 AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
55
56 PANDORA_TEST_VC_DIR
57
58 AS_IF([test -f ${srcdir}/config/pandora_vc_revinfo],[
59 _PANDORA_READ_FROM_FILE(
60 [PANDORA_RELEASE_VERSION],${srcdir}/config/pandora_vc_revinfo)
61 ])
62
63 VERSION="${PANDORA_RELEASE_VERSION}"
64 AC_DEFINE_UNQUOTED(
65 [PANDORA_RELEASE_VERSION],
66 ["${PANDORA_RELEASE_VERSION}"],
67 [The real version of the software])
68])
69
70AC_DEFUN([PANDORA_VC_INFO_HEADER],[
71 AC_REQUIRE([PANDORA_VC_VERSION])
72 m4_define([PANDORA_VC_PREFIX],m4_toupper(m4_normalize(AC_PACKAGE_NAME))[_])
73
74 AC_DEFINE_UNQUOTED(
75 PANDORA_VC_PREFIX[RELEASE_VERSION],
76 ["$PANDORA_RELEASE_VERSION"],
77 [Release date and revision number of checkout])
78])
diff --git a/m4/pandora_warnings.m4 b/m4/pandora_warnings.m4
deleted file mode 100644
index 15c0e33..0000000
--- a/m4/pandora_warnings.m4
+++ /dev/null
@@ -1,428 +0,0 @@
1dnl Copyright (C) 2009 Sun Microsystems, Inc.
2dnl This file is free software; Sun Microsystems, Inc.
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on])
7dnl less-warnings turn on a limited set of warnings
8dnl warnings-always-on always set warnings=error regardless of tarball/vc
9
10dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to
11dnl allow it
12
13AC_DEFUN([PANDORA_WARNINGS],[
14 m4_define([PW_LESS_WARNINGS],[no])
15 m4_define([PW_WARN_ALWAYS_ON],[no])
16 ifdef([m4_define],,[define([m4_define], defn([define]))])
17 ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
18 m4_foreach([pw_arg],[$*],[
19 m4_case(pw_arg,
20 [less-warnings],[
21 m4_undefine([PW_LESS_WARNINGS])
22 m4_define([PW_LESS_WARNINGS],[yes])
23 ],
24 [warnings-always-on],[
25 m4_undefine([PW_WARN_ALWAYS_ON])
26 m4_define([PW_WARN_ALWAYS_ON],[yes])
27 ])
28 ])
29
30 AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
31 m4_if(PW_WARN_ALWAYS_ON, [yes],
32 [ac_cv_warnings_as_errors=yes],
33 AS_IF([test "$pandora_building_from_vc" = "yes"],
34 [ac_cv_warnings_as_errors=yes],
35 [ac_cv_warnings_as_errors=no]))
36
37 AC_ARG_ENABLE([gcc-profile-mode],
38 [AS_HELP_STRING([--enable-gcc-profile-mode],
39 [Toggle gcc profile mode @<:@default=off@:>@])],
40 [ac_gcc_profile_mode="$enableval"],
41 [ac_gcc_profile_mode="no"])
42
43 AC_ARG_ENABLE([profiling],
44 [AS_HELP_STRING([--enable-profiling],
45 [Toggle profiling @<:@default=off@:>@])],
46 [ac_profiling="$enableval"],
47 [ac_profiling="no"])
48
49 AC_ARG_ENABLE([coverage],
50 [AS_HELP_STRING([--enable-coverage],
51 [Toggle coverage @<:@default=off@:>@])],
52 [ac_coverage="$enableval"],
53 [ac_coverage="no"])
54
55 AS_IF([test "$GCC" = "yes"],[
56
57 AS_IF([test "$ac_profiling" = "yes"],[
58 CC_PROFILING="-pg"
59 GCOV_LIBS="-pg -lgcov"
60 save_LIBS="${LIBS}"
61 LIBS=""
62 AC_CHECK_LIB(c_p, read)
63 LIBC_P="${LIBS}"
64 LIBS="${save_LIBS}"
65 AC_SUBST(LIBC_P)
66 ],[
67 CC_PROFILING=" "
68 ])
69
70 AS_IF([test "$ac_coverage" = "yes"],
71 [
72 CC_COVERAGE="--coverage"
73 GCOV_LIBS="-lgcov"
74 ])
75
76
77
78 AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],[
79 W_FAIL="-Werror"
80 SPHINX_WARNINGS="-W"
81 dnl INTLTOOL_WARNINGS="yes"
82 ])
83
84 AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
85 [ac_cv_safe_to_use_fdiagnostics_show_option_],
86 [save_CFLAGS="$CFLAGS"
87 CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
88 AC_COMPILE_IFELSE(
89 [AC_LANG_PROGRAM([],[])],
90 [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
91 [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
92 CFLAGS="$save_CFLAGS"])
93
94 AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
95 [
96 F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
97 ])
98
99 AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
100 [ac_cv_safe_to_use_floop_parallelize_all_],
101 [save_CFLAGS="$CFLAGS"
102 CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
103 AC_COMPILE_IFELSE(
104 [AC_LANG_PROGRAM([],[])],
105 [ac_cv_safe_to_use_floop_parallelize_all_=yes],
106 [ac_cv_safe_to_use_floop_parallelize_all_=no])
107 CFLAGS="$save_CFLAGS"])
108
109 AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
110 [
111 F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
112 ])
113
114 NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
115 NO_SHADOW="-Wno-shadow"
116
117 AS_IF([test "$INTELCC" = "yes"],[
118 m4_if(PW_LESS_WARNINGS,[no],[
119 BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
120 ],[
121 dnl 2203 is like old-style-cast
122 dnl 1684 is like strict-aliasing
123 dnl 188 is about using enums as bitfields
124 dnl 1683 is a warning about _EXPLICIT_ casting, which we want
125 BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
126 ])
127 CC_WARNINGS="${BASE_WARNINGS}"
128 CXX_WARNINGS="${BASE_WARNINGS}"
129 PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203"
130
131 ],[
132 m4_if(PW_LESS_WARNINGS,[no],[
133 BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing -Wswitch-enum "
134 CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
135 CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
136 NO_OLD_STYLE_CAST="-Wno-old-style-cast"
137 NO_EFF_CXX="-Wno-effc++"
138 ],[
139 BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
140 ])
141
142 AS_IF([test "${ac_cv_assert}" = "no"],
143 [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
144
145 AC_CACHE_CHECK([whether it is safe to use -Wextra],
146 [ac_cv_safe_to_use_Wextra_],
147 [save_CFLAGS="$CFLAGS"
148 CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
149 AC_COMPILE_IFELSE([
150 AC_LANG_PROGRAM(
151 [[
152#include <stdio.h>
153 ]], [[]])
154 ],
155 [ac_cv_safe_to_use_Wextra_=yes],
156 [ac_cv_safe_to_use_Wextra_=no])
157 CFLAGS="$save_CFLAGS"])
158
159 BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}"
160 AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
161 [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
162 [BASE_WARNINGS="${BASE_WARNINGS} -W"])
163
164 AC_CACHE_CHECK([whether it is safe to use -Wformat],
165 [ac_cv_safe_to_use_wformat_],
166 [save_CFLAGS="$CFLAGS"
167 dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
168 dnl conversion warnings to all the tarball folks
169 CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
170 AC_COMPILE_IFELSE(
171 [AC_LANG_PROGRAM([[
172#include <stdio.h>
173#include <stdint.h>
174#include <inttypes.h>
175void foo();
176void foo()
177{
178 uint64_t test_u= 0;
179 printf("This is a %" PRIu64 "test\n", test_u);
180}
181 ]],[[
182foo();
183 ]])],
184 [ac_cv_safe_to_use_wformat_=yes],
185 [ac_cv_safe_to_use_wformat_=no])
186 CFLAGS="$save_CFLAGS"])
187 AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
188 BASE_WARNINGS="${BASE_WARNINGS} -Wformat=2"
189 BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2"
190 ],[
191 BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
192 BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
193 ])
194
195
196
197 AC_CACHE_CHECK([whether it is safe to use -Wconversion],
198 [ac_cv_safe_to_use_wconversion_],
199 [save_CFLAGS="$CFLAGS"
200 dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
201 dnl conversion warnings to all the tarball folks
202 CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
203 AC_COMPILE_IFELSE(
204 [AC_LANG_PROGRAM([[
205#include <stdbool.h>
206void foo(bool a)
207{
208 (void)a;
209}
210 ]],[[
211foo(0);
212 ]])],
213 [ac_cv_safe_to_use_wconversion_=yes],
214 [ac_cv_safe_to_use_wconversion_=no])
215 CFLAGS="$save_CFLAGS"])
216
217 AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
218 [W_CONVERSION="-Wconversion"
219 AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
220 [ac_cv_safe_to_use_Wconversion_],
221 [save_CFLAGS="$CFLAGS"
222 dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
223 dnl conversion warnings to all the tarball folks
224 CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
225 AC_COMPILE_IFELSE(
226 [AC_LANG_PROGRAM(
227 [[
228#include <netinet/in.h>
229 ]],[[
230uint16_t x= htons(80);
231 ]])],
232 [ac_cv_safe_to_use_Wconversion_=yes],
233 [ac_cv_safe_to_use_Wconversion_=no])
234 CFLAGS="$save_CFLAGS"])
235
236 AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
237 [NO_CONVERSION="-Wno-conversion"])
238 ])
239
240 CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
241 CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${CXX_WARNINGS_FULL}"
242
243 AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],
244 [ac_cv_safe_to_use_Wframe_larger_than_],
245 [AC_LANG_PUSH(C++)
246 save_CXXFLAGS="$CXXFLAGS"
247 CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
248 AC_COMPILE_IFELSE([
249 AC_LANG_PROGRAM(
250 [[
251#include <stdio.h>
252 ]], [[]])
253 ],
254 [ac_cv_safe_to_use_Wframe_larger_than_=yes],
255 [ac_cv_safe_to_use_Wframe_larger_than_=no])
256 CXXFLAGS="$save_CXXFLAGS"
257 AC_LANG_POP()
258 ])
259 AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
260 [CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
261
262 AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
263 [ac_cv_safe_to_use_Wlogical_op_],
264 [save_CFLAGS="$CFLAGS"
265 CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
266 AC_COMPILE_IFELSE([
267 AC_LANG_PROGRAM(
268 [[
269#include <stdio.h>
270 ]], [[]])
271 ],
272 [ac_cv_safe_to_use_Wlogical_op_=yes],
273 [ac_cv_safe_to_use_Wlogical_op_=no])
274 CFLAGS="$save_CFLAGS"])
275 AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
276 [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
277
278 AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
279 [ac_cv_safe_to_use_Wredundant_decls_],
280 [AC_LANG_PUSH(C++)
281 save_CXXFLAGS="${CXXFLAGS}"
282 CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
283 AC_COMPILE_IFELSE(
284 [AC_LANG_PROGRAM([
285template <typename E> struct C { void foo(); };
286template <typename E> void C<E>::foo() { }
287template <> void C<int>::foo();
288 AC_INCLUDES_DEFAULT])],
289 [ac_cv_safe_to_use_Wredundant_decls_=yes],
290 [ac_cv_safe_to_use_Wredundant_decls_=no])
291 CXXFLAGS="${save_CXXFLAGS}"
292 AC_LANG_POP()])
293 AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
294 [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
295 [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
296
297 AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
298 [ac_cv_safe_to_use_Wattributes_],
299 [AC_LANG_PUSH(C++)
300 save_CXXFLAGS="${CXXFLAGS}"
301 CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
302 AC_COMPILE_IFELSE(
303 [AC_LANG_PROGRAM([
304#include <google/protobuf/message.h>
305#include <google/protobuf/descriptor.h>
306
307
308const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
309enum Table_TableOptions_RowType {
310 Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
311 Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
312 Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
313 Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
314 Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
315 Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
316 Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
317};
318
319namespace google {
320namespace protobuf {
321template <>
322inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
323 return Table_TableOptions_RowType_descriptor();
324}
325}
326}
327 ])],
328 [ac_cv_safe_to_use_Wattributes_=yes],
329 [ac_cv_safe_to_use_Wattributes_=no])
330 CXXFLAGS="${save_CXXFLAGS}"
331 AC_LANG_POP()])
332 AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
333 [ac_cv_safe_to_use_Wno_attributes_],
334 [save_CFLAGS="$CFLAGS"
335 CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
336 AC_COMPILE_IFELSE([
337 AC_LANG_PROGRAM(
338 [[
339#include <stdio.h>
340 ]], [[]])
341 ],
342 [ac_cv_safe_to_use_Wno_attributes_=yes],
343 [ac_cv_safe_to_use_Wno_attributes_=no])
344 CFLAGS="$save_CFLAGS"])
345
346 dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
347 dnl by using that.
348 AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
349 AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
350 CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
351 NO_ATTRIBUTES="-Wno-attributes"])])
352
353
354 NO_REDUNDANT_DECLS="-Wno-redundant-decls"
355 dnl TODO: Figure out a better way to deal with this:
356 PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
357 NO_WERROR="-Wno-error"
358 PERMISSIVE_WARNINGS="-Wno-error -Wno-unused-function -fpermissive"
359 PERMISSIVE_C_WARNINGS="-Wno-error -Wno-redundant-decls"
360 AS_IF([test "$host_vendor" = "apple"],[
361 BOOSTSKIP_WARNINGS="-Wno-uninitialized"
362 ])
363 ])
364 ])
365
366 AS_IF([test "$SUNCC" = "yes"],[
367
368 AS_IF([test "$ac_profiling" = "yes"],
369 [CC_PROFILING="-xinstrument=datarace"])
370
371 AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
372 [W_FAIL="-errwarn=%all"])
373
374 AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
375 [ac_cv_paste_result],
376 [
377 save_CFLAGS="${CFLAGS}"
378 CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
379 AC_COMPILE_IFELSE(
380 [AC_LANG_PROGRAM([
381 AC_INCLUDES_DEFAULT
382 ],[
383 int x= 0;])],
384 [ac_cv_paste_result=yes],
385 [ac_cv_paste_result=no])
386 CFLAGS="${save_CFLAGS}"
387 ])
388 AS_IF([test $ac_cv_paste_result = yes],
389 [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
390
391
392 m4_if(PW_LESS_WARNINGS, [no],[
393 CC_WARNINGS_FULL="-erroff=E_STATEMENT_NOT_REACHED,E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
394 CXX_WARNINGS_FULL="-erroff=inllargeuse"
395 ],[
396 CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR,E_STATEMENT_NOT_REACHED"
397 CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
398 ])
399
400 CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
401 CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
402 PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
403 BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem"
404 PERMISSIVE_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem,notused,badargtype2w,wunreachable"
405 INNOBASE_SKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit,wunreachable"
406 NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
407 NO_WERROR="-errwarn=%none"
408
409 ])
410
411 AC_SUBST(NO_CONVERSION)
412 AC_SUBST(NO_REDUNDANT_DECLS)
413 AC_SUBST(NO_UNREACHED)
414 AC_SUBST(NO_SHADOW)
415 AC_SUBST(NO_STRICT_ALIASING)
416 AC_SUBST(NO_EFF_CXX)
417 AC_SUBST(NO_OLD_STYLE_CAST)
418 AC_SUBST(PROTOSKIP_WARNINGS)
419 AC_SUBST(INNOBASE_SKIP_WARNINGS)
420 AC_SUBST(BOOSTSKIP_WARNINGS)
421 AC_SUBST(PERMISSIVE_WARNINGS)
422 AC_SUBST(PERMISSIVE_C_WARNINGS)
423 AC_SUBST(NO_WERROR)
424 AC_SUBST([GCOV_LIBS])
425 AC_SUBST([SPHINX_WARNINGS])
426 AC_SUBST([INTLTOOL_WARNINGS])
427
428])
diff --git a/m4/require_libcpprest.m4 b/m4/require_libcpprest.m4
new file mode 100644
index 0000000..3b1e038
--- /dev/null
+++ b/m4/require_libcpprest.m4
@@ -0,0 +1,43 @@
1# Copyright (C) 2019 Red Hat, Inc
2#
3# This program is free software; you can redistribute it and/or modify it
4# under the terms of the GNU General Public License as published by the
5# Free Software Foundation; either version 3 of the License, or (at your
6# option) any later version.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11# Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program. If not, see <http://www.gnu.org/licenses/>.
15#
16# As a special exception, the respective Autoconf Macro's copyright owner
17# gives unlimited permission to copy, distribute and modify the configure
18# scripts that are the output of Autoconf when processing the Macro. You
19# need not follow the terms of the GNU General Public License when using
20# or distributing such scripts, even though portions of the text of the
21# Macro appear in them. The GNU General Public License (GPL) does govern
22# all other use of the material that constitutes the Autoconf Macro.
23#
24# This special exception to the GPL applies to versions of the Autoconf
25# Macro released by the Autoconf Macro's copyright owner. When you make
26# and distribute a modified version of the Autoconf Macro, you may extend
27# this special exception to the GPL to apply to your modified version as well.
28
29# Provides support for finding libcpprest.
30# LIBCPPREST_CFLAGS will be set, in addition to LIBCPPREST and LTLIBCPPREST
31
32AC_DEFUN([REQUIRE_LIBCPPREST],[
33 # --------------------------------------------------------------------
34 # Check for libcpprest
35 # --------------------------------------------------------------------
36 AC_SEARCH_LIBS([CONF_modules_unload], [crypto])
37 AC_LANG_PUSH([C++])
38 AX_CXX_CHECK_LIB(boost_system, [boost::system::system_category()])
39 AX_CXX_CHECK_LIB(cpprest, [utility::datetime::utc_now()])
40 AC_LANG_POP()
41 AS_IF([test "x${ac_cv_lib_cpprest_utility__datetime__utc_now__}" = "xno"],
42 AC_MSG_ERROR([libcpprest is required for ${PACKAGE}.]))
43])
diff --git a/m4/zuul_canonical.m4 b/m4/zuul_canonical.m4
deleted file mode 100644
index ebad771..0000000
--- a/m4/zuul_canonical.m4
+++ /dev/null
@@ -1,96 +0,0 @@
1# Copyright (C) 2009 Sun Microsystems, Inc.
2# This file is free software; Sun Microsystems, Inc.
3# gives unlimited permission to copy and/or distribute it,
4# with or without modifications, as long as this notice is preserved.
5
6# Which version of the canonical setup we're using
7AC_DEFUN([ZUUL_CANONICAL_VERSION],[0.175])
8
9AC_DEFUN([PANDORA_MSG_ERROR],[
10 AS_IF([test "x${pandora_cv_skip_requires}" != "xno"],[
11 AC_MSG_ERROR($1)
12 ],[
13 AC_MSG_WARN($1)
14 ])
15])
16
17AC_DEFUN([ZUUL_CANONICAL_TARGET],[
18 ifdef([m4_define],,[define([m4_define], defn([define]))])
19 ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
20 m4_define([PCT_ALL_ARGS],[$*])
21 m4_define([PCT_REQUIRE_CXX],[no])
22 m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
23 m4_define([PCT_NO_VC_CHANGELOG],[no])
24 m4_define([PCT_VERSION_FROM_VC],[no])
25 m4_define([PCT_USE_VISIBILITY],[yes])
26 m4_foreach([pct_arg],[$*],[
27 m4_case(pct_arg,
28 [require-cxx], [
29 m4_undefine([PCT_REQUIRE_CXX])
30 m4_define([PCT_REQUIRE_CXX],[yes])
31 ],
32 [skip-visibility], [
33 m4_undefine([PCT_USE_VISIBILITY])
34 m4_define([PCT_USE_VISIBILITY],[no])
35 ],
36 [dont-suppress-include], [
37 m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
38 m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
39 ],
40 [no-vc-changelog], [
41 m4_undefine([PCT_NO_VC_CHANGELOG])
42 m4_define([PCT_NO_VC_CHANGELOG],[yes])
43 ],
44 [version-from-vc], [
45 m4_undefine([PCT_VERSION_FROM_VC])
46 m4_define([PCT_VERSION_FROM_VC],[yes])
47 ])
48 ])
49
50 AC_REQUIRE([AC_PROG_CC])
51 AC_REQUIRE([AC_PROG_CXX])
52
53 # We need to prevent canonical target
54 # from injecting -O2 into CFLAGS - but we won't modify anything if we have
55 # set CFLAGS on the command line, since that should take ultimate precedence
56 AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
57 [CFLAGS=""])
58 AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
59 [CXXFLAGS=""])
60
61 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
62
63
64 m4_if(PCT_NO_VC_CHANGELOG,yes,[
65 vc_changelog=no
66 ],[
67 vc_changelog=yes
68 ])
69 m4_if(PCT_VERSION_FROM_VC,yes,[
70 PANDORA_VC_INFO_HEADER
71 ],[
72 PANDORA_TEST_VC_DIR
73
74 AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["$VERSION"],
75 [Version of the software])
76
77 AC_SUBST(PANDORA_RELEASE_VERSION)
78 ])
79
80 AM_PROG_CC_C_O
81 AC_PROG_CC_STDC
82 gl_VISIBILITY
83
84 PANDORA_OPTIMIZE
85
86 PANDORA_WARNINGS(PCT_ALL_ARGS)
87
88 AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
89 AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
90
91 AC_SUBST([AM_CFLAGS])
92 AC_SUBST([AM_CXXFLAGS])
93 AC_SUBST([AM_CPPFLAGS])
94 AC_SUBST([AM_LDFLAGS])
95
96])