mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
build: update various m4 macros
This commit is contained in:
@ -25,7 +25,7 @@
|
|||||||
# and this notice are preserved. This file is offered as-is, without any
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
# warranty.
|
# warranty.
|
||||||
|
|
||||||
#serial 11
|
#serial 12
|
||||||
|
|
||||||
AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
|
AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
|
||||||
AC_REQUIRE([AC_PROG_SED])
|
AC_REQUIRE([AC_PROG_SED])
|
||||||
@ -34,7 +34,7 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
|
|||||||
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
|
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
|
||||||
|
|
||||||
# Variable names
|
# Variable names
|
||||||
m4_define(ax_warn_cflags_variable,
|
m4_define([ax_warn_cflags_variable],
|
||||||
[m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))])
|
[m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))])
|
||||||
|
|
||||||
AC_LANG_PUSH([C])
|
AC_LANG_PUSH([C])
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
# and this notice are preserved. This file is offered as-is, without any
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
# warranty.
|
# warranty.
|
||||||
|
|
||||||
#serial 7
|
#serial 8
|
||||||
|
|
||||||
AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[
|
AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[
|
||||||
AC_REQUIRE([AC_PROG_SED])
|
AC_REQUIRE([AC_PROG_SED])
|
||||||
@ -35,7 +35,7 @@ AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[
|
|||||||
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
|
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
|
||||||
|
|
||||||
# Variable names
|
# Variable names
|
||||||
m4_define(ax_warn_cxxflags_variable,
|
m4_define([ax_warn_cxxflags_variable],
|
||||||
[m4_normalize(ifelse([$1],,[WARN_CXXFLAGS],[$1]))])
|
[m4_normalize(ifelse([$1],,[WARN_CXXFLAGS],[$1]))])
|
||||||
|
|
||||||
AC_LANG_PUSH([C++])
|
AC_LANG_PUSH([C++])
|
||||||
|
|||||||
@ -26,13 +26,13 @@
|
|||||||
# and this notice are preserved. This file is offered as-is, without any
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
# warranty.
|
# warranty.
|
||||||
|
|
||||||
#serial 4
|
#serial 5
|
||||||
|
|
||||||
AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
|
AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
|
||||||
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
|
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
|
||||||
|
|
||||||
# Variable names
|
# Variable names
|
||||||
m4_define(ax_warn_scannerflags_variable,
|
m4_define([ax_warn_scannerflags_variable],
|
||||||
[m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
|
[m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
|
||||||
|
|
||||||
# Base flags
|
# Base flags
|
||||||
|
|||||||
@ -25,15 +25,16 @@
|
|||||||
# and this notice are preserved. This file is offered as-is, without any
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
# warranty.
|
# warranty.
|
||||||
|
|
||||||
#serial 5
|
#serial 7
|
||||||
|
|
||||||
AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
|
AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
|
||||||
AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
|
AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
|
||||||
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
|
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
|
||||||
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
|
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
|
||||||
|
AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
|
||||||
|
|
||||||
# Variable names
|
# Variable names
|
||||||
m4_define(ax_warn_ldflags_variable,
|
m4_define([ax_warn_ldflags_variable],
|
||||||
[m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))])
|
[m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))])
|
||||||
|
|
||||||
# Always pass -Werror=unknown-warning-option to get Clang to fail on bad
|
# Always pass -Werror=unknown-warning-option to get Clang to fail on bad
|
||||||
@ -47,9 +48,25 @@ AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
|
|||||||
ax_compiler_flags_test=""
|
ax_compiler_flags_test=""
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# macOS linker does not have --as-needed
|
||||||
|
AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [
|
||||||
|
ax_compiler_flags_as_needed_option="-Wl,--no-as-needed"
|
||||||
|
], [
|
||||||
|
ax_compiler_flags_as_needed_option=""
|
||||||
|
])
|
||||||
|
|
||||||
|
# macOS linker speaks with a different accent
|
||||||
|
ax_compiler_flags_fatal_warnings_option=""
|
||||||
|
AX_CHECK_LINK_FLAG([-Wl,--fatal-warnings], [
|
||||||
|
ax_compiler_flags_fatal_warnings_option="-Wl,--fatal-warnings"
|
||||||
|
])
|
||||||
|
AX_CHECK_LINK_FLAG([-Wl,-fatal_warnings], [
|
||||||
|
ax_compiler_flags_fatal_warnings_option="-Wl,-fatal_warnings"
|
||||||
|
])
|
||||||
|
|
||||||
# Base flags
|
# Base flags
|
||||||
AX_APPEND_LINK_FLAGS([ dnl
|
AX_APPEND_LINK_FLAGS([ dnl
|
||||||
-Wl,--no-as-needed dnl
|
$ax_compiler_flags_as_needed_option dnl
|
||||||
$3 dnl
|
$3 dnl
|
||||||
],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
|
],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
|
||||||
|
|
||||||
@ -66,7 +83,7 @@ AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
|
|||||||
# suggest-attribute=format is disabled because it gives too many false
|
# suggest-attribute=format is disabled because it gives too many false
|
||||||
# positives
|
# positives
|
||||||
AX_APPEND_LINK_FLAGS([ dnl
|
AX_APPEND_LINK_FLAGS([ dnl
|
||||||
-Wl,--fatal-warnings dnl
|
$ax_compiler_flags_fatal_warnings_option dnl
|
||||||
],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
|
],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
# and this notice are preserved. This file is offered as-is, without any
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
# warranty.
|
# warranty.
|
||||||
|
|
||||||
#serial 1
|
#serial 2
|
||||||
|
|
||||||
AC_DEFUN([AX_GENERATE_CHANGELOG],[
|
AC_DEFUN([AX_GENERATE_CHANGELOG],[
|
||||||
# Find git, defaulting to the 'missing' script so the user gets a nice
|
# Find git, defaulting to the 'missing' script so the user gets a nice
|
||||||
@ -73,7 +73,7 @@ GENERATE_CHANGELOG_RULES='
|
|||||||
# - CHANGELOG_GIT_DIR: .git directory to use. (Default: $(top_srcdir)/.git)
|
# - CHANGELOG_GIT_DIR: .git directory to use. (Default: $(top_srcdir)/.git)
|
||||||
|
|
||||||
# git-specific
|
# git-specific
|
||||||
CHANGELOG_GIT_FLAGS ?= --stat -M -C --name-status --no-color
|
CHANGELOG_GIT_FLAGS ?= --stat -M -C --name-status --no-color --no-decorate
|
||||||
CHANGELOG_GIT_DIR ?= $(top_srcdir)/.git
|
CHANGELOG_GIT_DIR ?= $(top_srcdir)/.git
|
||||||
|
|
||||||
ifeq ($(CHANGELOG_START),)
|
ifeq ($(CHANGELOG_START),)
|
||||||
|
|||||||
@ -26,6 +26,10 @@
|
|||||||
# * micro-version: ax_is_release will be 'no' if the micro version number
|
# * micro-version: ax_is_release will be 'no' if the micro version number
|
||||||
# in $PACKAGE_VERSION is odd; this assumes
|
# in $PACKAGE_VERSION is odd; this assumes
|
||||||
# $PACKAGE_VERSION follows the 'major.minor.micro' scheme
|
# $PACKAGE_VERSION follows the 'major.minor.micro' scheme
|
||||||
|
# * dash-version: ax_is_release will be 'no' if there is a dash '-'
|
||||||
|
# in $PACKAGE_VERSION, for example 1.2-pre3, 1.2.42-a8b9
|
||||||
|
# or 2.0-dirty (in particular this is suitable for use
|
||||||
|
# with git-version-gen)
|
||||||
# * always: ax_is_release will always be 'yes'
|
# * always: ax_is_release will always be 'yes'
|
||||||
# * never: ax_is_release will always be 'no'
|
# * never: ax_is_release will always be 'no'
|
||||||
#
|
#
|
||||||
@ -34,12 +38,13 @@
|
|||||||
# LICENSE
|
# LICENSE
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
|
# Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
|
||||||
|
# Copyright (c) 2016 Collabora Ltd.
|
||||||
#
|
#
|
||||||
# Copying and distribution of this file, with or without modification, are
|
# Copying and distribution of this file, with or without modification, are
|
||||||
# permitted in any medium without royalty provided the copyright notice
|
# permitted in any medium without royalty provided the copyright notice
|
||||||
# and this notice are preserved.
|
# and this notice are preserved.
|
||||||
|
|
||||||
#serial 4
|
#serial 5
|
||||||
|
|
||||||
AC_DEFUN([AX_IS_RELEASE],[
|
AC_DEFUN([AX_IS_RELEASE],[
|
||||||
AC_BEFORE([AC_INIT],[$0])
|
AC_BEFORE([AC_INIT],[$0])
|
||||||
@ -61,9 +66,15 @@ AC_DEFUN([AX_IS_RELEASE],[
|
|||||||
AS_IF([test "$(( $micro_version % 2 ))" -ne 0],
|
AS_IF([test "$(( $micro_version % 2 ))" -ne 0],
|
||||||
[ax_is_release=no],[ax_is_release=yes])
|
[ax_is_release=no],[ax_is_release=yes])
|
||||||
],
|
],
|
||||||
|
[dash-version],[
|
||||||
|
# $is_release = ($PACKAGE_VERSION has a dash)
|
||||||
|
AS_CASE([$PACKAGE_VERSION],
|
||||||
|
[*-*], [ax_is_release=no],
|
||||||
|
[*], [ax_is_release=yes])
|
||||||
|
],
|
||||||
[always],[ax_is_release=yes],
|
[always],[ax_is_release=yes],
|
||||||
[never],[ax_is_release=no],
|
[never],[ax_is_release=no],
|
||||||
[
|
[
|
||||||
AC_MSG_ERROR([Invalid policy. Valid policies: git-directory, minor-version.])
|
AC_MSG_ERROR([Invalid policy. Valid policies: git-directory, minor-version, micro-version, dash-version, always, never.])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user