From 2936790fd91caa86fcc1a7a7ab1dabf6f87c513f Mon Sep 17 00:00:00 2001 From: S David <2100425+s-daveb@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:08:14 -0500 Subject: [PATCH] Remove Automake cruft and stop game from crashing on start. Close #149. Close #146 --- .gitmodules | 4 - CMakeLists.txt | 2 +- Makefile.am | 60 - NEWS | 0 bootstrap.sh | 1 - configure.ac | 129 -- debug.env | 12 - m4/.keep | 0 m4/ax_cxx_compile_stdcxx.m4 | 1018 ---------- m4/ax_cxx_compile_stdcxx_11.m4 | 39 - m4/ax_cxx_compile_stdcxx_14.m4 | 34 - m4/ax_cxx_compile_stdcxx_17.m4 | 35 - m4/boost.m4 | 1808 ----------------- m4/require-header.m4 | 7 - macos-homebrew.env | 7 - scripts/bootstrap.sh | 65 - scripts/rebuild-qtforms.sh | 66 - src/Makefile.am | 5 - src/editors/Makefile.am | 7 - src/editors/object-editor/EntityEditor.cpp | 11 +- src/framework/Makefile.am | 31 - .../core/components/PhysicalProperties.hpp | 4 +- .../core/components/PlayerBehavior.cpp | 4 +- src/framework/system/Makefile.am | 13 - src/framework/system/debuginfo.hpp | 107 +- src/framework/system/platform.hpp | 43 + src/game/ComponentStore.hpp | 19 +- src/game/Makefile.am | 17 - src/game/QuartzWarriors.cpp | 9 +- src/game/QuartzWarriors.hpp | 2 + src/tests/Makefile.am | 39 - src/tests/framework/Makefile.am | 14 - third_party/FakeIt | 1 - 33 files changed, 163 insertions(+), 3450 deletions(-) delete mode 100644 Makefile.am delete mode 100644 NEWS delete mode 120000 bootstrap.sh delete mode 100644 configure.ac delete mode 100644 debug.env delete mode 100644 m4/.keep delete mode 100644 m4/ax_cxx_compile_stdcxx.m4 delete mode 100644 m4/ax_cxx_compile_stdcxx_11.m4 delete mode 100644 m4/ax_cxx_compile_stdcxx_14.m4 delete mode 100644 m4/ax_cxx_compile_stdcxx_17.m4 delete mode 100644 m4/boost.m4 delete mode 100644 m4/require-header.m4 delete mode 100644 macos-homebrew.env delete mode 100755 scripts/bootstrap.sh delete mode 100755 scripts/rebuild-qtforms.sh delete mode 100644 src/Makefile.am delete mode 100644 src/editors/Makefile.am delete mode 100644 src/framework/Makefile.am delete mode 100644 src/framework/system/Makefile.am create mode 100644 src/framework/system/platform.hpp delete mode 100644 src/game/Makefile.am delete mode 100644 src/tests/Makefile.am delete mode 100644 src/tests/framework/Makefile.am delete mode 160000 third_party/FakeIt diff --git a/.gitmodules b/.gitmodules index 515f24e..c261d44 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,2 @@ -[submodule "third_party/FakeIt"] - path = third_party/FakeIt - url = https://github.com/eranpeer/FakeIt.git - shallow = true [submodule "third_party/Catch2"] shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt index fc1ba21..00c4788 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ project(ElementalEngine ) IF(NOT CMAKE_BUILD_TYPE) - SET( CMAKE_BUILD_TYPE Debug ... FORCE ) + SET( CMAKE_BUILD_TYPE Debug ) ENDIF() set(CMAKE_CXX_STANDARD 20) diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 0c82a4f..0000000 --- a/Makefile.am +++ /dev/null @@ -1,60 +0,0 @@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -ACLOCAL_AMFLAGS=-I m4 -# Variable declarations to be reused and appended with targets -bin_PROGRAMS= -check_PROGRAMS= -noinst_LIBRARIES= - -noinst_LTLIBRARIES= -pkglib_LTLIBRARIES= -include_HEADERS= - -TESTS= -EXTRA_LIBRARIES= - -phony_targets= -warning_flags= -disabled_warnings= - -qt5_extra_cxxflags=-fPIC -DPIC -warning_flags+=-Werror -Wall - -if HAVE_BUILD_SERVER -disabled_warnings+=-Wno-c++20-extensions -else -warning_flags+=-pedantic -endif - -project_include_flags= -project_include_flags+=-I ${srcdir}/src -project_include_flags+=-I ${srcdir}/third_party/cereal/include -project_include_flags+=-I ${srcdir}/third_party/nlohmann_json/include/nlohmann - -AM_CFLAGS= ${CFLAGS} -AM_CXXFLAGS= ${CXXFLAGS} -AM_CPPFLAGS= -std=c++20 - -AM_CFLAGS+=${warning_flags} -AM_CXXFLAGS+= ${warning_flags} ${disabled_warnings} -AM_CPPFLAGS+=$(project_include_flags) -AM_LDFLAGS= - - -rebuild-qtforms: - $(abs_top_srcdir)/rebuild-qtforms.sh - -run: ${bin_PROGRAMS} - @./quartz-warriors -all-am: @top_builddir@/res - -#if DEBUG_BUILD -#AM_CXXFLAGS += -ggdb -Og -#endif - -include src/Makefile.am -include editorconfig/vim-completion.am - -.PHONY: $(phony_targets) -# vim: set ts=4 sts=4 noet foldmethod=marker foldmarker=#region,#endregion : diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 120000 index 5b0a685..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1 +0,0 @@ -scripts/bootstrap.sh \ No newline at end of file diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 4fc4c17..0000000 --- a/configure.ac +++ /dev/null @@ -1,129 +0,0 @@ -dnl -*- Autoconf -*- -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) -AC_INIT([quartz-warriors], [0.0.3], []) - -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile]) - -AC_CANONICAL_HOST - -dnl AM_CONDITIONAL([HAVE_FREEBSD], [ test "${host_os#freebsd}" != "${host_os}" ]) -dnl AM_CONDITIONAL([HAVE_LINUX], [ test "${host_os#linux}" != "${host_os}" ]) -dnl AM_CONDITIONAL([HAVE_MACOS], [ test "${host_os#darwin}" != "${host_os}" ]) - -AC_ARG_WITH([ci-config], - [AS_HELP_STRING([--with-ci-config], - [Set this to 'yes' on build servers. - Disables certain warnings on specific OS/Buildserver combinations @<:@default=no@:>@])], - [with_ci_config=$withval], - [with_ci_config=no]) - -AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--enable-debug], - [Enable debugging symbols @<:@default=no@:>@])], - [enable_debug=$enableval], - [enable_debug=yes]) - -AM_CONDITIONAL([DEBUG_BUILD], [test "x$enable_debug" = "xyes"]) -AM_CONDITIONAL([HAVE_BUILD_SERVER], [ test "x${with_ci_config}" = "xyes" ]) - -AM_COND_IF([HAVE_BUILD_SERVER], - AC_MSG_NOTICE([CI configuration requested. Disabling pedantic mode & warnings about C++20 extensions]) -) - -dnl Predefine some shell variables for error messages -err_inplace_build="In-place builds are forbidden - -Try: -$ mkdir build && cd build ; -$ ../configure -" - -AC_MSG_CHECKING([that this is an out-of-source build]) - -dnl check to make sure that $srcdir is not '.' -dnl This package cannot be built in-place. Build it like a cmake project -case $srcdir in - .) - AC_MSG_RESULT([no]) - AC_MSG_ERROR([$err_inplace_build]) - AS_EXIT(255) - ;; - *) - AC_MSG_RESULT([yes]) - ;; -esac - -AC_CONFIG_LINKS([${builddir}res:${top_srcdir}res]) -AM_INIT_AUTOMAKE([1.15] [foreign subdir-objects dist-xz]) -AM_SILENT_RULES([yes]) - -dnl libtool support -LT_INIT - -dnl Add search paths for user-installed libraires and packages -PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/share/pkgconfig" -export PKG_CONFIG_PATH - -CPPFLAGS="${CPPFLAGS} -isystem /usr/local/include" -export CPPFLAGS - -PKG_PROG_PKG_CONFIG - -dnl Set default CXXFLAGS based on the debug option -if test "x$enable_debug" = "xyes"; then - AC_DEFINE([DEBUG_BUILD], [1], [Define if in debug build]) - AC_SUBST([CFLAGS], ["-ggdb -O0 -fno-inline-functions"]) - AC_SUBST([CXXFLAGS], ["-ggdb -O0 -fno-inline-functions"]) -fi -AC_PROG_CC -AC_PROG_CXX -AX_CXX_COMPILE_STDCXX(20, [noext], [mandatory]) -AC_CHECK_PROG([_ac_compiledb_detected], [compiledb], [true], [false]) - -AM_CONDITIONAL([HAVE_COMPILEDB], [test x$_ac_compiledb_detected = xtrue ]) - -AM_COND_IF([HAVE_COMPILEDB], - AC_MSG_NOTICE([compiledb found! vim-completion make target enabled]), - AC_MSG_WARN([compiledb not found. vim-completion make target disabled]) -) - -dnl Checks for libraries. -PKG_CHECK_MODULES([SDL2], [sdl2 >= 2 SDL2_image >= 0.29.0 SDL2_gfx >= 1.0.2]) - -AC_REQUIRE_HEADER([stdint.h]) -AC_CHECK_HEADERS([execinfo.h]) -dnl Checks for header files. - -dnl C++ Header library checks -AC_LANG_PUSH([C++]) - -BOOST_REQUIRE([1.7.2]) -PKG_CHECK_MODULES([CATCH2], [catch2-with-main >= 2.13.7]) - -PKG_CHECK_MODULES([QT], [Qt5Core >= 5.15 Qt5Widgets Qt5Gui], [ - QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)" - QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)" - QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)" - AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) - AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) - AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) - AC_PATH_PROGS(QMLCACHE, [qmlcachegen-qt5 qmlcachegen], no, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) -]) - -PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.11.0]) - - -dnl Check if we have a libexecinfo. -dnl On non-glibc systems, using backtrace requires linking to libexecinfo.o -AC_CHECK_LIB([execinfo], [backtrace], - [LIBS="${LIBS} -lexecinfo"; BOOST_FIND_HEADER([boost/stacktrace.hpp])]) -AC_CHECK_LIB([pthread], [pthread_create]) -AC_LANG_POP - -AC_CHECK_FUNCS([backtrace backtrace_symbols]) -AC_OUTPUT diff --git a/debug.env b/debug.env deleted file mode 100644 index f3666aa..0000000 --- a/debug.env +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -CFLAGS="${CFLAGS} -Og -ggdb" -CXXFLAGS=" ${CFLAGS} ${CXXFLAGS}" - -CPPFLAGS="${CPPFLAGS} -DQW_DEBUG" - -export CC -export CXX -export CFLAGS -export CXXFLAGS -export CPPFLAGS diff --git a/m4/.keep b/m4/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 deleted file mode 100644 index 8edf515..0000000 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ /dev/null @@ -1,1018 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for -# the respective C++ standard version. -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for no added switch, and then for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016, 2018 Krzesimir Nowak -# Copyright (c) 2019 Enji Cooper -# Copyright (c) 2020 Jason Merrill -# Copyright (c) 2021 Jörn Heusipp -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 18 - -dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro -dnl (serial version number 13). - -AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], - [$1], [14], [ax_cxx_compile_alternatives="14 1y"], - [$1], [17], [ax_cxx_compile_alternatives="17 1z"], - [$1], [20], [ax_cxx_compile_alternatives="20"], - [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$2], [], [], - [$2], [ext], [], - [$2], [noext], [], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], - [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], - [$3], [optional], [ax_cxx_compile_cxx$1_required=false], - [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - - m4_if([$2], [], [dnl - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi]) - - m4_if([$2], [noext], [], [dnl - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi]) - - m4_if([$2], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do - if test x"$switch" = xMSVC; then - dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide - dnl with -std=c++17. We suffix the cache variable name with _MSVC to - dnl avoid this. - switch=-std:c++${alternative} - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) - else - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - fi - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx$1_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) - fi - fi - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - AC_SUBST(HAVE_CXX$1) -]) - - -dnl Test body for checking C++11 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 -) - -dnl Test body for checking C++14 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 -) - -dnl Test body for checking C++17 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 -) - -dnl Test body for checking C++20 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 -) - - -dnl Tests for new features in C++11 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -// MSVC always sets __cplusplus to 199711L in older versions; newer versions -// only set it correctly if /Zc:__cplusplus is specified as well as a -// /std:c++NN switch: -// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ -#elif __cplusplus < 201103L && !defined _MSC_VER - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; - - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - -]]) - - -dnl Tests for new features in C++14 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201402L && !defined _MSC_VER - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_separators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - -]]) - - -dnl Tests for new features in C++17 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ - -// If the compiler admits that it is not ready for C++17, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201703L && !defined _MSC_VER - -#error "This is not a C++17 compiler" - -#else - -#include -#include -#include - -namespace cxx17 -{ - - namespace test_constexpr_lambdas - { - - constexpr int foo = [](){return 42;}(); - - } - - namespace test::nested_namespace::definitions - { - - } - - namespace test_fold_expression - { - - template - int multiply(Args... args) - { - return (args * ... * 1); - } - - template - bool all(Args... args) - { - return (args && ...); - } - - } - - namespace test_extended_static_assert - { - - static_assert (true); - - } - - namespace test_auto_brace_init_list - { - - auto foo = {5}; - auto bar {5}; - - static_assert(std::is_same, decltype(foo)>::value); - static_assert(std::is_same::value); - } - - namespace test_typename_in_template_template_parameter - { - - template typename X> struct D; - - } - - namespace test_fallthrough_nodiscard_maybe_unused_attributes - { - - int f1() - { - return 42; - } - - [[nodiscard]] int f2() - { - [[maybe_unused]] auto unused = f1(); - - switch (f1()) - { - case 17: - f1(); - [[fallthrough]]; - case 42: - f1(); - } - return f1(); - } - - } - - namespace test_extended_aggregate_initialization - { - - struct base1 - { - int b1, b2 = 42; - }; - - struct base2 - { - base2() { - b3 = 42; - } - int b3; - }; - - struct derived : base1, base2 - { - int d; - }; - - derived d1 {{1, 2}, {}, 4}; // full initialization - derived d2 {{}, {}, 4}; // value-initialized bases - - } - - namespace test_general_range_based_for_loop - { - - struct iter - { - int i; - - int& operator* () - { - return i; - } - - const int& operator* () const - { - return i; - } - - iter& operator++() - { - ++i; - return *this; - } - }; - - struct sentinel - { - int i; - }; - - bool operator== (const iter& i, const sentinel& s) - { - return i.i == s.i; - } - - bool operator!= (const iter& i, const sentinel& s) - { - return !(i == s); - } - - struct range - { - iter begin() const - { - return {0}; - } - - sentinel end() const - { - return {5}; - } - }; - - void f() - { - range r {}; - - for (auto i : r) - { - [[maybe_unused]] auto v = i; - } - } - - } - - namespace test_lambda_capture_asterisk_this_by_value - { - - struct t - { - int i; - int foo() - { - return [*this]() - { - return i; - }(); - } - }; - - } - - namespace test_enum_class_construction - { - - enum class byte : unsigned char - {}; - - byte foo {42}; - - } - - namespace test_constexpr_if - { - - template - int f () - { - if constexpr(cond) - { - return 13; - } - else - { - return 42; - } - } - - } - - namespace test_selection_statement_with_initializer - { - - int f() - { - return 13; - } - - int f2() - { - if (auto i = f(); i > 0) - { - return 3; - } - - switch (auto i = f(); i + 4) - { - case 17: - return 2; - - default: - return 1; - } - } - - } - - namespace test_template_argument_deduction_for_class_templates - { - - template - struct pair - { - pair (T1 p1, T2 p2) - : m1 {p1}, - m2 {p2} - {} - - T1 m1; - T2 m2; - }; - - void f() - { - [[maybe_unused]] auto p = pair{13, 42u}; - } - - } - - namespace test_non_type_auto_template_parameters - { - - template - struct B - {}; - - B<5> b1; - B<'a'> b2; - - } - - namespace test_structured_bindings - { - - int arr[2] = { 1, 2 }; - std::pair pr = { 1, 2 }; - - auto f1() -> int(&)[2] - { - return arr; - } - - auto f2() -> std::pair& - { - return pr; - } - - struct S - { - int x1 : 2; - volatile double y1; - }; - - S f3() - { - return {}; - } - - auto [ x1, y1 ] = f1(); - auto& [ xr1, yr1 ] = f1(); - auto [ x2, y2 ] = f2(); - auto& [ xr2, yr2 ] = f2(); - const auto [ x3, y3 ] = f3(); - - } - - namespace test_exception_spec_type_system - { - - struct Good {}; - struct Bad {}; - - void g1() noexcept; - void g2(); - - template - Bad - f(T*, T*); - - template - Good - f(T1*, T2*); - - static_assert (std::is_same_v); - - } - - namespace test_inline_variables - { - - template void f(T) - {} - - template inline T g(T) - { - return T{}; - } - - template<> inline void f<>(int) - {} - - template<> int g<>(int) - { - return 5; - } - - } - -} // namespace cxx17 - -#endif // __cplusplus < 201703L && !defined _MSC_VER - -]]) - - -dnl Tests for new features in C++20 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 202002L && !defined _MSC_VER - -#error "This is not a C++20 compiler" - -#else - -#include - -namespace cxx20 -{ - -// As C++20 supports feature test macros in the standard, there is no -// immediate need to actually test for feature availability on the -// Autoconf side. - -} // namespace cxx20 - -#endif // __cplusplus < 202002L && !defined _MSC_VER - -]]) diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 deleted file mode 100644 index 1733fd8..0000000 --- a/m4/ax_cxx_compile_stdcxx_11.m4 +++ /dev/null @@ -1,39 +0,0 @@ -# ============================================================================= -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html -# ============================================================================= -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXX and CXXCPP to enable -# support. -# -# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX -# macro with the version set to C++11. The two optional arguments are -# forwarded literally as the second and third argument respectively. -# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for -# more information. If you want to use this macro, you also need to -# download the ax_cxx_compile_stdcxx.m4 file. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 18 - -AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/m4/ax_cxx_compile_stdcxx_14.m4 b/m4/ax_cxx_compile_stdcxx_14.m4 deleted file mode 100644 index 094db0d..0000000 --- a/m4/ax_cxx_compile_stdcxx_14.m4 +++ /dev/null @@ -1,34 +0,0 @@ -# ============================================================================= -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html -# ============================================================================= -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++14 -# standard; if necessary, add switches to CXX and CXXCPP to enable -# support. -# -# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX -# macro with the version set to C++14. The two optional arguments are -# forwarded literally as the second and third argument respectively. -# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for -# more information. If you want to use this macro, you also need to -# download the ax_cxx_compile_stdcxx.m4 file. -# -# LICENSE -# -# Copyright (c) 2015 Moritz Klammler -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 5 - -AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])]) diff --git a/m4/ax_cxx_compile_stdcxx_17.m4 b/m4/ax_cxx_compile_stdcxx_17.m4 deleted file mode 100644 index a683417..0000000 --- a/m4/ax_cxx_compile_stdcxx_17.m4 +++ /dev/null @@ -1,35 +0,0 @@ -# ============================================================================= -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html -# ============================================================================= -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++17 -# standard; if necessary, add switches to CXX and CXXCPP to enable -# support. -# -# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX -# macro with the version set to C++17. The two optional arguments are -# forwarded literally as the second and third argument respectively. -# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for -# more information. If you want to use this macro, you also need to -# download the ax_cxx_compile_stdcxx.m4 file. -# -# LICENSE -# -# Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016 Krzesimir Nowak -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2 - -AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])]) diff --git a/m4/boost.m4 b/m4/boost.m4 deleted file mode 100644 index 6f1738b..0000000 --- a/m4/boost.m4 +++ /dev/null @@ -1,1808 +0,0 @@ -# boost.m4: Locate Boost headers and libraries for autoconf-based projects. -# Copyright (C) 2007-2011, 2014 Benoit Sigoure -# -# 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 3 of the License, or -# (at your option) any later version. -# -# Additional permission under section 7 of the GNU General Public -# License, version 3 ("GPLv3"): -# -# If you convey this file as part of a work that contains a -# configuration script generated by Autoconf, you may do so under -# terms of your choice. -# -# 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 . - -m4_define([_BOOST_SERIAL], [m4_translit([ -# serial 32 -], [# -], [])]) - -# Original sources can be found at http://github.com/tsuna/boost.m4 -# You can fetch the latest version of the script by doing: -# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4 - -# ------ # -# README # -# ------ # - -# This file provides several macros to use the various Boost libraries. -# The first macro is BOOST_REQUIRE. It will simply check if it's possible to -# find the Boost headers of a given (optional) minimum version and it will -# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to -# your configure so that users can specify non standard locations. -# If the user's environment contains BOOST_ROOT and --with-boost was not -# specified, --with-boost=$BOOST_ROOT is implicitly used. -# For more README and documentation, go to http://github.com/tsuna/boost.m4 -# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, -# simply read the README, it will show you what to do step by step. - -m4_pattern_forbid([^_?(BOOST|Boost)_]) - - -# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -------------------------------------------------------- -# Same as AC_EGREP_CPP, but leave the result in conftest.i. -# -# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded -# in double-quotes, so escape your double quotes. -# -# It could be useful to turn this into a macro which extracts the -# value of any macro. -m4_define([_BOOST_SED_CPP], -[AC_LANG_PUSH([C++])dnl -AC_LANG_PREPROC_REQUIRE()dnl -AC_REQUIRE([AC_PROG_SED])dnl -AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) -AS_IF([dnl eval is necessary to expand ac_cpp. -dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. -dnl Beware of Windows end-of-lines, for instance if we are running -dnl some Windows programs under Wine. In that case, boost/version.hpp -dnl is certainly using "\r\n", but the regular Unix shell will only -dnl strip `\n' with backquotes, not the `\r'. This results in -dnl boost_cv_lib_version='1_37\r' for instance, which breaks -dnl everything else. -dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK -dnl -dnl Beware that GCC 5, when expanding macros, may embed # line directives -dnl a within single line: -dnl -dnl # 1 "conftest.cc" -dnl # 1 "" -dnl # 1 "" -dnl # 1 "conftest.cc" -dnl # 1 "/opt/local/include/boost/version.hpp" 1 3 -dnl # 2 "conftest.cc" 2 -dnl boost-lib-version = -dnl # 2 "conftest.cc" 3 -dnl "1_56" -dnl -dnl So get rid of the # and empty lines, and glue the remaining ones together. -(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | - grep -v '#' | - grep -v '^[[[:space:]]]*$' | - tr -d '\r' | - tr -s '\n' ' ' | - $SED -n -e "$1" >conftest.i 2>&1], - [$3], - [$4]) -rm -rf conftest* -AC_LANG_POP([C++])dnl -])# _BOOST_SED_CPP - - - -# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND]) -# ----------------------------------------------- -# Look for Boost. If version is given, it must either be a literal of the form -# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a -# variable "$var". -# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with -# the required version, it does not check for any of the Boost libraries. -# On # success, defines HAVE_BOOST. On failure, calls the optional -# ACTION-IF-NOT-FOUND action if one was supplied. -# Otherwise aborts with an error message. -AC_DEFUN_ONCE([BOOST_REQUIRE], -[AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_PROG_GREP])dnl -echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD -boost_save_IFS=$IFS -boost_version_req=$1 -IFS=. -set x $boost_version_req 0 0 0 -IFS=$boost_save_IFS -shift -boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` -boost_version_req_string=$[1].$[2].$[3] -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost=DIR], - [prefix of Boost $1 @<:@guess@:>@])])dnl -AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl -# If BOOST_ROOT is set and the user has not provided a value to -# --with-boost, then treat BOOST_ROOT as if it the user supplied it. -if test x"$BOOST_ROOT" != x; then - if test x"$with_boost" = x; then - AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) - with_boost=$BOOST_ROOT - else - AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) - fi -fi -AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], - ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl -boost_save_CPPFLAGS=$CPPFLAGS - AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string], - [boost_cv_inc_path], - [boost_cv_inc_path=no -AC_LANG_PUSH([C++])dnl -m4_pattern_allow([^BOOST_VERSION$])dnl - AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include -#if !defined BOOST_VERSION -# error BOOST_VERSION is not defined -#elif BOOST_VERSION < $boost_version_req -# error Boost headers version < $boost_version_req -#endif -]])]) - # If the user provided a value to --with-boost, use it and only it. - case $with_boost in #( - ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ - /usr/include C:/Boost/include;; #( - *) set x "$with_boost/include" "$with_boost";; - esac - shift - for boost_dir - do - # Without --layout=system, Boost (or at least some versions) installs - # itself in /include/boost-. This inner loop helps to - # find headers in such directories. - # - # Any ${boost_dir}/boost-x_xx directories are searched in reverse version - # order followed by ${boost_dir}. The final '.' is a sentinel for - # searching $boost_dir" itself. Entries are whitespace separated. - # - # I didn't indent this loop on purpose (to avoid over-indented code) - boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \ - && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \ - && echo .` - for boost_inc in $boost_layout_system_search_list - do - if test x"$boost_inc" != x.; then - boost_inc="$boost_dir/$boost_inc" - else - boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list - fi - if test x"$boost_inc" != x; then - # We are going to check whether the version of Boost installed - # in $boost_inc is usable by running a compilation that - # #includes it. But if we pass a -I/some/path in which Boost - # is not installed, the compiler will just skip this -I and - # use other locations (either from CPPFLAGS, or from its list - # of system include directories). As a result we would use - # header installed on the machine instead of the /some/path - # specified by the user. So in that precise case (trying - # $boost_inc), make sure the version.hpp exists. - # - # Use test -e as there can be symlinks. - test -e "$boost_inc/boost/version.hpp" || continue - CPPFLAGS="$CPPFLAGS -I$boost_inc" - fi - AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) - if test x"$boost_cv_inc_path" = xyes; then - if test x"$boost_inc" != x; then - boost_cv_inc_path=$boost_inc - fi - break 2 - fi - done - done -AC_LANG_POP([C++])dnl - ]) - case $boost_cv_inc_path in #( - no) - boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" - m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], - [AC_MSG_NOTICE([$boost_errmsg])]) - $2 - ;;#( - yes) - BOOST_CPPFLAGS= - ;;#( - *) - AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl - ;; - esac - if test x"$boost_cv_inc_path" != xno; then - AC_DEFINE([HAVE_BOOST], [1], - [Defined if the requested minimum BOOST version is satisfied]) - AC_CACHE_CHECK([for Boost's header version], - [boost_cv_lib_version], - [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl - _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]], - [#include -boost-lib-version = BOOST_LIB_VERSION], - [boost_cv_lib_version=`cat conftest.i`])]) - # e.g. "134" for 1_34_1 or "135" for 1_35 - boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` - case $boost_major_version in #( - '' | *[[!0-9]]*) - AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version']) - ;; - esac -fi -CPPFLAGS=$boost_save_CPPFLAGS -])# BOOST_REQUIRE - - -# BOOST_STATIC() -# -------------- -# Add the "--enable-static-boost" configure argument. If this argument is given -# on the command line, static versions of the libraries will be looked up. -AC_DEFUN([BOOST_STATIC], - [AC_ARG_ENABLE([static-boost], - [AS_HELP_STRING([--enable-static-boost], - [Prefer the static boost libraries over the shared ones [no]])], - [enable_static_boost=yes], - [enable_static_boost=no])])# BOOST_STATIC - - -# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) -# -------------------------------------------------------------------------- -# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for -# some parts of the Boost library which are only made of headers and don't -# require linking (such as Boost.Foreach). -# -# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be -# found in the first place, in which case by default a notice is issued to the -# user. Presumably if we haven't died already it's because it's OK to not have -# Boost, which is why only a notice is issued instead of a hard error. -# -# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_ in -# case of success # (where HEADER-NAME is written LIKE_THIS, e.g., -# HAVE_BOOST_FOREACH_HPP). -AC_DEFUN([BOOST_FIND_HEADER], -[AC_REQUIRE([BOOST_REQUIRE])dnl -if test x"$boost_cv_inc_path" = xno; then - m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])]) -else -AC_LANG_PUSH([C++])dnl -boost_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_CHECK_HEADER([$1], - [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], - [Define to 1 if you have <$1>])])], - [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) -CPPFLAGS=$boost_save_CPPFLAGS -AC_LANG_POP([C++])dnl -fi -])# BOOST_FIND_HEADER - - -# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES], -# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], -# [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE], -# [ERROR_ON_UNUSABLE]) -# -------------------------------------------------------------- -# Look for the Boost library COMPONENT-NAME (e.g., `thread', for -# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g., -# "thread_win32 thread"). Check that HEADER-NAME works and check that -# libboost_LIB-NAME can link with the code CXX-TEST. The optional -# argument CXX-PROLOGUE can be used to include some C++ code before -# the `main' function. The CXX-POST-INCLUDE-PROLOGUE can be used to -# include some code before the `main' function, but after the -# `#include '. -# -# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). -# -# Boost libraries typically come compiled with several flavors (with different -# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one -# or more of the following letters: sgdpn (in that order). s = static -# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, -# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' -# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can -# start with `mt-' to indicate that there is a preference for multi-thread -# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp -# ... If you want to make sure you have a specific version of Boost -# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. -# -# ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their -# configure to fail -AC_DEFUN([BOOST_FIND_LIBS], -[AC_REQUIRE([BOOST_REQUIRE])dnl -AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl -AC_REQUIRE([BOOST_STATIC])dnl -AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl -if test x"$boost_cv_inc_path" = xno; then - AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library]) -else -dnl The else branch is huge and wasn't indented on purpose. -AC_LANG_PUSH([C++])dnl -AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl -AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl -AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl -AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl -AS_IF([test x"$8" = "xno"], [not_found_header='true']) -BOOST_FIND_HEADER([$4], [$not_found_header]) -boost_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], - [_BOOST_FIND_LIBS($@)]) -case $Boost_lib in #( - (yes) _AC_MSG_LOG_CONFTEST - AC_DEFINE(AS_TR_CPP([HAVE_BOOST_$1]), [1], [Defined if the Boost $1 library is available])dnl - AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl - AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl - AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl - AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl - ;; - (no) _AC_MSG_LOG_CONFTEST - AS_IF([test x"$8" != "xno"], [ - AC_MSG_ERROR([cannot find flags to link with the Boost $1 library (libboost-$1)]) - ]) - ;; -esac -CPPFLAGS=$boost_save_CPPFLAGS -AS_VAR_POPDEF([Boost_lib])dnl -AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl -AS_VAR_POPDEF([Boost_lib_LDPATH])dnl -AS_VAR_POPDEF([Boost_lib_LIBS])dnl -AC_LANG_POP([C++])dnl -fi -]) - - -# BOOST_FIND_LIB([LIB-NAME], -# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], -# [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE], -# [ERROR_ON_UNUSABLE]) -# -------------------------------------------------------------- -# Backward compatibility wrapper for BOOST_FIND_LIBS. -# ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their -# configure to fail -AC_DEFUN([BOOST_FIND_LIB], -[BOOST_FIND_LIBS([$1], $@)]) - - -# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES], -# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], -# [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE], -# [ERROR_ON_UNUSABLE]) -# -------------------------------------------------------------- -# Real implementation of BOOST_FIND_LIBS: rely on these local macros: -# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS -# -# The algorithm is as follows: first look for a given library name -# according to the user's PREFERRED-RT-OPT. For each library name, we -# prefer to use the ones that carry the tag (toolset name). Each -# library is searched through the various standard paths were Boost is -# usually installed. If we can't find the standard variants, we try -# to enforce -mt (for instance on MacOSX, libboost_thread.dylib -# doesn't exist but there's -obviously- libboost_thread-mt.dylib). -# -# ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their -# configure to fail -AC_DEFUN([_BOOST_FIND_LIBS], -[Boost_lib=no - case "$3" in #( - (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( - (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #( - (*) boost_mt=; boost_rtopt=$3;; - esac - if test $enable_static_boost = yes; then - boost_rtopt="s$boost_rtopt" - fi - # Find the proper debug variant depending on what we've been asked to find. - case $boost_rtopt in #( - (*d*) boost_rt_d=$boost_rtopt;; #( - (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') - boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( - (*) boost_rt_d='-d';; - esac - # If the PREFERRED-RT-OPT are not empty, prepend a `-'. - test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" - $boost_guess_use_mt && boost_mt=-mt - # Look for the abs path the static archive. - # $libext is computed by Libtool but let's make sure it's non empty. - test -z "$libext" && - AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) - boost_save_ac_objext=$ac_objext - # Generate the test file. - AC_LANG_CONFTEST([AC_LANG_PROGRAM([$7 -#include <$4> -$6], [$5])]) -dnl Optimization hacks: compiling C++ is slow, especially with Boost. What -dnl we're trying to do here is guess the right combination of link flags -dnl (LIBS / LDFLAGS) to use a given library. This can take several -dnl iterations before it succeeds and is thus *very* slow. So what we do -dnl instead is that we compile the code first (and thus get an object file, -dnl typically conftest.o). Then we try various combinations of link flags -dnl until we succeed to link conftest.o in an executable. The problem is -dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always -dnl remove all the temporary files including conftest.o. So the trick here -dnl is to temporarily change the value of ac_objext so that conftest.o is -dnl preserved accross tests. This is obviously fragile and I will burn in -dnl hell for not respecting Autoconf's documented interfaces, but in the -dnl mean time, it optimizes the macro by a factor of 5 to 30. -dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left -dnl empty because the test file is generated only once above (before we -dnl start the for loops). - AC_COMPILE_IFELSE([], - [ac_objext=do_not_rm_me_plz], - [AS_IF([test x"$8" != x"no"], [ - AC_MSG_ERROR([cannot compile a test that uses Boost $1]) - ]) - ]) - ac_objext=$boost_save_ac_objext - boost_failed_libs= -# Don't bother to ident the following nested for loops, only the 2 -# innermost ones matter. -for boost_lib_ in $2; do -for boost_tag_ in -$boost_cv_lib_tag ''; do -for boost_ver_ in -$boost_cv_lib_version ''; do -for boost_mt_ in $boost_mt -mt ''; do -for boost_rtopt_ in $boost_rtopt '' -d; do - for boost_full_suffix in \ - $boost_last_suffix \ - x$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ - x$boost_tag_$boost_rtopt_$boost_ver_ \ - x$boost_tag_$boost_mt_$boost_ver_ \ - x$boost_tag_$boost_ver_ - do - boost_real_suffix=`echo "$boost_full_suffix" | sed 's/^x//'` - boost_lib="boost_$boost_lib_$boost_real_suffix" - # Avoid testing twice the same lib - case $boost_failed_libs in #( - (*@$boost_lib@*) continue;; - esac - # If with_boost is empty, we'll search in /lib first, which is not quite - # right so instead we'll try to a location based on where the headers are. - boost_tmp_lib=$with_boost - test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} - for boost_ldpath in "$boost_tmp_lib/lib" '' \ - /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ - "$with_boost" C:/Boost/lib /lib* - do - # Don't waste time with directories that don't exist. - if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then - continue - fi - boost_save_LDFLAGS=$LDFLAGS - # Are we looking for a static library? - case $boost_ldpath:$boost_rtopt_ in #( - (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) - Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" - test -e "$Boost_lib_LIBS" || continue;; #( - (*) # No: use -lboost_foo to find the shared library. - Boost_lib_LIBS="-l$boost_lib";; - esac - boost_save_LIBS=$LIBS - LIBS="$Boost_lib_LIBS $LIBS" - test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" -dnl First argument of AC_LINK_IFELSE left empty because the test file is -dnl generated only once above (before we start the for loops). - _BOOST_AC_LINK_IFELSE([], - [Boost_lib=yes], [Boost_lib=no]) - ac_objext=$boost_save_ac_objext - LDFLAGS=$boost_save_LDFLAGS - LIBS=$boost_save_LIBS - if test x"$Boost_lib" = xyes; then - # Check or used cached result of whether or not using -R or - # -rpath makes sense. Some implementations of ld, such as for - # Mac OSX, require -rpath but -R is the flag known to work on - # other systems. https://github.com/tsuna/boost.m4/issues/19 - AC_CACHE_VAL([boost_cv_rpath_link_ldflag], - [case $boost_ldpath in - '') # Nothing to do. - boost_cv_rpath_link_ldflag= - boost_rpath_link_ldflag_found=yes;; - *) - for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do - LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" - LIBS="$Boost_lib_LIBS $boost_save_LIBS" - _BOOST_AC_LINK_IFELSE([], - [boost_rpath_link_ldflag_found=yes - break], - [boost_rpath_link_ldflag_found=no]) - done - ;; - esac - AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"], - [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])]) - LDFLAGS=$boost_save_LDFLAGS - LIBS=$boost_save_LIBS - ]) - test x"$boost_ldpath" != x && - Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" - Boost_lib_LDPATH="$boost_ldpath" - boost_last_suffix="$boost_full_suffix" - break 7 - else - boost_failed_libs="$boost_failed_libs@$boost_lib@" - fi - done - done -done -done -done -done -done # boost_lib_ -rm -f conftest.$ac_objext -]) - - - -# --------------------------------------- # -# Checks for the various Boost libraries. # -# --------------------------------------- # - -# List of boost libraries: http://www.boost.org/libs/libraries.htm -# The page http://beta.boost.org/doc/libs is useful: it gives the first release -# version of each library (among other things). - -# BOOST_DEFUN(LIBRARY, CODE) -# -------------------------- -# Define BOOST_ as a macro that runs CODE. -# -# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN. -m4_define([BOOST_DEFUN], -[m4_indir([AC_DEFUN], - m4_toupper([BOOST_$1]), -[m4_pushdef([BOOST_Library], [$1])dnl -$2 -m4_popdef([BOOST_Library])dnl -]) -]) - - -# BOOST_ANY() -# ------------ -# Look for Boost.Any -BOOST_DEFUN([Any], -[BOOST_FIND_HEADER([boost/any.hpp])]) - - -# BOOST_ARRAY() -# ------------- -# Look for Boost.Array -BOOST_DEFUN([Array], -[BOOST_FIND_HEADER([boost/array.hpp])]) - - -# BOOST_ASIO() -# ------------ -# Look for Boost.Asio (new in Boost 1.35). -BOOST_DEFUN([Asio], -[AC_REQUIRE([BOOST_SYSTEM])dnl -BOOST_FIND_HEADER([boost/asio.hpp])]) - -# BOOST_BIMAP() -# ------------ -# Look for Boost.Bimap -BOOST_DEFUN([Bimap], -[BOOST_FIND_HEADER([boost/bimap.hpp])]) - - -# BOOST_ASSIGN() -# ------------- -# Look for Boost.Assign -BOOST_DEFUN([Assign], -[BOOST_FIND_HEADER([boost/assign.hpp])]) - - -# BOOST_ATOMIC([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------- -# Look for Boost.Atomic. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Atomic], -[BOOST_FIND_LIB([atomic], [$1], - [boost/atomic.hpp], - [boost::atomic a;], - [ ], - [#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDINT_H -#include -#endif], [$2]) -])# BOOST_ATOMIC - - -# BOOST_BIND() -# ------------ -# Look for Boost.Bind. -BOOST_DEFUN([Bind], -[BOOST_FIND_HEADER([boost/bind.hpp])]) - - -# BOOST_CAST() -# ------------ -# Look for Boost.Cast -BOOST_DEFUN([Cast], -[BOOST_FIND_HEADER([boost/cast.hpp])]) - - -# BOOST_CHRONO([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# -------------- -# Look for Boost.Chrono. -BOOST_DEFUN([Chrono], -[# Do we have to check for Boost.System? This link-time dependency was -# added as of 1.35.0. If we have a version <1.35, we must not attempt to -# find Boost.System as it didn't exist by then. -if test $boost_major_version -ge 135; then - BOOST_SYSTEM([$1], [$2]) -fi # end of the Boost.System check. -boost_filesystem_save_LIBS=$LIBS -boost_filesystem_save_LDFLAGS=$LDFLAGS -m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -BOOST_FIND_LIB([chrono], [$1], - [boost/chrono.hpp], - [boost::chrono::thread_clock d;], [], [], [$2]) -if test $enable_static_boost = yes && test $boost_major_version -ge 135; then - BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS" -fi -LIBS=$boost_filesystem_save_LIBS -LDFLAGS=$boost_filesystem_save_LDFLAGS -])# BOOST_CHRONO - - -# BOOST_CONTEXT([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------- -# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -# -# * This library was introduced in Boost 1.51.0 -# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0 -# * A dependency on boost_thread appears in 1.57.0 -# * The implementation details were moved to boost::context::detail in 1.61.0 -# * 1.61 also introduces execution_context_v2, which is the "lowest common -# denominator" for boost::context presence since then. -# * boost::context::fiber was introduced in 1.69 and execution_context_v2 was -# removed in 1.72 -BOOST_DEFUN([Context], -[boost_context_save_LIBS=$LIBS - boost_context_save_LDFLAGS=$LDFLAGS -if test $boost_major_version -ge 157; then - BOOST_THREAD([$1], [$2]) - m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl - LIBS="$LIBS $BOOST_THREAD_LIBS" - LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS" -fi - -if test $boost_major_version -ge 169; then - -BOOST_FIND_LIB([context], [$1], - [boost/context/fiber.hpp], [[ -namespace ctx=boost::context; -int a; -ctx::fiber source{[&a](ctx::fiber&& sink){ - a=0; - int b=1; - for(;;){ - sink=std::move(sink).resume(); - int next=a+b; - a=b; - b=next; - } - return std::move(sink); -}}; -for (int j=0;j<10;++j) { - source=std::move(source).resume(); -} -return a == 34; -]], [], [], [$2]) - -elif test $boost_major_version -ge 161; then - -BOOST_FIND_LIB([context], [$1], - [boost/context/execution_context_v2.hpp], [[ -namespace ctx=boost::context; -int res=0; -int n=35; -ctx::execution_context source( - [n, &res](ctx::execution_context sink, int) mutable { - int a=0; - int b=1; - while(n-->0){ - auto result=sink(a); - sink=std::move(std::get<0>(result)); - auto next=a+b; - a=b; - b=next; - } - return sink; - }); -for(int i=0;i<10;++i){ - auto result=source(i); - source=std::move(std::get<0>(result)); - res = std::get<1>(result); -} -return res == 34; -]], [], [], [$2]) - -else - -BOOST_FIND_LIB([context], [$1], - [boost/context/fcontext.hpp],[[ - -// creates a stack -void * stack_pointer = new void*[4096]; -std::size_t const size = sizeof(void*[4096]); - -#if BOOST_VERSION <= 105100 -ctx::make_fcontext(&fc, f); -return ctx::jump_fcontext(&fcm, &fc, 3) == 6; - -#else - -fc = ctx::make_fcontext(stack_pointer, size, f); -return ctx::jump_fcontext(&fcm, fc, 3) == 6; - -#endif - - -]],[dnl - -#include -#if BOOST_VERSION <= 105100 - -namespace ctx = boost::ctx; - -static ctx::fcontext_t fcm, fc; - -static void f(intptr_t i) { - ctx::jump_fcontext(&fc, &fcm, i * 2); -} - -#elif BOOST_VERSION <= 105500 - -namespace ctx = boost::context; - -// context -static ctx::fcontext_t fcm, *fc; - -// context-function -static void f(intptr_t i) { - ctx::jump_fcontext(fc, &fcm, i * 2); -} - -#else - -namespace ctx = boost::context; - -// context -static ctx::fcontext_t fcm, fc; - -// context-function -static void f(intptr_t i) { - ctx::jump_fcontext(&fc, fcm, i * 2); -} -#endif -], [], [], [$2]) - -fi - -LIBS=$boost_context_save_LIBS -LDFLAGS=$boost_context_save_LDFLAGS -])# BOOST_CONTEXT - - -# BOOST_CONVERSION() -# ------------------ -# Look for Boost.Conversion (cast / lexical_cast) -BOOST_DEFUN([Conversion], -[BOOST_FIND_HEADER([boost/cast.hpp]) -BOOST_FIND_HEADER([boost/lexical_cast.hpp]) -])# BOOST_CONVERSION - - -# BOOST_COROUTINE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------- -# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. This library was introduced in Boost -# 1.53.0 -BOOST_DEFUN([Coroutine], -[ -boost_coroutine_save_LIBS=$LIBS -boost_coroutine_save_LDFLAGS=$LDFLAGS -# Link-time dependency from coroutine to context -BOOST_CONTEXT([$1], [$2]) -# Starting from Boost 1.55 a dependency on Boost.System is added -if test $boost_major_version -ge 155; then - BOOST_SYSTEM([$1], [$2]) -fi -m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)]) -LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS" - -# in 1.53 coroutine was a header only library -if test $boost_major_version -eq 153; then - AS_IF([test x"$2" = "xno"], [not_found_header='true']) - BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp], [$not_found_header]) -else - BOOST_FIND_LIB([coroutine], [$1], - [boost/coroutine/coroutine.hpp], - [ - #include - #if BOOST_VERSION <= 105500 - boost::coroutines::coroutine coro; coro.get(); - #else - boost::coroutines::asymmetric_coroutine::pull_type coro; coro.get(); - #endif - ], [], [], [$2]) -fi -# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54 -# coroutine doesn't use context from its headers but from its library. -if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then - BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS" - BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS" -fi -if test $enable_static_boost = yes && test $boost_major_version -ge 155; then - BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS" - BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS" -fi -LIBS=$boost_coroutine_save_LIBS -LDFLAGS=$boost_coroutine_save_LDFLAGS -])# BOOST_COROUTINE - - -# BOOST_CRC() -# ----------- -# Look for Boost.CRC -BOOST_DEFUN([CRC], -[BOOST_FIND_HEADER([boost/crc.hpp]) -])# BOOST_CRC - - -# BOOST_DATE_TIME([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------- -# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Date_Time], -[BOOST_FIND_LIB([date_time], [$1], - [boost/date_time/posix_time/posix_time.hpp], - [boost::posix_time::ptime t;], [], [], [$2]) -])# BOOST_DATE_TIME - - -# BOOST_EXCEPTION() -# ------------ -# Look for Boost.Exception -BOOST_DEFUN([Exception], -[BOOST_FIND_HEADER([boost/exception/all.hpp])]) - - -# BOOST_FILESYSTEM([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------------ -# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see -# the documentation of BOOST_FIND_LIB above. -# Do not check for boost/filesystem.hpp because this file was introduced in -# 1.34. -BOOST_DEFUN([Filesystem], -[# Do we have to check for Boost.System? This link-time dependency was -# added as of 1.35.0. If we have a version <1.35, we must not attempt to -# find Boost.System as it didn't exist by then. -if test $boost_major_version -ge 135; then - BOOST_SYSTEM([$1], [$2]) -fi # end of the Boost.System check. -boost_filesystem_save_LIBS=$LIBS -boost_filesystem_save_LDFLAGS=$LDFLAGS -m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -BOOST_FIND_LIB([filesystem], [$1], - [boost/filesystem/path.hpp], [boost::filesystem::path p;], - [], [], [$2]) -if test $enable_static_boost = yes && test $boost_major_version -ge 135; then - BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" -fi -LIBS=$boost_filesystem_save_LIBS -LDFLAGS=$boost_filesystem_save_LDFLAGS -])# BOOST_FILESYSTEM - - -# BOOST_FLYWEIGHT() -# ----------------- -# Look for Boost.Flyweight. -BOOST_DEFUN([Flyweight], -[dnl There's a hidden dependency on pthreads. -AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl -BOOST_FIND_HEADER([boost/flyweight.hpp]) -AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag]) -]) - - -# BOOST_FOREACH() -# --------------- -# Look for Boost.Foreach. -BOOST_DEFUN([Foreach], -[BOOST_FIND_HEADER([boost/foreach.hpp])]) - - -# BOOST_FORMAT() -# -------------- -# Look for Boost.Format. -# Note: we can't check for boost/format/format_fwd.hpp because the header isn't -# standalone. It can't be compiled because it triggers the following error: -# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' -# does not name a type -BOOST_DEFUN([Format], -[BOOST_FIND_HEADER([boost/format.hpp])]) - - -# BOOST_FUNCTION() -# ---------------- -# Look for Boost.Function -BOOST_DEFUN([Function], -[BOOST_FIND_HEADER([boost/function.hpp])]) - - -# BOOST_FUSION() -# ----------------- -# Look for Boost.Fusion -BOOST_DEFUN([Fusion], -[BOOST_FIND_HEADER([boost/fusion/sequence.hpp])]) - - -# BOOST_GEOMETRY() -# ---------------- -# Look for Boost.Geometry (new since 1.47.0). -BOOST_DEFUN([Geometry], -[BOOST_FIND_HEADER([boost/geometry.hpp]) -])# BOOST_GEOMETRY - - -# BOOST_GRAPH([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------- -# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Graph], -[boost_graph_save_LIBS=$LIBS -boost_graph_save_LDFLAGS=$LDFLAGS -# Link-time dependency from graph to regex was added as of 1.40.0. -if test $boost_major_version -ge 140; then - BOOST_REGEX([$1], [$2]) - m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl - LIBS="$LIBS $BOOST_REGEX_LIBS" - LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS" -fi -BOOST_FIND_LIB([graph], [$1], - [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;], - [], [], [$2]) -LIBS=$boost_graph_save_LIBS -LDFLAGS=$boost_graph_save_LDFLAGS -])# BOOST_GRAPH - - -# BOOST_HASH() -# ------------ -# Look for Boost.Functional/Hash -BOOST_DEFUN([Hash], -[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) - - -# BOOST_IOSTREAMS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------- -# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([IOStreams], -[BOOST_FIND_LIB([iostreams], [$1], - [boost/iostreams/device/file_descriptor.hpp], - [boost::iostreams::file_descriptor fd; fd.close();], - [], [], [$2]) -])# BOOST_IOSTREAMS - - -# BOOST_ITERATOR() -# ------------ -# Look for Boost.Iterator -BOOST_DEFUN([Iterator], -[BOOST_FIND_HEADER([boost/iterator/iterator_adaptor.hpp])]) - - -# BOOST_LAMBDA() -# -------------- -# Look for Boost.Lambda -BOOST_DEFUN([Lambda], -[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) - - -# BOOST_LOCALE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# -------------- -# Look for Boost.Locale -BOOST_DEFUN([Locale], -[ -boost_locale_save_LIBS=$LIBS -boost_locale_save_LDFLAGS=$LDFLAGS -# require SYSTEM for boost-1.50.0 and up -if test $boost_major_version -ge 150; then - BOOST_SYSTEM([$1], [$2]) - m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl - LIBS="$LIBS $BOOST_SYSTEM_LIBS" - LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -fi # end of the Boost.System check. -BOOST_FIND_LIB([locale], [$1], - [boost/locale.hpp], - [[boost::locale::generator gen; std::locale::global(gen(""));]], [], [], [$2]) -LIBS=$boost_locale_save_LIBS -LDFLAGS=$boost_locale_save_LDFLAGS -])# BOOST_LOCALE - -# BOOST_LOG([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------- -# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Log], -[boost_log_save_LIBS=$LIBS -boost_log_save_LDFLAGS=$LDFLAGS -BOOST_SYSTEM([$1], [$2]) -BOOST_FILESYSTEM([$1], [$2]) -BOOST_DATE_TIME([$1], [$2]) -m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS" -BOOST_FIND_LIB([log], [$1], - [boost/log/core/core.hpp], - [boost::log::attribute a; a.get_value();], [], [], [$2]) -LIBS=$boost_log_save_LIBS -LDFLAGS=$boost_log_save_LDFLAGS -])# BOOST_LOG - - -# BOOST_LOG_SETUP([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------- -# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Log_Setup], -[boost_log_setup_save_LIBS=$LIBS -boost_log_setup_save_LDFLAGS=$LDFLAGS -BOOST_LOG([$1]) -m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_LOG_LIBS" -LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS" -BOOST_FIND_LIB([log_setup], [$1], - [boost/log/utility/setup/from_settings.hpp], - [boost::log::basic_settings bs; bs.empty();], [], [], [$2]) -LIBS=$boost_log_setup_save_LIBS -LDFLAGS=$boost_log_setup_save_LDFLAGS -])# BOOST_LOG_SETUP - - -# BOOST_MATH() -# ------------ -# Look for Boost.Math -# TODO: This library isn't header-only but it comes in multiple different -# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99, -# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, -# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the -# right thing anyway. -BOOST_DEFUN([Math], -[BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) - - -# BOOST_MPI([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------- -# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is -# set, otherwise tries CXX -# -BOOST_DEFUN([MPI], -[boost_save_CXX=${CXX} -boost_save_CXXCPP=${CXXCPP} -if test x"${MPICXX}" != x; then - CXX=${MPICXX} - CXXCPP="${MPICXX} -E" -fi -BOOST_FIND_LIB([mpi], [$1], - [boost/mpi.hpp], - [int argc = 0; - char **argv = 0; - boost::mpi::environment env(argc,argv);], - [], [], [$2]) -CXX=${boost_save_CXX} -CXXCPP=${boost_save_CXXCPP} -])# BOOST_MPI - - -# BOOST_MPL() -# ------------------ -# Look for Boost.MPL -BOOST_DEFUN([MPL], -[BOOST_FIND_HEADER([boost/mpl/for_each.hpp])]) - - -# BOOST_MULTIARRAY() -# ------------------ -# Look for Boost.MultiArray -BOOST_DEFUN([MultiArray], -[BOOST_FIND_HEADER([boost/multi_array.hpp])]) - - -# BOOST_MULTIINDEXCCONTAINER() -# ------------------ -# Look for Boost.MultiIndexContainer -BOOST_DEFUN([MultiIndexContainer], -[BOOST_FIND_HEADER([boost/multi_index_container.hpp])]) - - -# BOOST_NUMERIC_UBLAS() -# -------------------------- -# Look for Boost.NumericUblas (Basic Linear Algebra) -BOOST_DEFUN([Numeric_Ublas], -[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp]) -])# BOOST_NUMERIC_UBLAS - - -# BOOST_NUMERIC_CONVERSION() -# -------------------------- -# Look for Boost.NumericConversion (policy-based numeric conversion) -BOOST_DEFUN([Numeric_Conversion], -[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) -])# BOOST_NUMERIC_CONVERSION - - -# BOOST_OPTIONAL() -# ---------------- -# Look for Boost.Optional -BOOST_DEFUN([Optional], -[BOOST_FIND_HEADER([boost/optional.hpp])]) - - -# BOOST_PREPROCESSOR() -# -------------------- -# Look for Boost.Preprocessor -BOOST_DEFUN([Preprocessor], -[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) - - -# BOOST_PROPERTY_TREE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------------- -# Look for Boost.Property_Tree. For the documentation of PREFERRED-RT-OPT, -# see the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Property_Tree], -[BOOST_FIND_LIB([property_tree], [$1], - [boost/property_tree/ptree.hpp], - [boost::property_tree::ptree pt; boost::property_tree::read_xml d("test", pt);], - [], [], [$2]) -])# BOOST_PROPERTY_TREE - - -# BOOST_RANDOM() -# -------------------- -# Look for Boost.Random -BOOST_DEFUN([Random], -[BOOST_FIND_HEADER([boost/random/random_number_generator.hpp])]) - - -# BOOST_RANGE() -# -------------------- -# Look for Boost.Range -BOOST_DEFUN([Range], -[BOOST_FIND_HEADER([boost/range/adaptors.hpp])]) - -# BOOST_UNORDERED() -# ----------------- -# Look for Boost.Unordered -BOOST_DEFUN([Unordered], -[BOOST_FIND_HEADER([boost/unordered_map.hpp])]) - - -# BOOST_UUID() -# ------------ -# Look for Boost.Uuid -BOOST_DEFUN([Uuid], -[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])]) - - -# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ----------------------------------------- -# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, -# see the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Program_Options], -[BOOST_FIND_LIB([program_options], [$1], - [boost/program_options.hpp], - [boost::program_options::options_description d("test");], - [], [], [$2]) -])# BOOST_PROGRAM_OPTIONS - - - -# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) -# ------------------------------------ -# Save VARIABLE, and define it via `python-config --FLAG`. -# Substitute BOOST_PYTHON_VARIABLE. -m4_define([_BOOST_PYTHON_CONFIG], -[AC_SUBST([BOOST_PYTHON_$1], - [`python-config --$2 2>/dev/null`])dnl -boost_python_save_$1=$$1 -$1="$$1 $BOOST_PYTHON_$1"]) - - -# BOOST_PYTHON([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# -------------------------------- -# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, -# see the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Python], -[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) -_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) -_BOOST_PYTHON_CONFIG([LIBS], [libs]) -m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl -BOOST_FIND_LIBS([python], [python python3], [$1], - [boost/python.hpp], - [], [BOOST_PYTHON_MODULE(empty) {}], [], [$2]) -CPPFLAGS=$boost_python_save_CPPFLAGS -LDFLAGS=$boost_python_save_LDFLAGS -LIBS=$boost_python_save_LIBS -])# BOOST_PYTHON - - -# BOOST_REF() -# ----------- -# Look for Boost.Ref -BOOST_DEFUN([Ref], -[BOOST_FIND_HEADER([boost/ref.hpp])]) - - -# BOOST_REGEX([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------- -# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Regex], -[BOOST_FIND_LIB([regex], [$1], - [boost/regex.hpp], - [boost::regex exp("*"); boost::regex_match("foo", exp);], - [], [], [$2]) -])# BOOST_REGEX - - -# BOOST_SCOPE_EXIT() -# ------------ -# Look for Boost.ScopeExit. -BOOST_DEFUN([SCOPE_EXIT], -[BOOST_FIND_HEADER([boost/scope_exit.hpp])]) - - -# BOOST_SERIALIZATION([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# --------------------------------------- -# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see -# the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Serialization], -[BOOST_FIND_LIB([serialization], [$1], - [boost/archive/text_oarchive.hpp], - [std::ostream* o = 0; // Cheap way to get an ostream... - boost::archive::text_oarchive t(*o);], - [], [], [$2]) -])# BOOST_SERIALIZATION - - -# BOOST_SIGNALS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# --------------------------------- -# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Signals], -[BOOST_FIND_LIB([signals], [$1], - [boost/signal.hpp], - [boost::signal s;], - [], [], [$2]) -])# BOOST_SIGNALS - - -# BOOST_SIGNALS2() -# ---------------- -# Look for Boost.Signals2 (new since 1.39.0). -BOOST_DEFUN([Signals2], -[BOOST_FIND_HEADER([boost/signals2.hpp]) -])# BOOST_SIGNALS2 - - -# BOOST_SMART_PTR() -# ----------------- -# Look for Boost.SmartPtr -BOOST_DEFUN([Smart_Ptr], -[BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) -BOOST_FIND_HEADER([boost/shared_ptr.hpp]) -]) - - -# BOOST_STATICASSERT() -# -------------------- -# Look for Boost.StaticAssert -BOOST_DEFUN([StaticAssert], -[BOOST_FIND_HEADER([boost/static_assert.hpp])]) - - -# BOOST_STRING_ALGO() -# ------------------- -# Look for Boost.StringAlgo -BOOST_DEFUN([String_Algo], -[BOOST_FIND_HEADER([boost/algorithm/string.hpp]) -]) - - -# BOOST_SYSTEM([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# -------------------------------- -# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. This library was introduced in Boost -# 1.35.0. -BOOST_DEFUN([System], -[BOOST_FIND_LIB([system], [$1], - [boost/system/error_code.hpp], - [boost::system::error_code e; e.clear();], [], [], [$2]) -])# BOOST_SYSTEM - - -# BOOST_TEST([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------ -# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Test], -[m4_pattern_allow([^BOOST_CHECK$])dnl -BOOST_FIND_LIB([unit_test_framework], [$1], - [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], - [using boost::unit_test::test_suite; - test_suite* init_unit_test_suite(int argc, char ** argv) - { return NULL; }], [], [$2]) -])# BOOST_TEST - - -# BOOST_THREAD([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# --------------------------------- -# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Thread], -[dnl Having the pthread flag is required at least on GCC3 where -dnl boost/thread.hpp would complain if we try to compile without -dnl -pthread on GNU/Linux. -AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl -boost_thread_save_LIBS=$LIBS -boost_thread_save_LDFLAGS=$LDFLAGS -boost_thread_save_CPPFLAGS=$CPPFLAGS -# Link-time dependency from thread to system was added as of 1.49.0. -if test $boost_major_version -ge 149; then -BOOST_SYSTEM([$1], [$2]) -fi # end of the Boost.System check. -m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" - -# When compiling for the Windows platform, the threads library is named -# differently. This suffix doesn't exist in new versions of Boost, or -# possibly new versions of GCC on mingw I am assuming it's Boost's change for -# now and I am setting version to 1.48, for lack of knowledge as to when this -# change occurred. -if test $boost_major_version -lt 148; then - case $host_os in - (*mingw*) boost_thread_lib_ext=_win32;; - esac -fi -BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext], - [$1], - [boost/thread.hpp], [boost::thread t; boost::mutex m;], [], [], [$2]) - -case $host_os in - (*mingw*) boost_thread_w32_socket_link=-lws2_32;; -esac - -BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link" -BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" -BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" -LIBS=$boost_thread_save_LIBS -LDFLAGS=$boost_thread_save_LDFLAGS -CPPFLAGS=$boost_thread_save_CPPFLAGS -])# BOOST_THREAD - -AU_ALIAS([BOOST_THREADS], [BOOST_THREAD]) - - -# BOOST_TOKENIZER() -# ----------------- -# Look for Boost.Tokenizer -BOOST_DEFUN([Tokenizer], -[BOOST_FIND_HEADER([boost/tokenizer.hpp])]) - - -# BOOST_TRIBOOL() -# --------------- -# Look for Boost.Tribool -BOOST_DEFUN([Tribool], -[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) -BOOST_FIND_HEADER([boost/logic/tribool.hpp]) -]) - - -# BOOST_TUPLE() -# ------------- -# Look for Boost.Tuple -BOOST_DEFUN([Tuple], -[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) - - -# BOOST_TYPETRAITS() -# -------------------- -# Look for Boost.TypeTraits -BOOST_DEFUN([TypeTraits], -[BOOST_FIND_HEADER([boost/type_traits.hpp])]) - - -# BOOST_UTILITY() -# --------------- -# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, -# etc.) -BOOST_DEFUN([Utility], -[BOOST_FIND_HEADER([boost/utility.hpp])]) - - -# BOOST_VARIANT() -# --------------- -# Look for Boost.Variant. -BOOST_DEFUN([Variant], -[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) -BOOST_FIND_HEADER([boost/variant.hpp])]) - - -# BOOST_POINTER_CONTAINER() -# ------------------------ -# Look for Boost.PointerContainer -BOOST_DEFUN([Pointer_Container], -[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) -])# BOOST_POINTER_CONTAINER - - -# BOOST_WAVE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) -# ------------------------------ -# NOTE: If you intend to use Wave/Spirit with thread support, make sure you -# call BOOST_THREAD first. -# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Wave], -[AC_REQUIRE([BOOST_FILESYSTEM])dnl -AC_REQUIRE([BOOST_DATE_TIME])dnl -boost_wave_save_LIBS=$LIBS -boost_wave_save_LDFLAGS=$LDFLAGS -m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ -$BOOST_THREAD_LIBS" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ -$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" -BOOST_FIND_LIB([wave], [$1], - [boost/wave.hpp], - [boost::wave::token_id id; get_token_name(id);], [], [], [$2]) -LIBS=$boost_wave_save_LIBS -LDFLAGS=$boost_wave_save_LDFLAGS -])# BOOST_WAVE - - -# BOOST_XPRESSIVE() -# ----------------- -# Look for Boost.Xpressive (new since 1.36.0). -BOOST_DEFUN([Xpressive], -[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) - - -# ----------------- # -# Internal helpers. # -# ----------------- # - - -# _BOOST_PTHREAD_FLAG() -# --------------------- -# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag -# which must be used in CPPFLAGS and LIBS. -# -# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, -# boost/thread.hpp will trigger a #error if -pthread isn't used: -# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support -# is not turned on. Please set the correct command line options for -# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" -# -# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html -AC_DEFUN([_BOOST_PTHREAD_FLAG], -[AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_LANG_PUSH([C++])dnl -AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], -[ boost_cv_pthread_flag= - # The ordering *is* (sometimes) important. Some notes on the - # individual items follow: - # (none): in case threads are in libc; should be tried before -Kthread and - # other compiler flags to prevent continual compiler warnings - # -lpthreads: AIX (must check this before -lpthread) - # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) - # -pthreads: Solaris/GCC - # -mthreads: MinGW32/GCC, Lynx/GCC - # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it - # doesn't hurt to check since this sometimes defines pthreads too; - # also defines -D_REENTRANT) - # ... -mt is also the pthreads flag for HP/aCC - # -lpthread: GNU Linux, etc. - # --thread-safe: KAI C++ - case $host_os in #( - *solaris*) - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( - *) - boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ - -pthreads -mthreads -lpthread --thread-safe -mt";; - esac - # Generate the test file. - AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include ], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) - for boost_pthread_flag in '' $boost_pthread_flags; do - boost_pthread_ok=false -dnl Re-use the test file already generated. - boost_pthreads__save_LIBS=$LIBS - LIBS="$LIBS $boost_pthread_flag" - AC_LINK_IFELSE([], - [if grep ".*$boost_pthread_flag" conftest.err; then - echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD - else - boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag - fi]) - LIBS=$boost_pthreads__save_LIBS - $boost_pthread_ok && break - done -]) -AC_LANG_POP([C++])dnl -])# _BOOST_PTHREAD_FLAG - - -# _BOOST_gcc_test(MAJOR, MINOR) -# ----------------------------- -# Internal helper for _BOOST_FIND_COMPILER_TAG. -m4_define([_BOOST_gcc_test], -["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl - -# _BOOST_mingw_test(MAJOR, MINOR) -# ----------------------------- -# Internal helper for _BOOST_FIND_COMPILER_TAG. -m4_define([_BOOST_mingw_test], -["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \ - (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ - || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl - - -# _BOOST_FIND_COMPILER_TAG() -# -------------------------- -# Internal. When Boost is installed without --layout=system, each library -# filename will hold a suffix that encodes the compiler used during the -# build. The Boost build system seems to call this a `tag'. -AC_DEFUN([_BOOST_FIND_COMPILER_TAG], -[AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], - [boost_cv_lib_tag], -[boost_cv_lib_tag=unknown -if test x$boost_cv_inc_path != xno; then - AC_LANG_PUSH([C++])dnl - # The following tests are mostly inspired by boost/config/auto_link.hpp - # The list is sorted to most recent/common to oldest compiler (in order - # to increase the likelihood of finding the right compiler with the - # least number of compilation attempt). - # Beware that some tests are sensible to the order (for instance, we must - # look for MinGW before looking for GCC3). - # I used one compilation test per compiler with a #error to recognize - # each compiler so that it works even when cross-compiling (let me know - # if you know a better approach). - # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): - # como, edg, kcc, bck, mp, sw, tru, xlc - # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines - # the same defines as GCC's). - for i in \ - "defined __clang__ && __clang_major__ == 8 && __clang_minor__ == 0 @ clang80" \ - "defined __clang__ && __clang_major__ == 7 && __clang_minor__ == 0 @ clang70" \ - "defined __clang__ && __clang_major__ == 6 && __clang_minor__ == 0 @ clang60" \ - "defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 @ clang50" \ - "defined __clang__ && __clang_major__ == 4 && __clang_minor__ == 0 @ clang40" \ - "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 9 @ clang39" \ - "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 8 @ clang38" \ - "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 7 @ clang37" \ - _BOOST_mingw_test(9, 1) \ - _BOOST_gcc_test(9, 1) \ - _BOOST_mingw_test(9, 0) \ - _BOOST_gcc_test(9, 0) \ - _BOOST_mingw_test(8, 3) \ - _BOOST_gcc_test(8, 3) \ - _BOOST_mingw_test(8, 2) \ - _BOOST_gcc_test(8, 2) \ - _BOOST_mingw_test(8, 1) \ - _BOOST_gcc_test(8, 1) \ - _BOOST_mingw_test(8, 0) \ - _BOOST_gcc_test(8, 0) \ - _BOOST_mingw_test(7, 3) \ - _BOOST_gcc_test(7, 3) \ - _BOOST_mingw_test(7, 2) \ - _BOOST_gcc_test(7, 2) \ - _BOOST_mingw_test(7, 1) \ - _BOOST_gcc_test(7, 1) \ - _BOOST_mingw_test(7, 0) \ - _BOOST_gcc_test(7, 0) \ - _BOOST_mingw_test(6, 4) \ - _BOOST_gcc_test(6, 4) \ - _BOOST_mingw_test(6, 3) \ - _BOOST_gcc_test(6, 3) \ - _BOOST_mingw_test(6, 2) \ - _BOOST_gcc_test(6, 2) \ - _BOOST_mingw_test(6, 1) \ - _BOOST_gcc_test(6, 1) \ - _BOOST_mingw_test(6, 0) \ - _BOOST_gcc_test(6, 0) \ - _BOOST_mingw_test(5, 5) \ - _BOOST_gcc_test(5, 5) \ - _BOOST_mingw_test(5, 4) \ - _BOOST_gcc_test(5, 4) \ - _BOOST_mingw_test(5, 3) \ - _BOOST_gcc_test(5, 3) \ - _BOOST_mingw_test(5, 2) \ - _BOOST_gcc_test(5, 2) \ - _BOOST_mingw_test(5, 1) \ - _BOOST_gcc_test(5, 1) \ - _BOOST_mingw_test(5, 0) \ - _BOOST_gcc_test(5, 0) \ - _BOOST_mingw_test(4, 10) \ - _BOOST_gcc_test(4, 10) \ - _BOOST_mingw_test(4, 9) \ - _BOOST_gcc_test(4, 9) \ - _BOOST_mingw_test(4, 8) \ - _BOOST_gcc_test(4, 8) \ - _BOOST_mingw_test(4, 7) \ - _BOOST_gcc_test(4, 7) \ - _BOOST_mingw_test(4, 6) \ - _BOOST_gcc_test(4, 6) \ - _BOOST_mingw_test(4, 5) \ - _BOOST_gcc_test(4, 5) \ - _BOOST_mingw_test(4, 4) \ - _BOOST_gcc_test(4, 4) \ - _BOOST_mingw_test(4, 3) \ - _BOOST_gcc_test(4, 3) \ - _BOOST_mingw_test(4, 2) \ - _BOOST_gcc_test(4, 2) \ - _BOOST_mingw_test(4, 1) \ - _BOOST_gcc_test(4, 1) \ - _BOOST_mingw_test(4, 0) \ - _BOOST_gcc_test(4, 0) \ - "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ - && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ - || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ - _BOOST_gcc_test(3, 4) \ - _BOOST_gcc_test(3, 3) \ - "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ - "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ - _BOOST_gcc_test(3, 2) \ - "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ - _BOOST_gcc_test(3, 1) \ - _BOOST_gcc_test(3, 0) \ - "defined __BORLANDC__ @ bcb" \ - "defined __ICC && (defined __unix || defined __unix__) @ il" \ - "defined __ICL @ iw" \ - "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ - _BOOST_gcc_test(2, 95) \ - "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ - "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ - "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ - "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" - do - boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` - boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if $boost_tag_test -/* OK */ -#else -# error $boost_tag_test -#endif -]])], [boost_cv_lib_tag=$boost_tag; break], []) - done -AC_LANG_POP([C++])dnl - case $boost_cv_lib_tag in #( - # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed - # to "gcc41" for instance. - *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. - gcc*) - boost_tag_x= - case $host_os in #( - darwin*) - if test $boost_major_version -ge 136; then - # The `x' added in r46793 of Boost. - boost_tag_x=x - fi;; - esac - # We can specify multiple tags in this variable because it's used by - # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... - boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" - ;; #( - unknown) - AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) - boost_cv_lib_tag= - ;; - esac -fi])dnl end of AC_CACHE_CHECK -])# _BOOST_FIND_COMPILER_TAG - - -# _BOOST_GUESS_WHETHER_TO_USE_MT() -# -------------------------------- -# Compile a small test to try to guess whether we should favor MT (Multi -# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. -AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], -[# Check whether we do better use `mt' even though we weren't ask to. -AC_LANG_PUSH([C++])dnl -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if defined _REENTRANT || defined _MT || defined __MT__ -/* use -mt */ -#else -# error MT not needed -#endif -]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) -AC_LANG_POP([C++])dnl -]) - -# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# ------------------------------------------------------------------- -# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, -# will break when Autoconf changes its internals. Requires that you manually -# rm -f conftest.$ac_objext in between to really different tests, otherwise -# you will try to link a conftest.o left behind by a previous test. -# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this -# macro). -# -# Don't use "break" in the actions, as it would short-circuit some code -# this macro runs after the actions. -m4_define([_BOOST_AC_LINK_IFELSE], -[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl -rm -f conftest$ac_exeext -boost_save_ac_ext=$ac_ext -boost_use_source=: -# If we already have a .o, re-use it. We change $ac_ext so that $ac_link -# tries to link the existing object file instead of compiling from source. -test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && - _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) -AS_IF([_AC_DO_STDERR($ac_link) && { - test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_executable_p conftest$ac_exeext -dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. - }], - [$2], - [if $boost_use_source; then - _AC_MSG_LOG_CONFTEST - fi - $3]) -ac_objext=$boost_save_ac_objext -ac_ext=$boost_save_ac_ext -dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) -dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), -dnl as it would interfere with the next link command. -rm -f core conftest.err conftest_ipa8_conftest.oo \ - conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl -])# _BOOST_AC_LINK_IFELSE - -# Local Variables: -# mode: autoconf -# End: diff --git a/m4/require-header.m4 b/m4/require-header.m4 deleted file mode 100644 index bebaf36..0000000 --- a/m4/require-header.m4 +++ /dev/null @@ -1,7 +0,0 @@ - -AC_DEFUN([AC_REQUIRE_HEADER], [dnl - AC_CHECK_HEADERS([$1], dnl - [], dnl -dnl[AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1])], dnl - [AC_MSG_ERROR([cannot find $1])]) -]) diff --git a/macos-homebrew.env b/macos-homebrew.env deleted file mode 100644 index 46ddbf5..0000000 --- a/macos-homebrew.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/false - -PATH="/usr/local/opt/qt@5/bin/:${PATH}" -PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig/:${PKG_CONFIG_PATH}" - -export PATH -export PKG_CONFIG_PATH diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh deleted file mode 100755 index 15a8ca2..0000000 --- a/scripts/bootstrap.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# Determine the project root no matter if you call this from the symlink or scripts/ directory -PROGRAM="basename ${0}" -if [ -n "`readlink $0`" ]; then - BASE_DIR="`cd "$(dirname "$0")"; pwd`"; -else - BASE_DIR="`cd "$(dirname "$0")"; pwd`/.."; - BASE_DIR="`readlink -f ${BASE_DIR}`" -fi - -cd "${BASE_DIR}" - -die() -{ - rc=${2:-255} - echo "Error: ${1}" - - exit ${rc} -} - -cmdecho() -{ - need_to_die=1 - - if [ "${1}" == "--optional" ] || [ "${1}" == "-o" ]; then - echo "optional" - need_to_die=0 - shift; - fi - - - echo "$ ${@}" - if [ ${need_to_die} -ne 0 ]; then - ${@} || die "${1} returned error code ${?}" - else - ${@} - fi - - #return ${?} -} - -cmdecho git config -f .gitmodules submodule.third_party/Catch2.shallow true -cmdecho git config -f .gitmodules submodule.third_party/FakeIt.shallow true - -cmdecho -o git submodule update --init --recursive - - -if [ ${?} -ne 0 ]; then - cmdecho rm -rf third_party/Catch2 - cmdecho rm -rf third_party/FakeIt - - cmdecho git submodule update --init --recursive -fi - -if [ "x$1" == "x-f" ] || [ ! -x ./configure ]; then - cmdecho autoreconf -iv -fi -if [ ! -x ./configure ]; then - die "./configure does not exist. Check configure.ac and the autotools!" -fi - -cmdecho sh scripts/rebuild-qtforms.sh - -cd $OLDPWD diff --git a/scripts/rebuild-qtforms.sh b/scripts/rebuild-qtforms.sh deleted file mode 100755 index dda1fb4..0000000 --- a/scripts/rebuild-qtforms.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -BASE_DIR="$(cd "$(dirname "$0")"; pwd)/.."; -BASE_DIR="$(readlink -f ${BASE_DIR})" - -UIC_CMD="uic-qt5" -MOC_CMD="mod-qt5" - - -die() { - echo "An error has occured. Stopping" - return 1 -} - -cmdecho() { - echo "$@" - $@ -} - -error() { - echo "$@" >&2 -} - -detect_qt_tools() { - if [ -x "`which uic`" ] ; then - UIC_CMD="uic" - else - echo "could not detect a binary named 'uic'" - fi - - if [ -x "`which moc`" ] ; then - MOC_CMD="moc" - else - echo "could not detect a binary named 'moc'" - fi -} - -detect_qt_tools - - -if [ -z $UIC_CMD ] || [ ! -x $UIC_CMD ] && [ ! -x $(which $UIC_CMD) ];then - error "The selected uic compiler either does not exist, or is not executable" - error - error "Could not build QT forms without uic!" - error "(This is only needed for the game editors.)" - - exit 0 -fi - -if [ -z $MOC_CMD ] || [ ! -x $MOC_CMD ] && [ ! -x $(which $MOC_CMD) ];then - error "The selected moc compiler either does not exist, or is not executable" - error - error "Could not build QT forms without moc!" - error "(This is only needed for the game editors.)" - - exit 0 -fi - -cd ${BASE_DIR} -echo "Searching for *.ui files in source..." -UI_FILES="$(find src -iname '*.ui')" - -for uifile in $UI_FILES; do - cmdecho ${UIC_CMD} ${uifile} -o ${uifile}.hpp -done - diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 688c453..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -include src/framework/Makefile.am -include src/tests/Makefile.am -include src/game/Makefile.am -include src/editors/Makefile.am diff --git a/src/editors/Makefile.am b/src/editors/Makefile.am deleted file mode 100644 index 2e850a5..0000000 --- a/src/editors/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ - - -BUILT_SOURCES= # Needed to include QT .ui.hpp files in the build dependency trees. - -editor_common_libs=$(QT_LIBS) $(SDL2_LIBS) $(NLOHMANN_JSON_LIBS) - -include src/editors/object-editor/Makefile.am diff --git a/src/editors/object-editor/EntityEditor.cpp b/src/editors/object-editor/EntityEditor.cpp index cb87501..887ddc2 100644 --- a/src/editors/object-editor/EntityEditor.cpp +++ b/src/editors/object-editor/EntityEditor.cpp @@ -21,12 +21,13 @@ #include "EntityEditor.hpp" #include "ui_EntityEditor.h" -#include "src/game/ComponentStore.hpp" +#include "framework/core/components/EntityManager.hpp" using nlohmann::json; -using QW::GameEngine::ComponentStore; -static ComponentStore* components = nullptr; +using namespace QW::Core::Components; + +static EntityManager* components = &(EntityManager::GetInstance()); EntityEditor::EntityEditor(QWidget* parent, const QString& filepath) : QWidget(parent) @@ -34,10 +35,6 @@ EntityEditor::EntityEditor(QWidget* parent, const QString& filepath) , available_components(this) , ui(*(new Ui::EntityEditor())) { - if (!components) { - components = &(ComponentStore::GetInstance()); - } - ui.setupUi(this); for (auto& type : components->GetRegisteredTypes()) { diff --git a/src/framework/Makefile.am b/src/framework/Makefile.am deleted file mode 100644 index 8b2f736..0000000 --- a/src/framework/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ - -pkglib_LTLIBRARIES+=libframework-core.la -noinst_LTLIBRARIES+=libframework-core-test.la - -engine_source_files= -engine_source_files+=src/framework/core/Observable.cpp -engine_source_files+=src/framework/core/components/Entity.cpp -engine_source_files+=src/framework/core/components/EntityManager.cpp - -engine_source_files+=src/framework/core/components/PlayerBehavior.cpp -engine_source_files+=src/framework/core/components/PositionAttribute.cpp -engine_source_files+=src/framework/core/input/EventDispatcher.cpp - -libframework_core_la_SOURCES= $(engine_source_files) -libframework_core_test_la_SOURCES= $(engine_source_files) - - -libframework_core_la_CXXFLAGS=$(AM_CXXFLAGS) -libframework_core_la_CXXFLAGS+=$(SDL2_CFLAGS) - -libframework_core_test_la_CXXFLAGS=$(AM_CXXFLAGS) -libframework_core_test_la_CXXFLAGS+=$(SDL2_CFLAGS) - -libframework_core_test_la_CPPFLAGS=$(AM_CPPFLAGS) -DUNIT_TEST=1_ - -libframework_core_la_LIBADD=${NLOHMANN_JSON_LIBS} -libframework_core_test_la_LIBADD=${NLOHMANN_JSON_LIBS} - -include_HEADERS+=${srcdir}/src/framework/framework.hpp - -include src/framework/system/Makefile.am diff --git a/src/framework/core/components/PhysicalProperties.hpp b/src/framework/core/components/PhysicalProperties.hpp index 221a697..2884060 100644 --- a/src/framework/core/components/PhysicalProperties.hpp +++ b/src/framework/core/components/PhysicalProperties.hpp @@ -31,8 +31,8 @@ class PhysicalProperties PhysicalProperties(InstanceId id) : BaseComponent(id), velocity(), position(nullptr) { - static auto& components = EntityManager::GetInstance(); - position = &(components.GetComponent(id)); + static auto& entities = EntityManager::GetInstance(); + position = &(entities.GetComponent(id)); } virtual ~PhysicalProperties() = default; diff --git a/src/framework/core/components/PlayerBehavior.cpp b/src/framework/core/components/PlayerBehavior.cpp index dac4b7d..045fa5b 100644 --- a/src/framework/core/components/PlayerBehavior.cpp +++ b/src/framework/core/components/PlayerBehavior.cpp @@ -38,8 +38,7 @@ using nlohmann::json; using namespace QW::Core; using error_flag = IBehavior::error_flag; -static GameEngine::ComponentStore& entities = - GameEngine::ComponentStore::GetInstance(); +static auto& entities = EntityManager::GetInstance(); PlayerBehavior::PlayerBehavior(InstanceId id) : IBehavior() @@ -184,7 +183,6 @@ PlayerBehavior::to_json(json& json_object) const void PlayerBehavior::from_json(const json& json_object) { - static auto& entities = GameEngine::ComponentStore::GetInstance(); Metadata metadata = json_object["metadata"].get(); if (metadata != this->component_info) { diff --git a/src/framework/system/Makefile.am b/src/framework/system/Makefile.am deleted file mode 100644 index 1eecd68..0000000 --- a/src/framework/system/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -pkglib_LTLIBRARIES+=libframework-system.la - -libframework_system_la_SOURCES= -libframework_system_la_SOURCES+=src/framework/system/sdl.cpp - -libframework_system_la_CXXFLAGS= -libframework_system_la_CXXFLAGS+=$(SDL2_CFLAGS) - -libframework_system_la_LIBADD= -libframework_system_la_LIBADD+=$(SDL2_LIBS) - - diff --git a/src/framework/system/debuginfo.hpp b/src/framework/system/debuginfo.hpp index db1dd2d..2d95451 100644 --- a/src/framework/system/debuginfo.hpp +++ b/src/framework/system/debuginfo.hpp @@ -10,8 +10,13 @@ // #include "config.h" #include "framework/core/types.hpp" +#include "framework/system/platform.hpp" + +#if defined(HAVE_EXECINFO_H) +#if defined(__clang__) +#include +#endif -#ifdef HAVE_EXECINFO_H #include #else #include @@ -20,6 +25,7 @@ #include #include +using QW::Core::Platform; using namespace QW::Core::Types; #ifdef QW_DEBUG // #region @@ -29,24 +35,105 @@ using namespace QW::Core::Types; #define debugprint(msg) ; #endif // #endregion +// Extracts the mangled symbol from a string like inline std::string -generate_stacktrace() +extract_mangled_symbol(const std::string& input) +{ + std::string result; + bool insideAngleBrackets = false; + + for (char c : input) { + if (c == '<') { + insideAngleBrackets = true; + continue; + } + if (c == '>') { + insideAngleBrackets = false; + continue; + } + if (c == '+') { + break; + } + + if (insideAngleBrackets) { + result += c; + } + }; + + return result; +} + +// There are a lot of C and platform-specific hacks contained within +// I am sorry. 🤡 +inline std::string +generate_stacktrace(short framesToRemove = -1) { std::stringstream buffer; -#ifdef HAVE_EXECINFO_H +#ifndef BOOST_STACKTRACER void* callstack[128]; - int i, frames = backtrace(callstack, 128); char** strs = backtrace_symbols(callstack, frames); - for (i = 0; i < frames; ++i) { - buffer << strs[i] << std::endl; + + size_t columns_to_print = 0; + + // preconfigure column length for certain platforms + if (Platform::FREEBSD) { + columns_to_print = 2; + } else if (Platform::MACOS) { + columns_to_print = 4; } - free(strs); -#else + + if (framesToRemove == frames || framesToRemove < 0) { + framesToRemove = 0; + } + + for (i = framesToRemove; i < frames; ++i) { + std::string word; + std::stringstream line_stream(strs[i]); + std::vector wordlist; + + // Create a list of words for this stack trace line + while (line_stream >> word) { + if (columns_to_print != 0 && + (word.find('<') != word.npos && + word.find('>') != word.npos)) { + auto extracted_symbol = + extract_mangled_symbol(word); + word = extracted_symbol; + } + wordlist.push_back(word); + } + // if columns_to_print is still 0, assign it to the list length + // It is only pre-configured for certain platforms, see above + if (!columns_to_print) { + columns_to_print = wordlist.size(); + } + // Process the extracted words one at a time and format the + // stack trace string + for (unsigned pos = 0; pos < columns_to_print; ++pos) { + auto word = wordlist[pos]; + int status; + + char* demangled_symbol = abi::__cxa_demangle( + word.c_str(), nullptr, nullptr, &status + ); + + if (status == 0) { + buffer << demangled_symbol << '\t'; + std::free(demangled_symbol); + } else { + buffer << word << '\t'; + } + } + buffer << std::endl; + } + std::free(strs); +#else /*@{*/ buffer << boost::stacktrace::stacktrace() << std::flush; -#endif +#endif /*@}*/ return buffer.str(); } + inline void print_backtrace() { @@ -72,4 +159,4 @@ print_cmdline(int argc, const c_string argv[]) } // clang-format off -// vim: set foldmethod=marker foldmarker=#region,#endregion textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen : +// vim: set foldmethod=marker foldmarker=@{,@} textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen : diff --git a/src/framework/system/platform.hpp b/src/framework/system/platform.hpp new file mode 100644 index 0000000..a6461a9 --- /dev/null +++ b/src/framework/system/platform.hpp @@ -0,0 +1,43 @@ +/* platform.hpp + * Copyright © 2023 Saul D. Beniquez + * License: Mozilla Public License v. 2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v.2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at https://mozilla.org/MPL/2.0/. + */ +#pragma once + +namespace QW::Core { + +struct Platform { +#ifdef __linux__ + static constexpr bool LINUX = true; +#else + static constexpr bool LINUX = false; +#endif + +#ifdef _WIN32 + static constexpr bool WINDOWS = true; +#else + static constexpr bool WINDOWS = false; +#endif + +#ifdef __APPLE__ + static constexpr bool MACOS = true; +#else + static constexpr bool MACOS = false; +#endif + +#ifdef __FreeBSD__ + static constexpr bool FREEBSD = true; +#else + static constexpr bool FREEBSD = false; +#endif + + // I don't own any AIX, Solaris, HP-UX, or pure Darwin systems, sorry :) +}; +} + +// clang-format off +// vim: set foldmethod=marker foldmarker=#region,#endregion textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen : diff --git a/src/game/ComponentStore.hpp b/src/game/ComponentStore.hpp index 3891abe..ef67391 100644 --- a/src/game/ComponentStore.hpp +++ b/src/game/ComponentStore.hpp @@ -23,7 +23,7 @@ using namespace QW::Core::Components; namespace QW::GameEngine { -class ComponentStore : public EntityManager { +class ComponentStore { public: static ComponentStore& GetInstance() { @@ -32,14 +32,14 @@ class ComponentStore : public EntityManager { return instance; } - static void Init() + void Init() { - auto& instance = GetInstance(); + auto& instance = EntityManager::GetInstance(); - instance.RegisterPool(instance.positions); - instance.RegisterPool(instance.properties); - instance.RegisterPool(instance.views); - instance.RegisterPool(instance.players); + instance.RegisterPool(this->positions); + instance.RegisterPool(this->properties); + instance.RegisterPool(this->views); + instance.RegisterPool(this->players); } ComponentDictionary positions; @@ -48,10 +48,7 @@ class ComponentStore : public EntityManager { ComponentDictionary properties; protected: - ComponentStore() - : EntityManager(), positions(), players(), views(), properties() - { - } + ComponentStore() : positions(), players(), views(), properties() {} }; } diff --git a/src/game/Makefile.am b/src/game/Makefile.am deleted file mode 100644 index ea6c6f9..0000000 --- a/src/game/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -bin_PROGRAMS+= quartz-warriors - -quartz_warriors_SOURCES= -quartz_warriors_SOURCES+=src/game/main.cpp -quartz_warriors_SOURCES+=src/game/QuartzWarriors.cpp - -quartz_warriors_CPPFLAGS= -quartz_warriors_CPPFLAGS+= $(AM_CPPFLAGS) -quartz_warriors_CPPFLAGS+= $(project_include_flags) -quartz_warriors_CPPFLAGS+= $(SDL2_CFLAGS) - -quartz_warriors_LDADD= -quartz_warriors_LDADD+= libframework-core.la libframework-system.la -quartz_warriors_LDADD+= $(NLOHMANN_JSON_LIBS) -#quartz_warriors_LDADD+= $(SDL2_LIBS) #not needed, libframework-system provides SDL linkage - diff --git a/src/game/QuartzWarriors.cpp b/src/game/QuartzWarriors.cpp index 7629457..f5fb480 100644 --- a/src/game/QuartzWarriors.cpp +++ b/src/game/QuartzWarriors.cpp @@ -35,6 +35,7 @@ QuartzWarriors::QuartzWarriors() , is_running(false) , ticks(0) , component_pools(ComponentStore::GetInstance()) + , entity_manager(EntityManager::GetInstance()) { this->renderer = System::Video::new_renderer(); @@ -55,13 +56,13 @@ QuartzWarriors::Init(int argc, char* argv[]) // Initialize player 1's data structs component_pools.views.emplace(playerId, playerId); component_pools.positions.emplace(playerId, playerId); - component_pools.players.emplace(playerId, playerId); component_pools.properties.emplace(playerId, playerId); + component_pools.players.emplace(playerId, playerId); this->is_running = true; auto& player_behavior = - component_pools.GetComponent(playerId); + entity_manager.GetComponent(playerId); this->event_dispatcher.RegisterObserver(player_behavior); System::Video::initialize_renderer(this->renderer); @@ -162,14 +163,14 @@ QuartzWarriors::Render() mutex_lock dataLock(data_mutex); auto positionList = - component_pools.AsSequential(); + entity_manager.AsSequential(); for (auto& position : positionList) { auto& viewMetadata = position.GetMetadata(); InstanceId id = viewMetadata.instance.id; RenderedCircle& view = - component_pools.GetComponent(id); + entity_manager.GetComponent(id); view.Draw(this->renderer, position); } diff --git a/src/game/QuartzWarriors.hpp b/src/game/QuartzWarriors.hpp index 901d66d..93766c2 100644 --- a/src/game/QuartzWarriors.hpp +++ b/src/game/QuartzWarriors.hpp @@ -54,6 +54,8 @@ class QuartzWarriors : public Core::IGame { System::Video::rendering_ctx renderer; QW::GameEngine::ComponentStore& component_pools; std::mutex data_mutex; + + EntityManager& entity_manager; }; } diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am deleted file mode 100644 index 3c05147..0000000 --- a/src/tests/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# src/tests/Makefile.am -# Copyright © 2022 Saul D. Beniquez -# License: MPL2 - -check_PROGRAMS+=game-tests -TESTS+=$(check_PROGRAMS) - -phony_targets+=tests -tests: $(check_PROGRAMS) - -thirdparty_library_includes=-I ${srcdir}/third_party/FakeIt/include -thirdparty_library_includes+=-I ${srcdir}/third_party/FakeIt/config/catch - -#test_disabled_warnings=-Wno-deprecated-declarations -Wno-defaulted-function-deleted\ -# -Wno-zero-length-array - -tests_addl_cppflags= -tests_addl_cppflags+= -I ${srcdir}/src/tests -DUNIT_TEST=1 - -tests_addl_cxxflags= -tests_addl_cxxflags+= $(CATCH2_CFLAGS) $(SDL2_CFLAGS) -tests_addl_cxxflags+= $(thirdparty_library_includes) - -game_tests_CPPFLAGS= $(AM_CPPFLAGS) $(PROJECT_INCLUDE_FLAGS) -game_tests_CPPFLAGS+= $(tests_addl_cppflags) -game_tests_CPPFLAGS+= -DUNIT_TEST=1 - -game_tests_CXXFLAGS= -game_tests_CXXFLAGS+=${AM_CXXFLAGS} -game_tests_CXXFLAGS+= $(tests_addl_cxxflags) - -game_tests_LDADD= libframework-core-test.la -game_tests_LDADD+= $(CATCH2_LIBS) $(SDL2_LIBS) $(NLOHMANN_JSON_LIBS) - -game_tests_SOURCES= -game_tests_SOURCES+=src/tests/runtime.tests.cpp - -include src/tests/framework/Makefile.am -# vim: ft=automake : diff --git a/src/tests/framework/Makefile.am b/src/tests/framework/Makefile.am deleted file mode 100644 index ac0bded..0000000 --- a/src/tests/framework/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ - -pwd=src/tests/framework - -core_sources= -core_sources+=$(pwd)/types/adapters/Sequential.test.cpp - -core_sources+=$(pwd)/core/input/EventDispatcher.test.cpp -core_sources+=$(pwd)/core/input/InputMapper.test.cpp - -core_sources+=$(pwd)/core/components/Entity.test.cpp -core_sources+=$(pwd)/core/components/EntityManager.test.cpp -core_sources+=$(pwd)/core/components/PositionAttribute.test.cpp - -game_tests_SOURCES+=${core_sources} diff --git a/third_party/FakeIt b/third_party/FakeIt deleted file mode 160000 index 78ca536..0000000 --- a/third_party/FakeIt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 78ca536e6b32f11e2883d474719a447915e40005