Commit a77aef9d authored by Kjell Ahlstedt's avatar Kjell Ahlstedt

Add LIBXMLXX_HAVE_EXCEPTION_PTR

* build/.gitignore: New file.
* build/cxx_std.m4: New file with LIBXMLXX_CXX_HAS_EXCEPTION_PTR
autoconf macro. Defines LIBXMLXX_HAVE_EXCEPTION_PTR if std::exception_ptr
exists.
* .gitignore: Move some lines to build/.gitignore.
* configure.ac: Store some build files in the build directory, like most mm
packages. Don't use the macros directory.
* libxml++config.h.in: Add LIBXMLXX_HAVE_EXCEPTION_PTR.
* Makefile.am:
* docs/Makefile.am: macros -> build. Bug #757042.

Thanks to Daniel Trebbien <dtrebbien@gmail.com>, who supplied a patch with
the test code in LIBXMLXX_HAVE_EXCEPTION_PTR.
parent 11353eaf
......@@ -65,25 +65,6 @@ stamp-h?
/examples/*/make_check.sh.trs
/examples/test-suite.log
# macros
/macros/compile
/macros/compile-binding.am
/macros/config.guess
/macros/config.sub
/macros/depcomp
/macros/dist-changelog.am
/macros/doc-reference.am
/macros/generate-binding.am
/macros/install-sh
/macros/libtool.m4
/macros/ltmain.sh
/macros/ltoptions.m4
/macros/ltsugar.m4
/macros/ltversion.m4
/macros/lt~obsolete.m4
/macros/missing
/macros/test-driver
# tests
/tests/*/test
/tests/*/test.log
......
## This file is part of libxml++.
ACLOCAL_AMFLAGS = -I macros ${ACLOCAL_FLAGS}
ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}
DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal
if ENABLE_DOCUMENTATION
......@@ -25,4 +25,4 @@ dist_noinst_SCRIPTS = autogen.sh
DISTCLEANFILES = MSVC_Net2010/libxml++/libxml++config.h
# Optional: auto-generate the ChangeLog file from the git log on make dist
include $(top_srcdir)/macros/dist-changelog.am
include $(top_srcdir)/build/dist-changelog.am
/compile
/compile-binding.am
/config.*
/depcomp
/dist-changelog.am
/doc-reference.am
/generate-binding.am
/install-sh
/libtool.m4
/lt*.m4
/ltmain.sh
/missing
/test-driver
## Copyright (C) 2015 The libxml++ development team
##
## This file is part of libxml++.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library 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
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library. If not, see <http://www.gnu.org/licenses/>.
## LIBXMLXX_CXX_HAS_EXCEPTION_PTR()
##
## Test whether std::exception_ptr, std::current_exception() and
## std::rethrow_exception() are defined.
##
## On success, #define LIBXMLXX_HAVE_EXCEPTION_PTR to 1.
##
AC_DEFUN([LIBXMLXX_CXX_HAS_EXCEPTION_PTR],
[
AC_CACHE_CHECK(
[whether C++ library supports std::exception_ptr],
[libxmlxx_cv_cxx_has_exception_ptr],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <exception>
]],[[
try
{
throw "custom error";
}
catch(...)
{
std::exception_ptr ep = std::current_exception();
std::rethrow_exception(ep);
}
]])],
[libxmlxx_cv_cxx_has_exception_ptr='yes'],
[libxmlxx_cv_cxx_has_exception_ptr='no']
)
])
AS_IF([test "x${libxmlxx_cv_cxx_has_exception_ptr}" = 'xyes'],
[AC_DEFINE([LIBXMLXX_HAVE_EXCEPTION_PTR], [1], [Defined if the C++ library supports std::exception_ptr.])])
])
......@@ -4,8 +4,8 @@ AC_INIT([libxml++], [2.40.0],
AC_PREREQ([2.59])
AC_CONFIG_SRCDIR([libxml++/libxml++.h])
AC_CONFIG_AUX_DIR([macros])
AC_CONFIG_MACRO_DIR([macros])
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build])
AC_CONFIG_HEADERS([config.h libxml++config.h])
AM_INIT_AUTOMAKE([1.9 -Wno-portability dist-bzip2 no-define nostdinc subdir-objects])
......@@ -35,6 +35,7 @@ PKG_CHECK_MODULES([LIBXMLXX], [$LIBXMLXX_MODULES])
AC_LANG([C++])
AC_CHECK_HEADERS([string list map], [], [AC_MSG_ERROR([required headers not found])])
LIBXMLXX_CXX_HAS_EXCEPTION_PTR
MM_ARG_ENABLE_DOCUMENTATION
MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
......
......@@ -19,7 +19,7 @@ book_name = $(LIBXMLXX_MODULE_NAME)
doc_input = $(addprefix $(top_srcdir)/libxml++/,$(h_sources_public))
# Sets dist_noinst_DATA, DISTCLEANFILES and MAINTAINERCLEANFILES
include $(top_srcdir)/macros/doc-reference.am
include $(top_srcdir)/build/doc-reference.am
manual/libxml++.xml: manual/libxml++_without_code.xml manual/insert_example_code.pl
$(AM_V_GEN)$(PERL) -- manual/insert_example_code.pl ../examples $< >$@
......
......@@ -6,6 +6,9 @@
/* Define to omit deprecated API from the library. */
#undef LIBXMLXX_DISABLE_DEPRECATED
/* Defined if the C++ library supports std::exception_ptr. */
#undef LIBXMLXX_HAVE_EXCEPTION_PTR
/* This is always set. This is only for backwards compatibility. */
#undef LIBXMLCPP_EXCEPTIONS_ENABLED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment