Rework configure script
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
AppliedMerged into master and stable-2.10.
Thanks,
Mathieu
Quoted 926 lines · ----- On May 9, 2017, at 4:10 PM, Michael Jeanson [email protected] wrote:
* Harmonize with our other projects
* Add missing checks
* Fix help strings indentation
* Fix SED tool detection
* Add mini-reportSigned-off-by Michael Jeanson <[email protected]>---
configure.ac | 325 ++++++++++++++++++++++++-------------- doc/examples/Makefile.am | 5 - m4/ax_c___attribute__.m4 | 66 ++++++++ m4/pprint.m4 | 208 ++++++++++++++++++++++++ m4/rw_prog_cxx_works.m4 | 36 +++++ tests/gcc-weak-hidden/Makefile.am | 2 +- tests/ust-elf/Makefile.am | 2 +- 7 files changed, 516 insertions(+), 128 deletions(-)create mode 100644 m4/ax_c___attribute__.m4
create mode 100644 m4/pprint.m4
create mode 100644 m4/rw_prog_cxx_works.m4configure.ac +0
-3@@ -1,19 +1,22 @@ -dnl -*- Autoconf -*- -dnl Process this file with autoconf to produce a configure script. -dnl Version infos
m4_define([V_MAJOR], [2])m4_define([V_MINOR], [10])m4_define([V_PATCH], [0])m4_define([V_EXTRA], [rc1])configure.ac +0
-2-m4_define([V_STRING], [V_MAJOR.V_MINOR.V_PATCH]) -m4_ifdef([V_EXTRA], [m4_append([V_STRING], [-V_EXTRA])])
m4_define([V_NAME], [[KeKriek]])
m4_define([V_DESC], [[From Brasserie Dunham, a sour mashed golden wheat ale fermented with local sour cherries from Tougas orchards. Fresh sweet cherry notes with some tartness, lively carbonation with a dry finish.]])configure.ac +3
-0+m4_define([V_STRING], [V_MAJOR.V_MINOR.V_PATCH]) +m4_ifdef([V_EXTRA], [m4_append([V_STRING], [-V_EXTRA])]) +
AC_PREREQ(2.59)
AC_INIT([lttng-ust],V_STRING, [mathieu dot desnoyers at efficios dot com], [],
[https://lttng.org])configure.ac +5
-0+dnl Substitute minor/major/patchlevel version numbers +AC_SUBST([MAJOR_VERSION], [V_MAJOR]) +AC_SUBST([MINOR_VERSION], [V_MINOR]) +AC_SUBST([PATCHLEVEL_VERSION], [V_PATCH]) +# Following the numbering scheme proposed by libtool for the library version #
http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# This is the library version of liblttng-ust.configure.ac +4
-0@@ -25,36 +28,50 @@ AC_SUBST([LTTNG_UST_LIBRARY_VERSION], [0:0:0]) # liblttng-ust, lttng-sessiond, and lttng-consumerd. AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], [3:0:1]) +AC_CONFIG_HEADERS([config.h include/lttng/ust-config.h]) AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([include/lttng/tracepoint.h]) +
AC_CANONICAL_TARGETAC_CANONICAL_HOSTconfigure.ac +1
-1-AC_CONFIG_MACRO_DIR([m4]) +
AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip tar-ustar])AM_MAINTAINER_MODE([enable])configure.ac +2
-0+ +# Enable silent rules if available (Introduced in AM 1.11)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])-AC_CONFIG_SRCDIR([include/lttng/tracepoint.h])
AC_REQUIRE_AUX_FILE([tap-driver.sh])configure.ac +0
-3-# Configuration options, which will be installed in the config.h -AC_CONFIG_HEADERS([config.h include/lttng/ust-config.h]) -AH_TEMPLATE([LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficientunaligned access.]) -AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via
sdt.h])
-AH_TEMPLATE([LTTNG_UST_HAVE_PERF_EVENT], [Perf event integration viaperf_event.h])configure.ac +15
-4+# Checks for C compiler +AC_USE_SYSTEM_EXTENSIONS +AC_SYS_LARGEFILE +AC_PROG_CC +AC_PROG_CC_STDC +AC_PROG_CXX +rw_PROG_CXX_WORKS +AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"]) -dnl Substitute minor/major/patchlevel version numbers -AC_SUBST([MAJOR_VERSION], [V_MAJOR]) -AC_SUBST([MINOR_VERSION], [V_MINOR]) -AC_SUBST([PATCHLEVEL_VERSION], [V_PATCH]) +# Check if the compiler support weak symbols +AX_SYS_WEAK_ALIAS + +AS_IF([test "x${ax_cv_sys_weak_alias}" = "xno"], [ + AC_MSG_ERROR([Your platform doesn't support weak symbols.]) +]) +# Checks for programs.
AC_PROG_SEDAC_PROG_GREPAC_PROG_LN_SAC_PROG_MKDIR_Pconfigure.ac +3
-0+AC_PROG_MAKE_SET +AC_CHECK_PROG([HAVE_CMAKE], [cmake], ["yes"]) +AM_CONDITIONAL([HAVE_CMAKE], [test "x$HAVE_CMAKE" = "xyes"])# libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321. AC_ARG_ENABLE([libtool-linkdep-fixup], [configure.ac +0
-1- AS_HELP_STRING([--disable-libtool-linkdep-fixup], [disable the libtool fixupfor linking all dependent libraries (
link_all_deplibs)]) +AS_HELP_STRING([--disable-libtool-linkdep-fixup], [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)])
], [
libtool_fixup=$enableval
], [configure.ac +76
-41@@ -70,59 +87,95 @@ AS_IF([test "x$libtool_fixup" = "xyes"], [ AS_IF([test $libtool_flag_pattern_count -ne 0], [ AC_MSG_RESULT([$libtool_flag_pattern_count]) AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) - sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 + $SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 ], [ AC_MSG_RESULT([none]) ]) ]) +LT_INIT([disable-static]) -AM_CONDITIONAL([NO_SHARED], [test "x$enable_shared" = "xno"]) - -# Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_CHECK_PROG([HAVE_CMAKE], [cmake], ["yes"]) -AM_CONDITIONAL([HAVE_CMAKE], [test "x$HAVE_CMAKE" = "xyes"]) -AC_PROG_MAKE_SET -LT_INIT - -# rw_PROG_CXX_WORKS -# Check whether the C++ compiler works. -AC_CACHE_CHECK([whether the C++ compiler works], [rw_cv_prog_cxx_works], [ - AC_LANG_PUSH([C++]) - - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ - check_cxx_designated_initializers=yes - ], [ - rw_cv_prog_cxx_works=no - ]) +AC_MSG_CHECKING([whether shared libraries are enabled]) +AS_IF([test "x$enable_shared" = "xyes"], [ + AC_MSG_RESULT([yes]) +], [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([LTTng-UST requires shared libraries to be enabled]) +]) - AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [ - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - struct foo { int a; int b; }; - void fct(void) - { - struct foo f = { .a = 0, .b = 1 }; - } - ]])], [ - rw_cv_prog_cxx_works=yes - ], [ - rw_cv_prog_cxx_works=no - ]) - ]) +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_CHECK_TYPES([ptrdiff_t]) + +AX_C___ATTRIBUTE__ +AS_IF([test "x$ax_cv___attribute__" = "xyes"], + [:], + [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])]) - AC_LANG_POP([C++]) +# Checks for library functions. +AC_FUNC_CHOWN +AC_FUNC_FORK +AC_FUNC_MMAP +AC_FUNC_REALLOC +AC_FUNC_STRERROR_R +AC_FUNC_STRNLEN +AC_CHECK_FUNCS([ \ + atexit \ + clock_gettime \ + ftruncate \ + getpagesize \ + gettimeofday \ + localeconv \ + memchr \ + memmove \ + memset \ + mkdir \ + munmap \ + realpath \ + sched_getcpu \ + socket \ + strchr \ + strdup \ + strerror \ + strtol \ + sysconf \ ]) -AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"]) - -# Check if the compiler support weak symbols -AX_SYS_WEAK_ALIAS +# AC_FUNC_MALLOC causes problems when cross-compiling. +#AC_FUNC_MALLOC -AS_IF([test "x${ax_cv_sys_weak_alias}" = "xno"], [ - AC_MSG_ERROR([Your platform doesn't support weak symbols.]) +# Checks for header files. +AC_HEADER_STDBOOL +AC_CHECK_HEADERS([ \ + arpa/inet.h \ + fcntl.h \ + float.h \ + limits.h \ + locale.h \ + stddef.h \ + sys/socket.h \ + sys/time.h \ + wchar.h \ ]) +# Configuration options, which will be installed in the config.h +AH_TEMPLATE([LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficient unaligned access.]) +AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via sdt.h]) +AH_TEMPLATE([LTTNG_UST_HAVE_PERF_EVENT], [Perf event integration via
perf_event.h])
+
# Checks for libraries.
AC_CHECK_LIB([dl], [dlopen], [
have_libdl=yesconfigure.ac +0
-0@@ -166,28 +219,6 @@ AS_IF([test "x${ac_cv_header_dlfcn_h}" = "xyes"], [
AM_CONDITIONAL([HAVE_DLINFO], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])configure.ac +0
-2-# Checks for header files. -dnl AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h
sys/time.hunistd.h])configure.ac +0
-19- -# Checks for typedefs, structures, and compiler characteristics. -AC_C_INLINE -dnl AC_TYPE_INT16_T -dnl AC_TYPE_INT32_T -dnl AC_TYPE_INT64_T -dnl AC_TYPE_INT8_T -dnl AC_TYPE_PID_T -dnl AC_TYPE_SIZE_T -dnl AC_TYPE_SSIZE_T -dnl AC_TYPE_UINT16_T -dnl AC_TYPE_UINT32_T -dnl AC_TYPE_UINT64_T -dnl AC_TYPE_UINT8_T -dnl AC_CHECK_TYPES([ptrdiff_t]) - -# Checks for library functions. -AC_FUNC_MALLOC -AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpusysconf])
-
# URCU# urcu - check if we just find the headers it out of the box.configure.ac +0
-0@@ -259,7 +290,7 @@ AS_IF([test "x$NO_UNALIGNED_ACCESS" = "x"], [ # Check for JNI header files if requestedAC_ARG_ENABLE([jni-interface], [
configure.ac +0
-1- AS_HELP_STRING([--enable-jni-interface], [build JNI interface between C andJava. Needs Java include files [default=no]]) +AS_HELP_STRING([--enable-jni-interface], [build JNI interface between C and Java. Needs Java include files [default=no]])
], [
jni_interface=$enableval
], [configure.ac +0
-0@@ -270,7 +301,7 @@ AM_CONDITIONAL([BUILD_JNI_INTERFACE], [test "x$jni_interface" = "xyes"])AC_ARG_ENABLE([java-agent-jul], [
configure.ac +0
-1- AS_HELP_STRING([--enable-java-agent-jul], [build the LTTng UST Java agent withJUL support [default=no]]) +AS_HELP_STRING([--enable-java-agent-jul], [build the LTTng UST Java agent with JUL support [default=no]])
], [
java_agent_jul=$enableval
], [configure.ac +0
-0@@ -278,7 +309,7 @@ AC_ARG_ENABLE([java-agent-jul], [ ])AC_ARG_ENABLE([java-agent-log4j], [
configure.ac +0
-1- AS_HELP_STRING([--enable-java-agent-log4j], [build the LTTng UST Java agentwith Log4j support [default=no]]) +AS_HELP_STRING([--enable-java-agent-log4j], [build the LTTng UST Java agent with Log4j support [default=no]])
], [
java_agent_log4j=$enableval
], [configure.ac +0
-0@@ -286,7 +317,7 @@ AC_ARG_ENABLE([java-agent-log4j], [ ])AC_ARG_ENABLE([java-agent-all], [
configure.ac +0
-1- AS_HELP_STRING([--enable-java-agent-all], [build the LTTng UST Java agent withall supported backends [default=no]]) +AS_HELP_STRING([--enable-java-agent-all], [build the LTTng UST Java agent with all supported backends [default=no]])
], [
java_agent_jul=$enableval
java_agent_log4j=$enablevalconfigure.ac +0
-0@@ -324,7 +355,7 @@ AS_IF([test "x$java_agent_log4j" = "xyes"], [ # Option to build the python agentAC_ARG_ENABLE([python-agent], [
configure.ac +0
-1- AS_HELP_STRING([--enable-python-agent], [build the LTTng UST Python agent[default=no]])
+AS_HELP_STRING([--enable-python-agent], [build the LTTng UST Python agent [default=no]])
], [
python_agent=$enableval
], [:])configure.ac +0
-0@@ -335,7 +366,7 @@ AS_IF([test "x$python_agent" = "xyes"], [ # sdt.h integrationAC_ARG_WITH([sdt], [
configure.ac +0
-1- AS_HELP_STRING([--with-sdt], [provide SystemTap integration via sdt.h[default=no]])
+AS_HELP_STRING([--with-sdt], [provide SystemTap integration viasdt.h[default=no]])
], [
with_sdt=$withval
], [configure.ac +0
-8@@ -360,16 +391,8 @@ AS_IF([test "x$with_sdt" = "xyes"], [ ]) ]) -AC_MSG_CHECKING([whether shared libraries are enabled]) -AS_IF([test "x$enable_shared" = "xyes"], [ - AC_MSG_RESULT([yes]) -], [ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([LTTng-UST requires shared libraries to be enabled]) -]) -AC_ARG_WITH([lttng-system-rundir], [
configure.ac +0
-1- AS_HELP_STRING([--with-lttng-system-rundir], [Location of the system directorywhere LTTng-UST expects the system-wide lttng-sessiond runtime files. The default is "
/var/run/lttng".]), +AS_HELP_STRING([--with-lttng-system-rundir], [Location of the system directory where LTTng-UST expects the system-wide lttng-sessiond runtime files. The default is "/var/run/lttng".]),
], [
lttng_system_rundir="$withval"
], [configure.ac +0
-0@@ -399,6 +422,7 @@ AC_ARG_ENABLE( # Check for asciidoc and xmlto if we enabled building the man pages.have_asciidoc_xmlto=no
+warn_prebuilt_man_pages=noAS_IF([test "x$man_pages_opt" = "xyes"], [
AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])configure.ac +1
-7@@ -419,13 +443,7 @@ they will not be installed. # Only warn here: since we're in the tarball, the man # pages should already be generated at this point, thus # asciidoc/xmlto are not strictly required. - AC_MSG_WARN([ -Both asciidoc and xmlto are needed to build the LTTng-UST man pages. -Note that the man pages are already built in this distribution tarball, -so asciidoc and xmlto are only needed if you intend to modify their -sources. Use --disable-man-pages to completely disable building -and installing the man pages. - ]) + warn_prebuilt_man_pages=yes ]) ], [ have_asciidoc_xmlto=yes@@ -509,37 +527,102 @@ AC_CONFIG_LINKS([
AC_OUTPUTconfigure.ac +9
-0+ +# +# Mini-report on what will be built. +# + +PPRINT_INIT +PPRINT_SET_INDENT(1) +PPRINT_SET_TS(38) +
AS_ECHOconfigure.ac +1
-1-AS_ECHO(["m4_bpatsubst(V_NAME, ["], [\\"])"]) +AS_ECHO("${PPRINT_COLOR_BLDBLU}LTTng-ust $PACKAGE_VERSION\"V_NAME\"$PPRINT_COLOR_RST")
AS_ECHOconfigure.ac +2
-2-AS_ECHO(["m4_bpatsubst(V_DESC, ["], [\\"])"]) -# Report on the configuration options +AS_ECHO("V_DESC") +
AS_ECHOconfigure.ac +9
-1-AS_ECHO(["LTTng-UST will be built with the following options:"]) +PPRINT_SUBTITLE([System]) + +PPRINT_PROP_STRING([Target architecture], $host_cpu) + +test "x$NO_UNALIGNED_ACCESS" != "x1" && value=1 || value=0 +PPRINT_PROP_BOOL([Efficient unaligned memory access], $value) + +AS_IF([test "x$UNSUPPORTED_ARCH" = "x1"],[ + PPRINT_WARN([Your architecture ($host_cpu) is unsupported, using safedefault of no unaligned access.])
+])configure.ac +19
-3+ +AS_ECHO +PPRINT_SUBTITLE([Features]) +PPRINT_SET_INDENT(1) + +test "x$with_sdt" = "xyes" && value=1 || value=0 +PPRINT_PROP_BOOL_CUSTOM([sdt.h integration], $value, [use --with-sdt]) + +test "x$java_agent_jul" = xyes && value=1 || value=0 +PPRINT_PROP_BOOL_CUSTOM([Java agent (JUL support)], $value, [use --enable-java-agent-jul]) + +test "x$java_agent_log4j" = xyes && value=1 || value=0 +PPRINT_PROP_BOOL_CUSTOM([Java agent (Log4j support)], $value, [use --enable-java-agent-log4j]) + +test "x$jni_interface" = xyes && value=1 || value=0 +PPRINT_PROP_BOOL_CUSTOM([JNI interface (JNI)], $value, [use --enable-jni-interface]) + +test "x$python_agent" = xyes && value=1 || value=0 +PPRINT_PROP_BOOL_CUSTOM([Python agent], $value, [use --enable-python-agent])
AS_ECHOconfigure.ac +1
-2+PPRINT_SET_INDENT(0) -AS_ECHO_N(["Java agent (JUL support): "]) -AS_IF([test "x$java_agent_jul" = "xyes"], [AS_ECHO(["Enabled"])],[
AS_ECHO(["Disabled (Use --enable-java-agent-jul)"])])configure.ac +2
-2+# man pages build enabled/disabled +m4_pushdef([build_man_pages_msg], [Build and install man pages]) -AS_ECHO_N(["Java agent (Log4j support): "]) -AS_IF([test "x$java_agent_log4j" = "xyes"], [AS_ECHO(["Enabled"])],[
AS_ECHO(["Disabled (Use --enable-java-agent-log4j)"])])configure.ac +15
-2+AS_IF([test "x$man_pages_opt" != "xno"], [ + AS_IF([test "x$in_git_repo" = "xyes"], [ + PPRINT_PROP_BOOL([build_man_pages_msg], 1, $PPRINT_COLOR_SUBTITLE) + ], [ + AS_IF([test "x$have_asciidoc_xmlto" = "xyes"], [ + PPRINT_PROP_BOOL([build_man_pages_msg], 1, $PPRINT_COLOR_SUBTITLE) + ], [ + PPRINT_PROP_STRING([build_man_pages_msg], + [${PPRINT_COLOR_BLDGRN}yes (already built)], + $PPRINT_COLOR_SUBTITLE) + ]) + ]) +], [ + PPRINT_PROP_BOOL([build_man_pages_msg], 0, $PPRINT_COLOR_SUBTITLE) +]) -AS_ECHO_N(["JNI interface (JNI): "]) -AS_IF([test "x$jni_interface" = "xyes"], [AS_ECHO(["Enabled"])],[
AS_ECHO(["Disabled (Use --enable-jni-interface)"])])configure.ac +1
-2+m4_popdef([build_man_pages_msg]) -AS_ECHO_N(["Python ($PYTHON) agent: "]) -AS_IF([test "x$python_agent" = "xyes"], [AS_ECHO(["Enabled"])],[
AS_ECHO(["Disabled (Use --enable-python-agent)"])])configure.ac +1
-2+PPRINT_SET_INDENT(1) -AS_ECHO_N(["sdt.h integration: "]) -AS_IF([test "x$with_sdt" = "xyes"], [AS_ECHO(["Enabled"])],[
AS_ECHO(["Disabled"])])configure.ac +2
-3+report_bindir="`eval eval echo $bindir`" +report_libdir="`eval eval echo $libdir`" -AS_ECHO(["Architecture: $host_cpu"]) -AS_ECHO_N(["Efficient unaligned memory access: "]) -AS_IF([test "x$NO_UNALIGNED_ACCESS" != "x1"], [AS_ECHO(["yes"])], [AS_IF([test"x$UNSUPPORTED_ARCH" != "x1"], [
AS_ECHO(["no"])], [AS_ECHO(["unknown"])])]) -AS_IF([test "x$UNSUPPORTED_ARCH" = "x1"], [AC_MSG_WARN([Your architecture ($host_cpu) is unsupported, using safe default of no unaligned access])]) +# Print the bindir and libdir this `make install' will install into.AS_ECHOconfigure.ac +13
-1+PPRINT_SUBTITLE([Install directories]) +PPRINT_PROP_STRING([Binaries], [$report_bindir]) +PPRINT_PROP_STRING([Libraries], [$report_libdir]) -AS_ECHO(["Type 'make' to compile."]) +AS_ECHO +PPRINT_SUBTITLE([System directories]) + +PPRINT_PROP_STRING([lttng-sessiond rundir], [$lttng_system_rundir]) + +PPRINT_SET_INDENT(0) + +AS_IF([test "x$warn_prebuilt_man_pages" = "xyes" ], [ + AS_ECHO + PPRINT_WARN([Both asciidoc and xmlto are needed to build the LTTng-UST manpages.
configure.ac +7
-0+Note that the man pages are already built in this distribution tarball, +therefore asciidoc and xmlto are only needed if you intend to modify +their sources. + +Use --disable-man-pages to completely disable building and installing +the man pages.]) +])doc/examples/Makefile.am +0
-4@@ -97,10 +97,6 @@ dist_doc_examples_getcpu_override_DATA = getcpu-override/Makefile \ getcpu-override/run-getcpu-override \ getcpu-override/README -if NO_SHARED -# Don't build examples if shared libraries support was explicitly -# disabled. -else # Copies are for VPATH build support SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef clock-override \getcpu-override demo-tracelog
doc/examples/Makefile.am +0
-1@@ -197,4 +193,3 @@ clean-local: rm -rf $(builddir)/$$subdir; \ done; \ fi; -endifm4/ax_c___attribute__.m4 new file +64
-0@@ -0,0 +1,66 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_C___ATTRIBUTE__ +# +# DESCRIPTION +# +# Provides a test for the compiler support of __attribute__ extensions. +# Defines HAVE___ATTRIBUTE__ if it is found. +# +# LICENSE +# +# Copyright (c) 2008 Stepan Kasal <[email protected]> +# Copyright (c) 2008 Christian Haggstrom +# Copyright (c) 2008 Ryan McCabe <[email protected]> +# +# 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 2 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 Archive. 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. + +#serial 8 + +AC_DEFUN([AX_C___ATTRIBUTE__], [ + AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdlib.h> + static void foo(void) __attribute__ ((unused)); + static void + foo(void) { + exit(1); + } + ]], [])], + [ax_cv___attribute__=yes], + [ax_cv___attribute__=no] + ) + ]) + if test "$ax_cv___attribute__" = "yes"; then + AC_DEFINE([HAVE___ATTRIBUTE__], 1, [define if your compiler has
__attribute__])m4/ax_c___attribute__.m4 new file +2
-0+ fi +])m4/pprint.m4 new file +18
-0@@ -0,0 +1,208 @@ +# Pretty printing macros. +# +# Author: Philippe Proulx <[email protected]> + +# PPRINT_INIT(): initializes the pretty printing system. +# +# Use this macro before using any other PPRINT_* macro. +AC_DEFUN([PPRINT_INIT], [ + m4_define([PPRINT_CONFIG_TS], [50]) + m4_define([PPRINT_CONFIG_INDENT], [2]) + PPRINT_YES_MSG=yes + PPRINT_NO_MSG=no + + # find tput, which tells us if colors are supported and gives us color codes + AC_PATH_PROG([pprint_tput], [tput]) + + AS_IF([test -n "$pprint_tput"], [ + AS_IF([test -n "$PS1" && test `"$pprint_tput" colors` -eq 256 && test -t1], [
m4/pprint.m4 new file +80
-0+ # interactive shell and colors supported and standard output + # file descriptor is opened on a terminal + PPRINT_COLOR_TXTBLK="`"$pprint_tput" setaf 0`" + PPRINT_COLOR_TXTBLU="`"$pprint_tput" setaf 4`" + PPRINT_COLOR_TXTGRN="`"$pprint_tput" setaf 2`" + PPRINT_COLOR_TXTCYN="`"$pprint_tput" setaf 6`" + PPRINT_COLOR_TXTRED="`"$pprint_tput" setaf 1`" + PPRINT_COLOR_TXTPUR="`"$pprint_tput" setaf 5`" + PPRINT_COLOR_TXTYLW="`"$pprint_tput" setaf 3`" + PPRINT_COLOR_TXTWHT="`"$pprint_tput" setaf 7`" + PPRINT_COLOR_BLD=`"$pprint_tput" bold` + PPRINT_COLOR_BLDBLK="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTBLK" + PPRINT_COLOR_BLDBLU="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTBLU" + PPRINT_COLOR_BLDGRN="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTGRN" + PPRINT_COLOR_BLDCYN="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTCYN" + PPRINT_COLOR_BLDRED="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTRED" + PPRINT_COLOR_BLDPUR="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTPUR" + PPRINT_COLOR_BLDYLW="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTYLW" + PPRINT_COLOR_BLDWHT="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTWHT" + PPRINT_COLOR_RST="`"$pprint_tput" sgr0`" + + # colored yes and no + PPRINT_YES_MSG="$PPRINT_COLOR_BLDGRN$PPRINT_YES_MSG$PPRINT_COLOR_RST" + PPRINT_NO_MSG="$PPRINT_COLOR_BLDRED$PPRINT_NO_MSG$PPRINT_COLOR_RST" + + # subtitle color + PPRINT_COLOR_SUBTITLE="$PPRINT_COLOR_BLDCYN" + ]) + ]) +]) + +# PPRINT_SET_INDENT(indent): sets the current indentation. +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_SET_INDENT], [ + m4_define([PPRINT_CONFIG_INDENT], [$1]) +]) + +# PPRINT_SET_TS(ts): sets the current tab stop. +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_SET_TS], [ + m4_define([PPRINT_CONFIG_TS], [$1]) +]) + +# PPRINT_SUBTITLE(subtitle): pretty prints a subtitle. +# +# The subtitle is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_SUBTITLE], [ + AS_ECHO(["${PPRINT_COLOR_SUBTITLE}$1$PPRINT_COLOR_RST"]) +]) + +AC_DEFUN([_PPRINT_INDENT], [ + m4_if(PPRINT_CONFIG_INDENT, 0, [ + ], [ + m4_for([pprint_i], [0], m4_eval(PPRINT_CONFIG_INDENT * 2 - 1), [1], [ + AS_ECHO_N([" "]) + ]) + ]) +]) + +# PPRINT_PROP_STRING(title, value, title_color?): pretty prints a +# string property. +# +# The title is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# The $PPRINT_CONFIG_INDENT variable must be set to the desired indentation +# level. +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_PROP_STRING], [ + m4_pushdef([pprint_title], [$1]) + m4_pushdef([pprint_value], [$2]) + m4_pushdef([pprint_title_color], m4_default([$3], [])) + m4_pushdef([pprint_title_len], m4_len(pprint_title)) + m4_pushdef([pprint_spaces_cnt], m4_eval(PPRINT_CONFIG_TS - pprint_title_len -(
PPRINT_CONFIG_INDENT* 2) - 1))m4/pprint.m4 new file +14
-0+ + m4_if(m4_eval(pprint_spaces_cnt <= 0), [1], [ + m4_define([pprint_spaces_cnt], [1]) + ]) + + m4_pushdef([pprint_spaces], []) + + m4_for([pprint_i], 0, m4_eval(pprint_spaces_cnt - 1), [1], [ + m4_append([pprint_spaces], [ ]) + ]) + + _PPRINT_INDENT + +
AS_ECHO_N(["pprint_title_color""pprint_title$PPRINT_COLOR_RST:pprint_spaces"])m4/pprint.m4 new file +27
-0+ AS_ECHO(["${PPRINT_COLOR_BLD}pprint_value$PPRINT_COLOR_RST"]) + + m4_popdef([pprint_spaces]) + m4_popdef([pprint_spaces_cnt]) + m4_popdef([pprint_title_len]) + m4_popdef([pprint_title_color]) + m4_popdef([pprint_value]) + m4_popdef([pprint_title]) +]) + +# PPRINT_PROP_BOOL(title, value, title_color?): pretty prints a boolean +# property. +# +# The title is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# The value is evaluated at shell runtime. Its evaluation must be +# 0 (false) or 1 (true). +# +# Uses the PPRINT_PROP_STRING() with the "yes" or "no" string. +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_PROP_BOOL], [ + m4_pushdef([pprint_title], [$1]) + m4_pushdef([pprint_value], [$2]) + + test pprint_value -eq 0 && pprint_msg="$PPRINT_NO_MSG" ||pprint_msg="$PPRINT_YES_MSG"
m4/pprint.m4 new file +12
-0+ + m4_if([$#], [3], [ + PPRINT_PROP_STRING(pprint_title, [$pprint_msg], $3) + ], [ + PPRINT_PROP_STRING(pprint_title, [$pprint_msg]) + ]) + + m4_popdef([pprint_value]) + m4_popdef([pprint_title]) +]) + +# PPRINT_PROP_BOOL_CUSTOM(title, value, no_msg, title_color?): pretty prints aboolean
m4/pprint.m4 new file +17
-0+# property. +# +# The title is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# The value is evaluated at shell runtime. Its evaluation must be +# 0 (false) or 1 (true). +# +# Uses the PPRINT_PROP_STRING() with the "yes" or "no" string. +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_PROP_BOOL_CUSTOM], [ + m4_pushdef([pprint_title], [$1]) + m4_pushdef([pprint_value], [$2]) + m4_pushdef([pprint_value_no_msg], [$3]) + + test pprint_value -eq 0 && pprint_msg="$PPRINT_NO_MSG (pprint_value_no_msg)"|| pprint_msg="$PPRINT_YES_MSG"
m4/pprint.m4 new file +23
-0+ + m4_if([$#], [4], [ + PPRINT_PROP_STRING(pprint_title, [$pprint_msg], $4) + ], [ + PPRINT_PROP_STRING(pprint_title, [$pprint_msg]) + ]) + + m4_popdef([pprint_value_no_msg]) + m4_popdef([pprint_value]) + m4_popdef([pprint_title]) +]) + +# PPRINT_WARN(msg): pretty prints a warning message. +# +# The message is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_WARN], [ + m4_pushdef([pprint_msg], [$1]) + + _PPRINT_INDENT + AS_ECHO(["${PPRINT_COLOR_TXTYLW}WARNING:$PPRINT_COLOR_RST${PPRINT_COLOR_BLDYLW}pprint_msg$PPRINT_COLOR_RST"])
m4/pprint.m4 new file +17
-0+ + m4_popdef([pprint_msg]) +]) + +# PPRINT_ERROR(msg): pretty prints an error message and exits. +# +# The message is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# Use PPRINT_INIT() before using this macro. +AC_DEFUN([PPRINT_ERROR], [ + m4_pushdef([pprint_msg], [$1]) + + AC_MSG_ERROR([${PPRINT_COLOR_BLDRED}pprint_msg$PPRINT_COLOR_RST]) + + m4_popdef([pprint_msg]) +])m4/rw_prog_cxx_works.m4 new file +36
-0@@ -0,0 +1,36 @@ +# rw_PROG_CXX_WORKS +# +# Check whether the C++ compiler works. There's a bit of oversight in +# autoconf that will set the C++ compiler to g++ if no compiler is found, +# even if g++ is not present! So we need an extra test to make sure that +# the compiler works. +# +AC_DEFUN([rw_PROG_CXX_WORKS], [ +AC_REQUIRE([AC_PROG_CXX]) +AC_CACHE_CHECK([whether the C++ compiler works], + [rw_cv_prog_cxx_works], + [AC_LANG_PUSH([C++]) + + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ + check_cxx_designated_initializers=yes + ], [ + rw_cv_prog_cxx_works=no + ]) + + AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + struct foo { int a; int b; }; + void fct(void) + { + struct foo f = { .a = 0, .b = 1 }; + } + ]])], [ + rw_cv_prog_cxx_works=yes + ], [ + rw_cv_prog_cxx_works=no + ]) + ]) + + AC_LANG_POP([C++]) +]) +])tests/gcc-weak-hidden/Makefile.am +0
-0@@ -13,5 +13,5 @@ CLEANFILES = $(noinst_SCRIPTS)
EXTRA_DIST= test_gcc_weak_hidden.in$(noinst_SCRIPTS): %: %.in
tests/gcc-weak-hidden/Makefile.am +1
-1- sed "s#@ABSTOPSRCDIR@#$(abs_top_srcdir)#g" < $< > $@ + $(SED) "s#@ABSTOPSRCDIR@#$(abs_top_srcdir)#g" < $< > $@chmod +x $@tests/ust-elf/Makefile.am +0
-0@@ -24,5 +24,5 @@ EXTRA_DIST = test_ust_elf.in \ $(srcdir)/data/pic/libhello.c$(noinst_SCRIPTS): %: %.in
tests/ust-elf/Makefile.am +1
-1- sed "s#@ABSTOPSRCDIR@#$(abs_top_srcdir)#g" < $< > $@ + $(SED) "s#@ABSTOPSRCDIR@#$(abs_top_srcdir)#g" < $< > $@chmod +x $@--
2.7.4
Signature · 7 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev