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.
This commit is contained in:
parent
b1063b17e0
commit
31d726c6e6
@ -16,14 +16,14 @@
|
||||
FROM debian:testing as builder
|
||||
|
||||
RUN mkdir -p /output/bindep
|
||||
RUN apt-get update && apt-get install -y python3-pip && pip3 install bindep
|
||||
RUN apt-get update && apt-get install -y python3-pip git && pip3 install bindep
|
||||
COPY bindep.txt /bindep.txt
|
||||
RUN cd / && bindep -l newline > /output/bindep/run.txt
|
||||
RUN apt-get install -y $(bindep -b compile)
|
||||
COPY . /src
|
||||
RUN cd /src \
|
||||
&& autoreconf -fi \
|
||||
&& ./configure \
|
||||
&& ./configure --with-comment=$(git describe --always) \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
|
51
configure.ac
51
configure.ac
@ -1,7 +1,8 @@
|
||||
dnl -*- bash -*-
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
dnl Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
dnl Copyright 2009 Sun Microsystems, Inc.
|
||||
dnl Copyright 2019 Red Hat, Inc.
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
@ -41,35 +42,13 @@ AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_CONFIG_SRCDIR([zuul-preview/main.cc])
|
||||
|
||||
ZUUL_CANONICAL_TARGET([require-cxx, version-from-vc])
|
||||
OPENDEV_CANONICAL_TARGET
|
||||
|
||||
LT_PREREQ([2.4])
|
||||
LT_INIT
|
||||
LT_LANG([C++])
|
||||
|
||||
AS_IF([test "x${pandora_cv_skip_requires}" != "xno"],[
|
||||
|
||||
AC_ARG_WITH([comment],
|
||||
[AS_HELP_STRING([--with-comment],
|
||||
[Comment about compilation environment. @<:@default=off@:>@])],
|
||||
[with_comment=$withval],
|
||||
[with_comment=no])
|
||||
AS_IF([test "$with_comment" != "no"],[
|
||||
COMPILATION_COMMENT=$with_comment
|
||||
],[
|
||||
COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
|
||||
])
|
||||
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
|
||||
[Comment about compilation environment])
|
||||
])
|
||||
|
||||
AX_PTHREAD([
|
||||
AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
|
||||
AM_LDFLAGS="${PTHREAD_LIBS} ${AM_LDFLAGS}"
|
||||
LIBS="${PTHREAD_LIBS} ${LIBS}"
|
||||
], [AC_MSG_ERROR([zuul-preview requires pthreads])])
|
||||
|
||||
PANDORA_REQUIRE_LIBCPPREST
|
||||
REQUIRE_LIBCPPREST
|
||||
|
||||
#########################################################################
|
||||
|
||||
@ -77,8 +56,6 @@ AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
|
||||
LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
|
||||
])
|
||||
|
||||
AM_CXXFLAGS="-std=c++14 $AM_CXXFLAGS"
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
AC_OUTPUT
|
||||
@ -86,19 +63,13 @@ AC_OUTPUT
|
||||
echo "---"
|
||||
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
|
||||
echo ""
|
||||
echo " * Installation prefix: $prefix"
|
||||
echo " * System type: $host_vendor-$host_os"
|
||||
echo " * Host CPU: $host_cpu"
|
||||
echo " * C++ Compiler: $CXX_VERSION"
|
||||
echo " * C++ Flags: $CXXFLAGS"
|
||||
echo " * C++ AM Flags: $AM_CXXFLAGS"
|
||||
echo " * CPP Flags: $CPPFLAGS"
|
||||
echo " * CPP AM Flags: $AM_CPPFLAGS"
|
||||
echo " * Assertions enabled: $ac_cv_assert"
|
||||
echo " * Debug enabled: $with_debug"
|
||||
echo " * Profiling enabled: $ac_profiling"
|
||||
echo " * Coverage enabled: $ac_coverage"
|
||||
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
|
||||
echo " * Installation prefix: $prefix"
|
||||
echo " * System type: $host_vendor-$host_os"
|
||||
echo " * Host CPU: $host_cpu"
|
||||
echo " * C++ Flags: $AM_CXXFLAGS"
|
||||
echo " * CPP Flags: $AM_CPPFLAGS"
|
||||
echo " * Debug enabled: $enable_debug"
|
||||
echo " * Coverage enabled: $enable_code_coverage"
|
||||
echo ""
|
||||
echo "---"
|
||||
|
||||
|
@ -1,75 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_VCS_CHECKOUT
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Discover whether or not we are operating with a tree which
|
||||
# has been checked out of a version control system.
|
||||
#
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (C) 2012 Brian Aker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following disclaimer
|
||||
# in the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
#
|
||||
# * The names of its contributors may not be used to endorse or
|
||||
# promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#serial 6
|
||||
|
||||
AC_DEFUN([AX_VCS_SYSTEM],
|
||||
[AC_PREREQ([2.63])dnl
|
||||
AC_CACHE_CHECK([for vcs system], [ac_cv_vcs_system],
|
||||
[ac_cv_vcs_system="none"
|
||||
AS_IF([test -d ".bzr"],[ac_cv_vcs_system="bazaar"])
|
||||
AS_IF([test -d ".svn"],[ac_cv_vcs_system="svn"])
|
||||
AS_IF([test -d ".hg"],[ac_cv_vcs_system="mercurial"])
|
||||
AS_IF([test -d ".git"],[ac_cv_vcs_system="git"])
|
||||
])
|
||||
AC_DEFINE_UNQUOTED([VCS_SYSTEM],["$ac_cv_vcs_system"],[VCS system])
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_VCS_CHECKOUT],
|
||||
[AC_PREREQ([2.63])dnl
|
||||
AC_REQUIRE([AX_VCS_SYSTEM])
|
||||
AC_CACHE_CHECK([for vcs checkout],[ac_cv_vcs_checkout],
|
||||
[AS_IF([test "x$ac_cv_vcs_system" != "xnone"],
|
||||
[ac_cv_vcs_checkout=yes],
|
||||
[ac_cv_vcs_checkout=no])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([IS_VCS_CHECKOUT],[test "x$ac_cv_vcs_checkout" = "xyes"])
|
||||
AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"],
|
||||
[AC_DEFINE([VCS_CHECKOUT],[1],[Define if the code was built from VCS.])],
|
||||
[AC_DEFINE([VCS_CHECKOUT],[0],[Define if the code was built from VCS.])])
|
||||
])
|
58
m4/opendev_canonical.m4
Normal file
58
m4/opendev_canonical.m4
Normal file
@ -0,0 +1,58 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
# Copyright (C) 2019 Red Hat, Inc
|
||||
# This file is free software; The Autoconf Macro copyright holders
|
||||
# give unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([OPENDEV_CANONICAL_TARGET],[
|
||||
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
|
||||
# We need to prevent canonical target
|
||||
# from injecting -O2 into CFLAGS - but we won't modify anything if we have
|
||||
# set CFLAGS on the command line, since that should take ultimate precedence
|
||||
AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
|
||||
[CFLAGS=""])
|
||||
AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
|
||||
[CXXFLAGS=""])
|
||||
|
||||
AX_IS_RELEASE(always)
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AX_CXX_COMPILE_STDCXX([14],[],[mandatory])
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CC_STDC
|
||||
gl_VISIBILITY
|
||||
|
||||
OPENDEV_OPTIMIZE
|
||||
OPENDEV_WARNINGS
|
||||
|
||||
AC_ARG_WITH([comment],
|
||||
[AS_HELP_STRING([--with-comment],
|
||||
[Comment about compilation environment. @<:@default=off@:>@])],
|
||||
[with_comment=$withval],
|
||||
[with_comment=no])
|
||||
AS_IF([test "$with_comment" != "no"],[
|
||||
COMPILATION_COMMENT=$with_comment
|
||||
],[
|
||||
COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
|
||||
])
|
||||
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
|
||||
[Comment about compilation environment])
|
||||
|
||||
AX_PTHREAD([
|
||||
AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
|
||||
AM_LDFLAGS="${PTHREAD_LIBS} ${AM_LDFLAGS}"
|
||||
LIBS="${PTHREAD_LIBS} ${LIBS}"
|
||||
], [AC_MSG_ERROR([${PACKAGE} requires pthreads])])
|
||||
|
||||
AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
|
||||
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
AC_SUBST([AM_CXXFLAGS])
|
||||
AC_SUBST([AM_CPPFLAGS])
|
||||
AC_SUBST([AM_LDFLAGS])
|
||||
|
||||
])
|
49
m4/opendev_optimize.m4
Normal file
49
m4/opendev_optimize.m4
Normal file
@ -0,0 +1,49 @@
|
||||
# Copyright (C) 2019 Red Hat, Inc
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Macro's copyright owner. When you make
|
||||
# and distribute a modified version of the Autoconf Macro, you may extend
|
||||
# this special exception to the GPL to apply to your modified version as well.
|
||||
|
||||
AC_DEFUN([OPENDEV_OPTIMIZE],[
|
||||
AC_REQUIRE([AX_CODE_COVERAGE])
|
||||
|
||||
AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
|
||||
|
||||
AS_IF([test "$enable_code_coverage" = "yes"],[
|
||||
AM_CPPFLAGS="${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS}"
|
||||
AM_CFLAGS="${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS}"
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${CODE_COVERAGE_CXXFLAGS}"
|
||||
AM_LDFLAGS="${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS}"
|
||||
])
|
||||
|
||||
OPTIMIZE_CFLAGS="-O2"
|
||||
OPTIMIZE_CXXFLAGS="-O2"
|
||||
|
||||
AS_IF([test "$enable_debug" = "no"],[
|
||||
# Optimized version. No debug
|
||||
AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
|
||||
])
|
||||
])
|
169
m4/opendev_warnings.m4
Normal file
169
m4/opendev_warnings.m4
Normal file
@ -0,0 +1,169 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
# Copyright (C) 2019 Red Hat, Inc
|
||||
# This file is free software; The Autoconf Macro copyright holders
|
||||
# give unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([OPENDEV_WARNINGS],[
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
|
||||
[ac_cv_safe_to_use_fdiagnostics_show_option_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([],[])],
|
||||
[ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
|
||||
[ac_cv_safe_to_use_fdiagnostics_show_option_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
|
||||
[F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
|
||||
[ac_cv_safe_to_use_floop_parallelize_all_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([],[])],
|
||||
[ac_cv_safe_to_use_floop_parallelize_all_=yes],
|
||||
[ac_cv_safe_to_use_floop_parallelize_all_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
|
||||
[F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"])
|
||||
|
||||
BASE_WARNINGS="-Wextra -pedantic -Wall -Wundef -Wshadow ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} -Wstrict-aliasing -Wswitch-enum "
|
||||
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
|
||||
CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wextra],[ac_cv_safe_to_use_Wextra_],[
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-Wextra -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]]
|
||||
)],
|
||||
[ac_cv_safe_to_use_Wextra_=yes],
|
||||
[ac_cv_safe_to_use_Wextra_=no])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
|
||||
[BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
|
||||
[BASE_WARNINGS="${BASE_WARNINGS} -W"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wformat],[ac_cv_safe_to_use_wformat_],[
|
||||
save_CFLAGS="$CFLAGS"
|
||||
dnl Use -Werror here instead of -Wextra so that we don't spew
|
||||
dnl conversion warnings to all the tarball folks
|
||||
CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
void foo();
|
||||
void foo()
|
||||
{
|
||||
uint64_t test_u= 0;
|
||||
printf("This is a %" PRIu64 "test\n", test_u);
|
||||
}
|
||||
]],[[
|
||||
foo();
|
||||
]]
|
||||
)],
|
||||
[ac_cv_safe_to_use_wformat_=yes],
|
||||
[ac_cv_safe_to_use_wformat_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],
|
||||
[BASE_WARNINGS="${BASE_WARNINGS} -Wformat=2"],
|
||||
[BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wconversion],[ac_cv_safe_to_use_wconversion_],[
|
||||
save_CFLAGS="$CFLAGS"
|
||||
dnl Use -Werror here instead of -Wextra so that we don't spew
|
||||
dnl conversion warnings to all the tarball folks
|
||||
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdbool.h>
|
||||
void foo(bool a)
|
||||
{
|
||||
(void)a;
|
||||
}
|
||||
]],[[
|
||||
foo(0);
|
||||
]]
|
||||
)],
|
||||
[ac_cv_safe_to_use_wconversion_=yes],
|
||||
[ac_cv_safe_to_use_wconversion_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
|
||||
[W_CONVERSION="-Wconversion"])
|
||||
|
||||
CC_WARNINGS="${BASE_WARNINGS} -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL} ${W_CONVERSION}"
|
||||
CXX_WARNINGS="${BASE_WARNINGS} -Wattributes -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${CXX_WARNINGS_FULL} ${W_CONVERSION}"
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],[ac_cv_safe_to_use_Wframe_larger_than_],[
|
||||
AC_LANG_PUSH(C++)
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]]
|
||||
)],
|
||||
[ac_cv_safe_to_use_Wframe_larger_than_=yes],
|
||||
[ac_cv_safe_to_use_Wframe_larger_than_=no])
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
AC_LANG_POP()
|
||||
])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
|
||||
[CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],[ac_cv_safe_to_use_Wlogical_op_],[
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-Wextra -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]]
|
||||
)],
|
||||
[ac_cv_safe_to_use_Wlogical_op_=yes],
|
||||
[ac_cv_safe_to_use_Wlogical_op_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
|
||||
[CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],[ac_cv_safe_to_use_Wredundant_decls_],[
|
||||
AC_LANG_PUSH(C++)
|
||||
save_CXXFLAGS="${CXXFLAGS}"
|
||||
CXXFLAGS="-Wextra -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[
|
||||
template <typename E> struct C { void foo(); };
|
||||
template <typename E> void C<E>::foo() { }
|
||||
template <> void C<int>::foo();
|
||||
AC_INCLUDES_DEFAULT
|
||||
])],
|
||||
[ac_cv_safe_to_use_Wredundant_decls_=yes],
|
||||
[ac_cv_safe_to_use_Wredundant_decls_=no])
|
||||
CXXFLAGS="${save_CXXFLAGS}"
|
||||
AC_LANG_POP()])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
|
||||
[CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
|
||||
[CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
|
||||
|
||||
])
|
@ -1,60 +0,0 @@
|
||||
dnl Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
dnl This file is free software; Sun Microsystems, Inc.
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: PANDORA_64BIT
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_DEFUN([PANDORA_64BIT],[
|
||||
AC_BEFORE([$0], [AC_LIB_PREFIX])
|
||||
|
||||
AC_ARG_ENABLE([64bit],
|
||||
[AS_HELP_STRING([--disable-64bit],
|
||||
[Build 64 bit binary @<:@default=on@:>@])],
|
||||
[ac_enable_64bit="$enableval"],
|
||||
[ac_enable_64bit="yes"])
|
||||
|
||||
AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
|
||||
AS_IF([test "x$ISAINFO" != "xno"],
|
||||
[isainfo_b=`${ISAINFO} -b`],
|
||||
[isainfo_b="x"])
|
||||
|
||||
AS_IF([test "$isainfo_b" != "x" -a "$isainfo_b" != "32"],[
|
||||
|
||||
isainfo_k=`${ISAINFO} -k`
|
||||
DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
|
||||
|
||||
AS_IF([test "x$ac_enable_64bit" = "xyes"],[
|
||||
|
||||
AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
|
||||
LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
|
||||
])
|
||||
|
||||
AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
|
||||
dnl The user hasn't overridden the default libdir, so we'll
|
||||
dnl the dir suffix to match solaris 32/64-bit policy
|
||||
libdir="${libdir}/${isainfo_k}"
|
||||
])
|
||||
|
||||
AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
|
||||
CFLAGS="${CFLAGS} -m64"
|
||||
ac_cv_env_CFLAGS_set=set
|
||||
ac_cv_env_CFLAGS_value='-m64'
|
||||
])
|
||||
AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
|
||||
CXXFLAGS="${CXXFLAGS} -m64"
|
||||
ac_cv_env_CXXFLAGS_set=set
|
||||
ac_cv_env_CXXFLAGS_value='-m64'
|
||||
])
|
||||
|
||||
AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
|
||||
AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
|
||||
AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl End Macro: PANDORA_64BIT
|
||||
dnl ---------------------------------------------------------------------------
|
@ -1,29 +0,0 @@
|
||||
dnl Copyright (C) 2019 Red Hat, Inc
|
||||
dnl This file is free software; Red Hat, Inc
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Provides support for finding libcpprest.
|
||||
dnl LIBCPPREST_CFLAGS will be set, in addition to LIBCPPREST and LTLIBCPPREST
|
||||
|
||||
AC_DEFUN([_PANDORA_SEARCH_LIBCPPREST],[
|
||||
dnl --------------------------------------------------------------------
|
||||
dnl Check for libcpprest
|
||||
dnl --------------------------------------------------------------------
|
||||
|
||||
AC_SEARCH_LIBS([CONF_modules_unload], [crypto])
|
||||
AC_LANG_PUSH([C++])
|
||||
AX_CXX_CHECK_LIB(boost_system, [boost::system::system_category()])
|
||||
AX_CXX_CHECK_LIB(cpprest, [utility::datetime::utc_now()])
|
||||
AC_LANG_POP()
|
||||
])
|
||||
|
||||
AC_DEFUN([PANDORA_HAVE_LIBCPPREST],[
|
||||
AC_REQUIRE([_PANDORA_SEARCH_LIBCPPREST])
|
||||
])
|
||||
|
||||
AC_DEFUN([PANDORA_REQUIRE_LIBCPPREST],[
|
||||
AC_REQUIRE([_PANDORA_SEARCH_LIBCPPREST])
|
||||
AS_IF([test "x${ac_cv_lib_cpprest_utility__datetime__utc_now__}" = "xno"],
|
||||
PANDORA_MSG_ERROR([libcpprest is required for ${PACKAGE}.]))
|
||||
])
|
@ -1,34 +0,0 @@
|
||||
dnl Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
dnl This file is free software; Sun Microsystems, Inc.
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([PANDORA_OPTIMIZE],[
|
||||
dnl Build optimized or debug version ?
|
||||
dnl First check for gcc and g++
|
||||
AS_IF([test "$GCC" = "yes"],[
|
||||
|
||||
AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
|
||||
|
||||
DEBUG_CFLAGS="-O0"
|
||||
DEBUG_CXXFLAGS="-O0"
|
||||
|
||||
OPTIMIZE_CFLAGS="-O2"
|
||||
OPTIMIZE_CXXFLAGS="-O2"
|
||||
])
|
||||
|
||||
AC_ARG_WITH([debug],
|
||||
[AS_HELP_STRING([--with-debug],
|
||||
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
|
||||
[with_debug=$withval],
|
||||
[with_debug=no])
|
||||
AS_IF([test "$with_debug" = "yes"],[
|
||||
# Debugging. No optimization.
|
||||
AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG"
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG"
|
||||
],[
|
||||
# Optimized version. No debug
|
||||
AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
|
||||
])
|
||||
])
|
@ -1,78 +0,0 @@
|
||||
dnl Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
dnl This file is free software; Sun Microsystems, Inc.
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([PANDORA_TEST_VC_DIR],[
|
||||
pandora_building_from_vc=no
|
||||
|
||||
if test -d ".git" ; then
|
||||
pandora_building_from_git=yes
|
||||
pandora_building_from_vc=yes
|
||||
else
|
||||
pandora_building_from_git=no
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
|
||||
m4_syscmd(PANDORA_TEST_VC_DIR
|
||||
m4_if(PCT_NO_VC_CHANGELOG,yes,[
|
||||
vc_changelog=no
|
||||
],[
|
||||
vc_changelog=yes
|
||||
])
|
||||
|
||||
[
|
||||
|
||||
if test "${pandora_building_from_git}" = "yes"; then
|
||||
echo "# Grabbing changelog and version information from git"
|
||||
# Fix this for git
|
||||
PANDORA_RELEASE_VERSION=0.0.1
|
||||
fi
|
||||
|
||||
if ! test -d config ; then
|
||||
mkdir -p config
|
||||
fi
|
||||
|
||||
if test "${pandora_building_from_git}" = "yes" -o ! -f config/pandora_vc_revinfo ; then
|
||||
cat > config/pandora_vc_revinfo.tmp <<EOF
|
||||
PANDORA_RELEASE_VERSION=${PANDORA_RELEASE_VERSION}
|
||||
EOF
|
||||
if ! diff config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo >/dev/null 2>&1 ; then
|
||||
mv config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo
|
||||
fi
|
||||
rm -f config/pandora_vc_revinfo.tmp
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([_PANDORA_READ_FROM_FILE],[
|
||||
$1=`grep $1 $2 | cut -f2 -d=`
|
||||
])
|
||||
|
||||
AC_DEFUN([PANDORA_VC_VERSION],[
|
||||
AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
|
||||
|
||||
PANDORA_TEST_VC_DIR
|
||||
|
||||
AS_IF([test -f ${srcdir}/config/pandora_vc_revinfo],[
|
||||
_PANDORA_READ_FROM_FILE(
|
||||
[PANDORA_RELEASE_VERSION],${srcdir}/config/pandora_vc_revinfo)
|
||||
])
|
||||
|
||||
VERSION="${PANDORA_RELEASE_VERSION}"
|
||||
AC_DEFINE_UNQUOTED(
|
||||
[PANDORA_RELEASE_VERSION],
|
||||
["${PANDORA_RELEASE_VERSION}"],
|
||||
[The real version of the software])
|
||||
])
|
||||
|
||||
AC_DEFUN([PANDORA_VC_INFO_HEADER],[
|
||||
AC_REQUIRE([PANDORA_VC_VERSION])
|
||||
m4_define([PANDORA_VC_PREFIX],m4_toupper(m4_normalize(AC_PACKAGE_NAME))[_])
|
||||
|
||||
AC_DEFINE_UNQUOTED(
|
||||
PANDORA_VC_PREFIX[RELEASE_VERSION],
|
||||
["$PANDORA_RELEASE_VERSION"],
|
||||
[Release date and revision number of checkout])
|
||||
])
|
@ -1,428 +0,0 @@
|
||||
dnl Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
dnl This file is free software; Sun Microsystems, Inc.
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on])
|
||||
dnl less-warnings turn on a limited set of warnings
|
||||
dnl warnings-always-on always set warnings=error regardless of tarball/vc
|
||||
|
||||
dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to
|
||||
dnl allow it
|
||||
|
||||
AC_DEFUN([PANDORA_WARNINGS],[
|
||||
m4_define([PW_LESS_WARNINGS],[no])
|
||||
m4_define([PW_WARN_ALWAYS_ON],[no])
|
||||
ifdef([m4_define],,[define([m4_define], defn([define]))])
|
||||
ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
|
||||
m4_foreach([pw_arg],[$*],[
|
||||
m4_case(pw_arg,
|
||||
[less-warnings],[
|
||||
m4_undefine([PW_LESS_WARNINGS])
|
||||
m4_define([PW_LESS_WARNINGS],[yes])
|
||||
],
|
||||
[warnings-always-on],[
|
||||
m4_undefine([PW_WARN_ALWAYS_ON])
|
||||
m4_define([PW_WARN_ALWAYS_ON],[yes])
|
||||
])
|
||||
])
|
||||
|
||||
AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
|
||||
m4_if(PW_WARN_ALWAYS_ON, [yes],
|
||||
[ac_cv_warnings_as_errors=yes],
|
||||
AS_IF([test "$pandora_building_from_vc" = "yes"],
|
||||
[ac_cv_warnings_as_errors=yes],
|
||||
[ac_cv_warnings_as_errors=no]))
|
||||
|
||||
AC_ARG_ENABLE([gcc-profile-mode],
|
||||
[AS_HELP_STRING([--enable-gcc-profile-mode],
|
||||
[Toggle gcc profile mode @<:@default=off@:>@])],
|
||||
[ac_gcc_profile_mode="$enableval"],
|
||||
[ac_gcc_profile_mode="no"])
|
||||
|
||||
AC_ARG_ENABLE([profiling],
|
||||
[AS_HELP_STRING([--enable-profiling],
|
||||
[Toggle profiling @<:@default=off@:>@])],
|
||||
[ac_profiling="$enableval"],
|
||||
[ac_profiling="no"])
|
||||
|
||||
AC_ARG_ENABLE([coverage],
|
||||
[AS_HELP_STRING([--enable-coverage],
|
||||
[Toggle coverage @<:@default=off@:>@])],
|
||||
[ac_coverage="$enableval"],
|
||||
[ac_coverage="no"])
|
||||
|
||||
AS_IF([test "$GCC" = "yes"],[
|
||||
|
||||
AS_IF([test "$ac_profiling" = "yes"],[
|
||||
CC_PROFILING="-pg"
|
||||
GCOV_LIBS="-pg -lgcov"
|
||||
save_LIBS="${LIBS}"
|
||||
LIBS=""
|
||||
AC_CHECK_LIB(c_p, read)
|
||||
LIBC_P="${LIBS}"
|
||||
LIBS="${save_LIBS}"
|
||||
AC_SUBST(LIBC_P)
|
||||
],[
|
||||
CC_PROFILING=" "
|
||||
])
|
||||
|
||||
AS_IF([test "$ac_coverage" = "yes"],
|
||||
[
|
||||
CC_COVERAGE="--coverage"
|
||||
GCOV_LIBS="-lgcov"
|
||||
])
|
||||
|
||||
|
||||
|
||||
AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],[
|
||||
W_FAIL="-Werror"
|
||||
SPHINX_WARNINGS="-W"
|
||||
dnl INTLTOOL_WARNINGS="yes"
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
|
||||
[ac_cv_safe_to_use_fdiagnostics_show_option_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([],[])],
|
||||
[ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
|
||||
[ac_cv_safe_to_use_fdiagnostics_show_option_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
|
||||
[
|
||||
F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
|
||||
[ac_cv_safe_to_use_floop_parallelize_all_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([],[])],
|
||||
[ac_cv_safe_to_use_floop_parallelize_all_=yes],
|
||||
[ac_cv_safe_to_use_floop_parallelize_all_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
|
||||
[
|
||||
F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
|
||||
])
|
||||
|
||||
NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
|
||||
NO_SHADOW="-Wno-shadow"
|
||||
|
||||
AS_IF([test "$INTELCC" = "yes"],[
|
||||
m4_if(PW_LESS_WARNINGS,[no],[
|
||||
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
|
||||
],[
|
||||
dnl 2203 is like old-style-cast
|
||||
dnl 1684 is like strict-aliasing
|
||||
dnl 188 is about using enums as bitfields
|
||||
dnl 1683 is a warning about _EXPLICIT_ casting, which we want
|
||||
BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
|
||||
])
|
||||
CC_WARNINGS="${BASE_WARNINGS}"
|
||||
CXX_WARNINGS="${BASE_WARNINGS}"
|
||||
PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203"
|
||||
|
||||
],[
|
||||
m4_if(PW_LESS_WARNINGS,[no],[
|
||||
BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing -Wswitch-enum "
|
||||
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
|
||||
CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
|
||||
NO_OLD_STYLE_CAST="-Wno-old-style-cast"
|
||||
NO_EFF_CXX="-Wno-effc++"
|
||||
],[
|
||||
BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
|
||||
])
|
||||
|
||||
AS_IF([test "${ac_cv_assert}" = "no"],
|
||||
[NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wextra],
|
||||
[ac_cv_safe_to_use_Wextra_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]])
|
||||
],
|
||||
[ac_cv_safe_to_use_Wextra_=yes],
|
||||
[ac_cv_safe_to_use_Wextra_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}"
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
|
||||
[BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
|
||||
[BASE_WARNINGS="${BASE_WARNINGS} -W"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wformat],
|
||||
[ac_cv_safe_to_use_wformat_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
|
||||
dnl conversion warnings to all the tarball folks
|
||||
CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
void foo();
|
||||
void foo()
|
||||
{
|
||||
uint64_t test_u= 0;
|
||||
printf("This is a %" PRIu64 "test\n", test_u);
|
||||
}
|
||||
]],[[
|
||||
foo();
|
||||
]])],
|
||||
[ac_cv_safe_to_use_wformat_=yes],
|
||||
[ac_cv_safe_to_use_wformat_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
|
||||
BASE_WARNINGS="${BASE_WARNINGS} -Wformat=2"
|
||||
BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2"
|
||||
],[
|
||||
BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
|
||||
BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
|
||||
])
|
||||
|
||||
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wconversion],
|
||||
[ac_cv_safe_to_use_wconversion_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
|
||||
dnl conversion warnings to all the tarball folks
|
||||
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <stdbool.h>
|
||||
void foo(bool a)
|
||||
{
|
||||
(void)a;
|
||||
}
|
||||
]],[[
|
||||
foo(0);
|
||||
]])],
|
||||
[ac_cv_safe_to_use_wconversion_=yes],
|
||||
[ac_cv_safe_to_use_wconversion_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
|
||||
[W_CONVERSION="-Wconversion"
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
|
||||
[ac_cv_safe_to_use_Wconversion_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
|
||||
dnl conversion warnings to all the tarball folks
|
||||
CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <netinet/in.h>
|
||||
]],[[
|
||||
uint16_t x= htons(80);
|
||||
]])],
|
||||
[ac_cv_safe_to_use_Wconversion_=yes],
|
||||
[ac_cv_safe_to_use_Wconversion_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
|
||||
[NO_CONVERSION="-Wno-conversion"])
|
||||
])
|
||||
|
||||
CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
|
||||
CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${CXX_WARNINGS_FULL}"
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],
|
||||
[ac_cv_safe_to_use_Wframe_larger_than_],
|
||||
[AC_LANG_PUSH(C++)
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]])
|
||||
],
|
||||
[ac_cv_safe_to_use_Wframe_larger_than_=yes],
|
||||
[ac_cv_safe_to_use_Wframe_larger_than_=no])
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
AC_LANG_POP()
|
||||
])
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
|
||||
[CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
|
||||
[ac_cv_safe_to_use_Wlogical_op_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]])
|
||||
],
|
||||
[ac_cv_safe_to_use_Wlogical_op_=yes],
|
||||
[ac_cv_safe_to_use_Wlogical_op_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
|
||||
[CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
|
||||
[ac_cv_safe_to_use_Wredundant_decls_],
|
||||
[AC_LANG_PUSH(C++)
|
||||
save_CXXFLAGS="${CXXFLAGS}"
|
||||
CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
template <typename E> struct C { void foo(); };
|
||||
template <typename E> void C<E>::foo() { }
|
||||
template <> void C<int>::foo();
|
||||
AC_INCLUDES_DEFAULT])],
|
||||
[ac_cv_safe_to_use_Wredundant_decls_=yes],
|
||||
[ac_cv_safe_to_use_Wredundant_decls_=no])
|
||||
CXXFLAGS="${save_CXXFLAGS}"
|
||||
AC_LANG_POP()])
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
|
||||
[CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
|
||||
[CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
|
||||
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
|
||||
[ac_cv_safe_to_use_Wattributes_],
|
||||
[AC_LANG_PUSH(C++)
|
||||
save_CXXFLAGS="${CXXFLAGS}"
|
||||
CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
|
||||
|
||||
const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
|
||||
enum Table_TableOptions_RowType {
|
||||
Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
|
||||
Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
|
||||
Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
|
||||
Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
|
||||
Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
|
||||
Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
|
||||
Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
|
||||
};
|
||||
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
template <>
|
||||
inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
|
||||
return Table_TableOptions_RowType_descriptor();
|
||||
}
|
||||
}
|
||||
}
|
||||
])],
|
||||
[ac_cv_safe_to_use_Wattributes_=yes],
|
||||
[ac_cv_safe_to_use_Wattributes_=no])
|
||||
CXXFLAGS="${save_CXXFLAGS}"
|
||||
AC_LANG_POP()])
|
||||
AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
|
||||
[ac_cv_safe_to_use_Wno_attributes_],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdio.h>
|
||||
]], [[]])
|
||||
],
|
||||
[ac_cv_safe_to_use_Wno_attributes_=yes],
|
||||
[ac_cv_safe_to_use_Wno_attributes_=no])
|
||||
CFLAGS="$save_CFLAGS"])
|
||||
|
||||
dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
|
||||
dnl by using that.
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
|
||||
AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
|
||||
CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
|
||||
NO_ATTRIBUTES="-Wno-attributes"])])
|
||||
|
||||
|
||||
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
|
||||
dnl TODO: Figure out a better way to deal with this:
|
||||
PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
|
||||
NO_WERROR="-Wno-error"
|
||||
PERMISSIVE_WARNINGS="-Wno-error -Wno-unused-function -fpermissive"
|
||||
PERMISSIVE_C_WARNINGS="-Wno-error -Wno-redundant-decls"
|
||||
AS_IF([test "$host_vendor" = "apple"],[
|
||||
BOOSTSKIP_WARNINGS="-Wno-uninitialized"
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
AS_IF([test "$SUNCC" = "yes"],[
|
||||
|
||||
AS_IF([test "$ac_profiling" = "yes"],
|
||||
[CC_PROFILING="-xinstrument=datarace"])
|
||||
|
||||
AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
|
||||
[W_FAIL="-errwarn=%all"])
|
||||
|
||||
AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
|
||||
[ac_cv_paste_result],
|
||||
[
|
||||
save_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
AC_INCLUDES_DEFAULT
|
||||
],[
|
||||
int x= 0;])],
|
||||
[ac_cv_paste_result=yes],
|
||||
[ac_cv_paste_result=no])
|
||||
CFLAGS="${save_CFLAGS}"
|
||||
])
|
||||
AS_IF([test $ac_cv_paste_result = yes],
|
||||
[W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
|
||||
|
||||
|
||||
m4_if(PW_LESS_WARNINGS, [no],[
|
||||
CC_WARNINGS_FULL="-erroff=E_STATEMENT_NOT_REACHED,E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
|
||||
CXX_WARNINGS_FULL="-erroff=inllargeuse"
|
||||
],[
|
||||
CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR,E_STATEMENT_NOT_REACHED"
|
||||
CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
|
||||
])
|
||||
|
||||
CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
|
||||
CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
|
||||
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
|
||||
BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem"
|
||||
PERMISSIVE_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem,notused,badargtype2w,wunreachable"
|
||||
INNOBASE_SKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit,wunreachable"
|
||||
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
|
||||
NO_WERROR="-errwarn=%none"
|
||||
|
||||
])
|
||||
|
||||
AC_SUBST(NO_CONVERSION)
|
||||
AC_SUBST(NO_REDUNDANT_DECLS)
|
||||
AC_SUBST(NO_UNREACHED)
|
||||
AC_SUBST(NO_SHADOW)
|
||||
AC_SUBST(NO_STRICT_ALIASING)
|
||||
AC_SUBST(NO_EFF_CXX)
|
||||
AC_SUBST(NO_OLD_STYLE_CAST)
|
||||
AC_SUBST(PROTOSKIP_WARNINGS)
|
||||
AC_SUBST(INNOBASE_SKIP_WARNINGS)
|
||||
AC_SUBST(BOOSTSKIP_WARNINGS)
|
||||
AC_SUBST(PERMISSIVE_WARNINGS)
|
||||
AC_SUBST(PERMISSIVE_C_WARNINGS)
|
||||
AC_SUBST(NO_WERROR)
|
||||
AC_SUBST([GCOV_LIBS])
|
||||
AC_SUBST([SPHINX_WARNINGS])
|
||||
AC_SUBST([INTLTOOL_WARNINGS])
|
||||
|
||||
])
|
43
m4/require_libcpprest.m4
Normal file
43
m4/require_libcpprest.m4
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright (C) 2019 Red Hat, Inc
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Macro's copyright owner. When you make
|
||||
# and distribute a modified version of the Autoconf Macro, you may extend
|
||||
# this special exception to the GPL to apply to your modified version as well.
|
||||
|
||||
# Provides support for finding libcpprest.
|
||||
# LIBCPPREST_CFLAGS will be set, in addition to LIBCPPREST and LTLIBCPPREST
|
||||
|
||||
AC_DEFUN([REQUIRE_LIBCPPREST],[
|
||||
# --------------------------------------------------------------------
|
||||
# Check for libcpprest
|
||||
# --------------------------------------------------------------------
|
||||
AC_SEARCH_LIBS([CONF_modules_unload], [crypto])
|
||||
AC_LANG_PUSH([C++])
|
||||
AX_CXX_CHECK_LIB(boost_system, [boost::system::system_category()])
|
||||
AX_CXX_CHECK_LIB(cpprest, [utility::datetime::utc_now()])
|
||||
AC_LANG_POP()
|
||||
AS_IF([test "x${ac_cv_lib_cpprest_utility__datetime__utc_now__}" = "xno"],
|
||||
AC_MSG_ERROR([libcpprest is required for ${PACKAGE}.]))
|
||||
])
|
@ -1,96 +0,0 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
# This file is free software; Sun Microsystems, Inc.
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Which version of the canonical setup we're using
|
||||
AC_DEFUN([ZUUL_CANONICAL_VERSION],[0.175])
|
||||
|
||||
AC_DEFUN([PANDORA_MSG_ERROR],[
|
||||
AS_IF([test "x${pandora_cv_skip_requires}" != "xno"],[
|
||||
AC_MSG_ERROR($1)
|
||||
],[
|
||||
AC_MSG_WARN($1)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZUUL_CANONICAL_TARGET],[
|
||||
ifdef([m4_define],,[define([m4_define], defn([define]))])
|
||||
ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
|
||||
m4_define([PCT_ALL_ARGS],[$*])
|
||||
m4_define([PCT_REQUIRE_CXX],[no])
|
||||
m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
|
||||
m4_define([PCT_NO_VC_CHANGELOG],[no])
|
||||
m4_define([PCT_VERSION_FROM_VC],[no])
|
||||
m4_define([PCT_USE_VISIBILITY],[yes])
|
||||
m4_foreach([pct_arg],[$*],[
|
||||
m4_case(pct_arg,
|
||||
[require-cxx], [
|
||||
m4_undefine([PCT_REQUIRE_CXX])
|
||||
m4_define([PCT_REQUIRE_CXX],[yes])
|
||||
],
|
||||
[skip-visibility], [
|
||||
m4_undefine([PCT_USE_VISIBILITY])
|
||||
m4_define([PCT_USE_VISIBILITY],[no])
|
||||
],
|
||||
[dont-suppress-include], [
|
||||
m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
|
||||
m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
|
||||
],
|
||||
[no-vc-changelog], [
|
||||
m4_undefine([PCT_NO_VC_CHANGELOG])
|
||||
m4_define([PCT_NO_VC_CHANGELOG],[yes])
|
||||
],
|
||||
[version-from-vc], [
|
||||
m4_undefine([PCT_VERSION_FROM_VC])
|
||||
m4_define([PCT_VERSION_FROM_VC],[yes])
|
||||
])
|
||||
])
|
||||
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
|
||||
# We need to prevent canonical target
|
||||
# from injecting -O2 into CFLAGS - but we won't modify anything if we have
|
||||
# set CFLAGS on the command line, since that should take ultimate precedence
|
||||
AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
|
||||
[CFLAGS=""])
|
||||
AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
|
||||
[CXXFLAGS=""])
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
|
||||
m4_if(PCT_NO_VC_CHANGELOG,yes,[
|
||||
vc_changelog=no
|
||||
],[
|
||||
vc_changelog=yes
|
||||
])
|
||||
m4_if(PCT_VERSION_FROM_VC,yes,[
|
||||
PANDORA_VC_INFO_HEADER
|
||||
],[
|
||||
PANDORA_TEST_VC_DIR
|
||||
|
||||
AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["$VERSION"],
|
||||
[Version of the software])
|
||||
|
||||
AC_SUBST(PANDORA_RELEASE_VERSION)
|
||||
])
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CC_STDC
|
||||
gl_VISIBILITY
|
||||
|
||||
PANDORA_OPTIMIZE
|
||||
|
||||
PANDORA_WARNINGS(PCT_ALL_ARGS)
|
||||
|
||||
AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
|
||||
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
AC_SUBST([AM_CXXFLAGS])
|
||||
AC_SUBST([AM_CPPFLAGS])
|
||||
AC_SUBST([AM_LDFLAGS])
|
||||
|
||||
])
|
Loading…
x
Reference in New Issue
Block a user