From 382452a53bf33234f93e10cf31cee5ec3860dd57 Mon Sep 17 00:00:00 2001 From: Stelios Bounanos Date: Mon, 6 Oct 2014 14:23:09 -0500 Subject: [PATCH] Build system fixes * Replace AM_PROG_MKDIR_P with AC_PROG_MKDIR_P. AM_PROG_MKDIR_P has been deprecated and may be removed in a future version of automake. AC_PROG_MKDIR_P is available in autoconf 2.60 and later, and we currently require at least 2.61. * Use AC_LANG_SOURCE for the code passed to AC_{RUN,LINK}_IFELSE. * Pass the subdir-objects option to AM_INIT_AUTOMAKE to create objects in sub-directories. * Try harder to find the asciidoc icons directory that contains the images we need to build the new users' guide. * Don't invoke a2x with --destination-dir when generating manpages. --- configure.ac | 2 +- doc/Makefile.am | 9 ++++++--- m4/intl/po.m4 | 2 +- m4/tls.m4 | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 4b68a30f..d2c41f26 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,7 @@ AC_CANONICAL_HOST # define target, target_cpu, target_vendor, target_os AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE([-Wall foreign std-options 1.9.6]) +AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign std-options subdir-objects 1.9.6]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_MAINTAINER_MODE AC_CONFIG_SRCDIR([src/main.cxx]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 57983238..4507414f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -25,7 +25,7 @@ MOSTLYCLEANFILES = *.xml DISTCLEANFILES = $(ASCIIDOC_HTML) MAINTAINERCLEANFILES = $(ASCIIDOC_MAN_INST) -A2X_ARGS = --format=manpage --destination-dir=$(builddir)/../doc +A2X_ARGS = --format=manpage if HAVE_ASCIIDOC_NO_XMLLINT A2X_ARGS += --no-xmllint endif @@ -49,8 +49,11 @@ endif # The rest of the Makefile is enabled only if we have asciidoc if HAVE_ASCIIDOC - -ASCIIDOC_ICONS_DIR ?= /usr/share/asciidoc/images/icons +# Try to discover the correct iconsdir. Use the first one that +# contains an entry matching `tip.*'. +ASCIIDOC_ICONS_DIRS := /etc/asciidoc/icons /etc/asciidoc/images /etc/asciidoc/images/icons /etc/asciidoc/images/../icons \ + /usr/share/asciidoc/icons /usr/share/asciidoc/images /usr/share/asciidoc/images/icons +ASCIIDOC_ICONS_DIR ?= $(dir $(firstword $(strip $(foreach f,$(addsuffix /tip*,$(ASCIIDOC_ICONS_DIRS)),$(wildcard $(f)))))) # Additional attributes are defined in guide.conf ASCIIDOC_ARGS = --unsafe -a toc -a data-uri -a badges -a icons -a iconsdir=$(ASCIIDOC_ICONS_DIR) diff --git a/m4/intl/po.m4 b/m4/intl/po.m4 index 0734762a..f7c9c067 100644 --- a/m4/intl/po.m4 +++ b/m4/intl/po.m4 @@ -24,7 +24,7 @@ AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that diff --git a/m4/tls.m4 b/m4/tls.m4 index 5d8a34f5..986bed42 100644 --- a/m4/tls.m4 +++ b/m4/tls.m4 @@ -3,7 +3,7 @@ AC_DEFUN([CHECK_TLS], [ AC_MSG_CHECKING([for TLS support]) AC_LANG_PUSH(C++) - AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }], + AC_RUN_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { return a = b; }])], [chktls_save_CXXFLAGS="$CXXFLAGS" thread_CXXFLAGS=failed for flag in "" "-pthread" "-lpthread"; do @@ -44,7 +44,7 @@ AC_DEFUN([CHECK_TLS], [ CXXFLAGS="$chktls_save_CXXFLAGS" fi], [ac_cv_tls=no], - [AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }], + [AC_LINK_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { return a = b; }])], [ac_cv_tls=yes], [ac_cv_tls=no])] )