zuul-preview/m4/opendev_canonical.m4
Monty Taylor 31d726c6e6 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.
2019-02-10 17:31:33 +00:00

59 lines
1.8 KiB
Plaintext

# 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])
])