diff --git a/1-install-vcpkg.bat b/1-install-vcpkg.bat index 74e49514501..9047423735b 100644 --- a/1-install-vcpkg.bat +++ b/1-install-vcpkg.bat @@ -1,2 +1,2 @@ set VCPKG_DEFAULT_TRIPLET=x64-windows -.\vcpkg.exe install boost-odeint boost-ublas fftw3 freetype gettext glibmm gtkmm libjpeg-turbo libpng libxmlpp libsigcpp pango sdl2-mixer zlib +.\vcpkg.exe install fftw3 freetype gettext glibmm gtkmm libjpeg-turbo libpng libxmlpp libsigcpp pango sdl2-mixer zlib diff --git a/1-setup-linux-native.sh b/1-setup-linux-native.sh index 9c01a260528..fa9261574e8 100755 --- a/1-setup-linux-native.sh +++ b/1-setup-linux-native.sh @@ -13,7 +13,7 @@ # glibmm (platform depended functions) # mlt++ imagemagick openexr libmng libpng libjpeg (various formats reading functions) # libxml++ libxml2 libxslt (.sif XML reading) -# boost cairo fftw pango (image transformation and rendering functions) +# cairo fftw pango (image transformation and rendering functions) # gtkmm3 (Synfig Studio GUI) # libsig++ (GUI signals and events) # sdl2 sdl2_mixer jack (audio output and synchronization) @@ -83,7 +83,6 @@ if ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID > 22 ]); then automake \ libtool \ libtool-ltdl-devel \ - boost-devel \ shared-mime-info \ OpenEXR-devel \ libmng-devel \ @@ -129,7 +128,6 @@ elif ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID <= 22]); then automake \ libtool \ libtool-ltdl-devel \ - boost-devel \ shared-mime-info \ OpenEXR-devel \ libmng-devel \ @@ -150,7 +148,7 @@ elif ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID <= 22]); then fi elif [ "$ID_LIKE" == "suse opensuse" ]; then - PKG_LIST="git libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel boost-devel shared-mime-info" + PKG_LIST="git libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel shared-mime-info" PKG_LIST="${PKG_LIST} OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm3-devel glibmm2-devel" if ! ( rpm -qv $PKG_LIST ); then @@ -167,7 +165,6 @@ elif [ "$ID_LIKE" == "suse opensuse" ]; then elif [ "$ID_LIKE" == "arch" ]; then PKG_LIST="git \ automake autoconf \ - boost \ cairo \ freetype2 \ fftw \ @@ -230,7 +227,6 @@ elif [ "$ID_LIKE" == "debian" ] || [ "$ID_LIKE" == "ubuntu" ] || [ "$ID_LIKE" == libglibmm-2.4-dev \ libsigc++-2.0-dev \ libxml++2.6-dev \ - libboost-system-dev \ libmagick++-dev \ libxslt-dev python-dev python3-lxml" else diff --git a/1-setup-osx-brew.sh b/1-setup-osx-brew.sh index c44c349cffb..639714051a0 100755 --- a/1-setup-osx-brew.sh +++ b/1-setup-osx-brew.sh @@ -27,7 +27,6 @@ PACKAGES="\ adwaita-icon-theme \ autoconf \ automake \ -boost \ ccache \ cmake \ fftw \ diff --git a/1-setup-windows-msys2.sh b/1-setup-windows-msys2.sh index f73b4c4e379..f9f1ad25380 100755 --- a/1-setup-windows-msys2.sh +++ b/1-setup-windows-msys2.sh @@ -28,7 +28,6 @@ libtool \ make \ patch \ tar \ -$MINGW_PACKAGE_PREFIX-boost \ $MINGW_PACKAGE_PREFIX-ccache \ $MINGW_PACKAGE_PREFIX-cmake \ $MINGW_PACKAGE_PREFIX-dlfcn \ diff --git a/autobuild/build.sh b/autobuild/build.sh index aba7953d845..59e20aca598 100644 --- a/autobuild/build.sh +++ b/autobuild/build.sh @@ -214,13 +214,6 @@ cd synfig-core pushd "${REPO_DIR}/synfig-core/" >/dev/null /bin/bash "${REPO_DIR}/synfig-core/bootstrap.sh" popd >/dev/null -if [ -e /etc/debian_version ] && [ -z "$BOOST_CONFIGURE_OPTIONS" ]; then - # Debian/Ubuntu multiarch - MULTIARCH_LIBDIR="/usr/lib/`uname -m`-linux-gnu/" - if [ -e "${MULTIARCH_LIBDIR}/libboost_program_options.so" ]; then - export BOOST_CONFIGURE_OPTIONS="--with-boost-libdir=$MULTIARCH_LIBDIR" - fi -fi if [[ `uname -o` == "Msys" ]]; then # Currently there is an error when building with Magick++ on MSYS2 export CONFIGURE_OPTIONS="--without-magickpp" @@ -237,14 +230,12 @@ if [[ `uname` == "Darwin" ]]; then # Currently there is an error when building with imagemack on OSX >= High Sierra export CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --without-imagemagick --without-magickpp" fi - export BOOST_CONFIGURE_OPTIONS="--with-boost=$(brew --prefix boost)" fi /bin/bash "${REPO_DIR}/synfig-core/configure" --prefix="${PREFIX}" \ --includedir="${PREFIX}/include" \ --disable-static --enable-shared \ --without-libavcodec \ --without-included-ltdl \ - $BOOST_CONFIGURE_OPTIONS \ $CONFIGURE_OPTIONS \ $DEBUG cd .. diff --git a/autobuild/default-nixpkgs.nix b/autobuild/default-nixpkgs.nix index 9b4c1411ec9..b684af73014 100644 --- a/autobuild/default-nixpkgs.nix +++ b/autobuild/default-nixpkgs.nix @@ -42,14 +42,12 @@ let src = ../synfig-core; configureFlags = [ - "--with-boost=${boost.dev}" - "--with-boost-libdir=${boost.out}/lib" ]; nativeBuildInputs = [ pkgconfig autoreconfHook gettext ]; buildInputs = [ - ETL boost cairo fftw glibmm intltool libjpeg libsigcxx libxmlxx + ETL cairo fftw glibmm intltool libjpeg libsigcxx libxmlxx mlt imagemagick pango which ]; @@ -66,7 +64,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig autoreconfHook gettext ]; buildInputs = [ - ETL boost cairo fftw glibmm gnome3.defaultIconTheme gtk3 gtkmm3 + ETL cairo fftw glibmm gnome3.defaultIconTheme gtk3 gtkmm3 imagemagick intltool libjack2 libsigcxx libxmlxx makeWrapper mlt synfig which ]; diff --git a/autobuild/default.nix b/autobuild/default.nix index 30aba3e9c69..fa3a038ad31 100644 --- a/autobuild/default.nix +++ b/autobuild/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig autoreconfHook gettext gnumake makeWrapper ]; buildInputs = [ - boost cairo ffmpeg fftw intltool glibmm gnome3.defaultIconTheme gtk3 gtkmm3 + cairo ffmpeg fftw intltool glibmm gnome3.defaultIconTheme gtk3 gtkmm3 imagemagick intltool libjpeg libjack2 libsigcxx libxmlxx mlt pango which ]; @@ -36,7 +36,6 @@ stdenv.mkDerivation rec { preConfigure = ""; configureScript = ""; - BOOST_CONFIGURE_OPTIONS = " --with-boost=${boost.dev} --with-boost-libdir=${boost.out}/lib "; ADWAITA_PATH = "${gnome3.adwaita-icon-theme.out}"; MAKE_WRAPPER_PATH = "${makeWrapper.out}"; diff --git a/autobuild/fedora-crosscompile-linux.sh b/autobuild/fedora-crosscompile-linux.sh index d00f164f237..f6aed6f6455 100755 --- a/autobuild/fedora-crosscompile-linux.sh +++ b/autobuild/fedora-crosscompile-linux.sh @@ -76,7 +76,6 @@ GTKGLEXTMM_VERSION=1.2.0 LIBXMLPP_VERSION=2.22.0 GLIBMM_VERSION=2.42.0 CAIRO_VERSION=1.12.18 -BOOST_VERSION=1_53_0 ATK_VERSION=2.14.0 AT_SPI2_VERSION=2.10.2 AT_SPI2_ATK_VERSION=2.10.2 @@ -1425,33 +1424,6 @@ if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then fi } -mkboost() -{ -PKG_NAME=boost -PKG_VERSION="${BOOST_VERSION}" -TAREXT=bz2 -if ! cat ${PREFIX}/include/boost/version.hpp |egrep "BOOST_LIB_VERSION \"${PKG_VERSION%_*}\""; then - #PATH_BAK=$PATH - #PATH="${DEPSPREFIX}/bin-gcc/:$PATH" - #rm -rf ${DEPSPREFIX}/lib/libboost_program_options* || true - #rm -rf ${PREFIX}/lib/libboost_program_options* || true - rsync -av ${SOURCES_URL}/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT} - pushd ${SRCPREFIX} - [ ! -d ${PKG_NAME}_${PKG_VERSION} ] && tar -xjf ${WORKSPACE}/cache/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT} - cd ${PKG_NAME}_${PKG_VERSION} - ./bootstrap.sh --prefix=${PREFIX} \ - --libdir=${PREFIX}/lib \ - --exec-prefix=${PREFIX} \ - --with-libraries=program_options,filesystem,system,chrono - ./b2 - ./b2 install || true - cd .. - popd - #PATH="$PATH_BAK" -fi -#cp ${DEPSPREFIX}/lib/libboost_program_options.so.*.0 ${PREFIX}/lib/ -} - mklibdrm() { PKG_NAME=libdrm @@ -1842,7 +1814,6 @@ make clean || true --sysconfdir=${PREFIX}/etc \ --disable-static --enable-shared \ --with-magickpp --without-libavcodec \ - --with-boost=${PREFIX}/ \ --enable-warnings=minimum \ $DEBUG_OPT make -j${THREADS} @@ -2334,7 +2305,6 @@ mkall() #fi mkmlt mkimagemagick - mkboost mkfftw # synfig-studio deps diff --git a/autobuild/fedora-crosscompile-win.sh b/autobuild/fedora-crosscompile-win.sh index fbe12a0f736..4ec038eda24 100755 --- a/autobuild/fedora-crosscompile-win.sh +++ b/autobuild/fedora-crosscompile-win.sh @@ -95,7 +95,6 @@ if [ ! -z $DEPS ]; then ${TOOLCHAIN}-libxml++ \ ${TOOLCHAIN}-cairo \ ${TOOLCHAIN}-pango \ - ${TOOLCHAIN}-boost \ ${TOOLCHAIN}-libjpeg-turbo \ ${TOOLCHAIN}-gtkmm30 \ ${TOOLCHAIN}-glibmm24 \ @@ -123,10 +122,6 @@ for file in \ iconv.dll \ libatk-\*.dll \ libatkmm-1.6-1.dll \ - libboost_chrono\*.dll \ - libboost_filesystem\*.dll \ - libboost_program_options\*.dll \ - libboost_system\*.dll \ libbz2\*.dll \ libcairo\*.dll \ libdl.dll \ @@ -611,7 +606,7 @@ ${TOOLCHAIN}-configure \ --sysconfdir=${PREFIX}/etc \ --datarootdir=${PREFIX}/share \ --enable-optimization=3 \ ---disable-static --enable-shared --with-magickpp --without-libavcodec --with-boost=/usr/${TOOLCHAIN_HOST}/sys-root/mingw/ --enable-warnings=minimum $DEBUG +--disable-static --enable-shared --with-magickpp --without-libavcodec --enable-warnings=minimum $DEBUG make install -j$THREADS } diff --git a/autobuild/snap-stable/snapcraft.yaml b/autobuild/snap-stable/snapcraft.yaml index 61a2e5810e4..3555fffc18b 100644 --- a/autobuild/snap-stable/snapcraft.yaml +++ b/autobuild/snap-stable/snapcraft.yaml @@ -73,7 +73,6 @@ parts: - libmlt-dev - libmlt++-dev - libmlt-data - - libboost-system-dev - libmng-dev - git stage-packages: diff --git a/autobuild/synfigstudio-cygwin-mingw-build.sh b/autobuild/synfigstudio-cygwin-mingw-build.sh index 0d70c9791c2..f1b3f34b331 100644 --- a/autobuild/synfigstudio-cygwin-mingw-build.sh +++ b/autobuild/synfigstudio-cygwin-mingw-build.sh @@ -953,7 +953,6 @@ rpm -Uhv --force --ignoreos --nodeps yum-utils-1.1.31-18.fc20.noarch.rpm fedora-mingw-install mingw${ARCH}-libxml++ fedora-mingw-install mingw${ARCH}-cairo fedora-mingw-install mingw${ARCH}-pango -fedora-mingw-install mingw${ARCH}-boost fedora-mingw-install mingw${ARCH}-libjpeg-turbo fedora-mingw-install mingw${ARCH}-gtkmm30 fedora-mingw-install mingw${ARCH}-SDL @@ -1010,7 +1009,7 @@ cd $SRCPREFIX/synfig-core --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \ --enable-shared --disable-static \ --with-libiconv-prefix=no --with-libintl-prefix=no \ ---with-magickpp=yes --with-boost=${MINGWPREFIX} \ +--with-magickpp=yes \ --enable-maintainer-mode $DEBUG make -j$THREADS make install @@ -1088,10 +1087,6 @@ for file in \ iconv.dll \ libatk-\*.dll \ libatkmm-1.6-1.dll \ - libboost_chrono\*.dll \ - libboost_filesystem\*.dll \ - libboost_program_options\*.dll \ - libboost_system\*.dll \ libbz2\*.dll \ libcairo\*.dll \ libdl.dll \ diff --git a/autobuild/synfigstudio-cygwin-native-build.sh b/autobuild/synfigstudio-cygwin-native-build.sh index 1e19ccfb7d9..eeb764003a3 100644 --- a/autobuild/synfigstudio-cygwin-native-build.sh +++ b/autobuild/synfigstudio-cygwin-native-build.sh @@ -22,8 +22,6 @@ $CYGWIN_SETUP \ -P pkg-config \ -P libcairo-devel \ -P libpango1.0-devel \ --P libboost-devel \ --P libboost1.50 \ -P libjpeg-devel \ -P libpng-devel \ -P p7zip \ @@ -41,4 +39,4 @@ cd $SRCPREFIX/synfig-core ./bootstrap.sh ./configure --prefix=/usr make -j4 -make install \ No newline at end of file +make install diff --git a/autobuild/synfigstudio-osx-build.sh b/autobuild/synfigstudio-osx-build.sh index 3c26468b694..18ac221a827 100755 --- a/autobuild/synfigstudio-osx-build.sh +++ b/autobuild/synfigstudio-osx-build.sh @@ -262,7 +262,6 @@ mkdeps() openexr \ pkgconfig \ ffmpeg \ - boost \ cairo \ libtool \ libsdl2 \ @@ -308,7 +307,7 @@ mksynfig() if [[ ! $UNIVERSAL == 0 ]]; then export DEPTRACK="--disable-dependency-tracking" fi - /bin/sh ./configure ${DEPTRACK} --prefix=${SYNFIG_PREFIX} --includedir=${SYNFIG_PREFIX}/include --disable-static --enable-shared --with-magickpp --without-libavcodec --with-boost=${MACPORTS} ${DEBUG} + /bin/sh ./configure ${DEPTRACK} --prefix=${SYNFIG_PREFIX} --includedir=${SYNFIG_PREFIX}/include --disable-static --enable-shared --with-magickpp --without-libavcodec ${DEBUG} make -j$JOBS install popd } diff --git a/autobuild/synfigstudio-release.sh b/autobuild/synfigstudio-release.sh index b561233635e..bb7b9f000de 100755 --- a/autobuild/synfigstudio-release.sh +++ b/autobuild/synfigstudio-release.sh @@ -40,14 +40,6 @@ YLW='\033[1;33m' GRN='\033[0;32m' NC='\033[0m' # No Color -if [ -e /etc/debian_version ] && [ -z $with_boost_libdir ]; then - # Debian/Ubuntu multiarch - MULTIARCH_LIBDIR="/usr/lib/`uname -m`-linux-gnu/" - if [ -e "${MULTIARCH_LIBDIR}/libboost_program_options.so" ]; then - export with_boost_libdir=$MULTIARCH_LIBDIR - fi -fi - if [[ `uname` == "MINGW"* ]]; then # MacOS doesn't support `uname -o` flag PATH="${MINGW_PREFIX}/lib/ccache/bin:${PATH}" PKG_CONFIG_PATH="/opt/mlt-7.2.0/lib/pkgconfig:${PKG_CONFIG_PATH}" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8e99686c991..d317a1149d2 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -70,7 +70,6 @@ parts: - libmlt-dev - libmlt++-dev - libmlt-data - - libboost-system-dev - libmng-dev - git - libxml2-utils # to extract version from appdata file diff --git a/synfig-core/configure.ac b/synfig-core/configure.ac index 6b0297ea2b3..4cd0e1f743b 100644 --- a/synfig-core/configure.ac +++ b/synfig-core/configure.ac @@ -417,16 +417,6 @@ PKG_CHECK_MODULES(MLTPP, mlt++-7,[ ]) ]) -AX_BOOST_BASE([1.53.0],,AC_MSG_ERROR([ ** You need to install Boost >= 1.53.0])) -#AX_BOOST_SYSTEM -#if test "x$ax_cv_boost_system" != "xyes" ; then -# AC_MSG_ERROR([ ** You need to install Boost system library]) -#fi -# Boost program options and system libraries are just dependencies -# of the synfig cli and therefore -# not required to link against the synfig library. - - TARGET_PNG="yes" TARGET_MNG="yes" @@ -520,7 +510,7 @@ AC_SUBST(CONFIG_DEPS) AC_SUBST(ETL_CFLAGS) SYNFIG_LIBS="$VIMAGE_LIBS $LIBZ_LIBS $GLIBMM_LIBS $GIOMM_LIBS $LIBXMLPP_LIBS $LIBGL_LIBS $LIBCL_LIBS $LIBFFTW_LIBS $MLTPP_LIBS $ETL_LIBS $LIBSIGC_LIBS $LTLIBINTL" -SYNFIG_CFLAGS="$BOOST_CPPFLAGS $LIBZ_CFLAGS $GLIBMM_CFLAGS $GIOMM_CFLAGS $LIBXMLPP_CFLAGS $LIBGL_CFLAGS $LIBCL_CFLAGS $LIBFFTW_CFLAGS $MLTPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\\\"$localedir\\\"" +SYNFIG_CFLAGS="$LIBZ_CFLAGS $GLIBMM_CFLAGS $GIOMM_CFLAGS $LIBXMLPP_CFLAGS $LIBGL_CFLAGS $LIBCL_CFLAGS $LIBFFTW_CFLAGS $MLTPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\\\"$localedir\\\"" CONFIG_CFLAGS="`echo $CONFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`" SYNFIG_CFLAGS="`echo $SYNFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`" @@ -617,7 +607,4 @@ OpenEXR --------------------------> $with_openexr "'$'"ETL_LIBS ------------------------> '$ETL_LIBS' "'$'"LIBSIGC_LIBS --------------------> '$LIBSIGC_LIBS' "'$'"SYNFIG_CFLAGS -------------------> '$SYNFIG_CFLAGS' -"'$'"BOOST_CPPFLAGS ------------------> '$BOOST_CPPFLAGS' -"'$'"BOOST_LDFLAGS -------------------> '$BOOST_LDFLAGS' -"'$'"BOOST_SYSTEM_LIB ----------------> '$BOOST_SYSTEM_LIB' " diff --git a/synfig-core/m4/ax_boost_base.m4 b/synfig-core/m4/ax_boost_base.m4 deleted file mode 100644 index 9059e853c5b..00000000000 --- a/synfig-core/m4/ax_boost_base.m4 +++ /dev/null @@ -1,260 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searches -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2009 Peter Adolphs -# -# 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 21 - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], - [use Boost library from a standard location (ARG=yes), - from the specified location (ARG=), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - - -AC_ARG_WITH([boost-libdir], - AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), - [ - if test -d "$withval" - then - ac_boost_lib_path="$withval" - else - AC_MSG_ERROR(--with-boost-libdir expected directory name) - fi - ], - [ac_boost_lib_path=""] -) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl On 64-bit systems check for system libraries in both lib64 and lib. - dnl The former is specified by FHS, but e.g. Debian does not adhere to - dnl this (as it rises problems for generic multi-arch support). - dnl The last entry in the list is chosen by default when no libraries - dnl are found, e.g. when only header-only libraries are installed! - libsubdirs="lib" - ax_arch=`uname -m` - case $ax_arch in - x86_64|ppc64|s390x|sparc64|aarch64) - libsubdirs="lib64 lib lib64" - ;; - esac - - dnl first we check the system location for boost libraries - dnl this location is chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_CPPFLAGS="-I$ac_boost_path/include" - for ac_boost_path_tmp in $libsubdirs; do - if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then - BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" - break - fi - done - elif test "$cross_compiling" != yes; then - for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - for libsubdir in $libsubdirs ; do - if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - dnl overwrite ld flags if we have required special directory with - dnl --with-boost-libdir parameter - if test "$ac_boost_lib_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_lib_path" - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - if test "$cross_compiling" != yes; then - for ac_boost_path in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - if test "$ac_boost_lib_path" = ""; then - for libsubdir in $libsubdirs ; do - if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$best_path/$libsubdir" - fi - fi - - if test "x$BOOST_ROOT" != "x"; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) - fi - # execute ACTION-IF-NOT-FOUND (if present): - ifelse([$3], , :, [$3]) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - # execute ACTION-IF-FOUND (if present): - ifelse([$2], , :, [$2]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) diff --git a/synfig-core/m4/ax_boost_chrono.m4 b/synfig-core/m4/ax_boost_chrono.m4 deleted file mode 100644 index 9b3958ec74d..00000000000 --- a/synfig-core/m4/ax_boost_chrono.m4 +++ /dev/null @@ -1,118 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_CHRONO -# -# DESCRIPTION -# -# Test for System library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CHRONO_LIB) -# -# And sets: -# -# HAVE_BOOST_CHRONO -# -# LICENSE -# -# Copyright (c) 2012 Xiyue Deng -# -# 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 1 - -AC_DEFUN([AX_BOOST_CHRONO], -[ - AC_ARG_WITH([boost-chrono], - AS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@], - [use the Chrono library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-chrono=boost_chrono-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_chrono_lib="" - else - want_boost="yes" - ax_boost_user_chrono_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Chrono library is available, - ax_cv_boost_chrono, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[boost::chrono::system_clock::time_point time;]])], - ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_chrono" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_chrono_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_chrono.*\)\.so.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], - [link_chrono="no"]) - done - if test "x$link_chrono" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_chrono.*\)\.dll.*$;\1;' -e 's;^\(boost_chrono.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], - [link_chrono="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], - [link_chrono="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_chrono" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/synfig-core/m4/ax_boost_filesystem.m4 b/synfig-core/m4/ax_boost_filesystem.m4 deleted file mode 100644 index f162163cdc6..00000000000 --- a/synfig-core/m4/ax_boost_filesystem.m4 +++ /dev/null @@ -1,118 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_FILESYSTEM -# -# DESCRIPTION -# -# Test for Filesystem library from the Boost C++ libraries. The macro -# requires a preceding call to AX_BOOST_BASE. Further documentation is -# available at . -# -# This macro calls: -# -# AC_SUBST(BOOST_FILESYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_FILESYSTEM -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# Copyright (c) 2009 Michael Tindal -# Copyright (c) 2009 Roman Rybalko -# -# 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 26 - -AC_DEFUN([AX_BOOST_FILESYSTEM], -[ - AC_ARG_WITH([boost-filesystem], - AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@], - [use the Filesystem library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_filesystem_lib="" - else - want_boost="yes" - ax_boost_user_filesystem_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - LIBS_SAVED=$LIBS - LIBS="$LIBS $BOOST_SYSTEM_LIB" - export LIBS - - AC_CACHE_CHECK(whether the Boost::Filesystem library is available, - ax_cv_boost_filesystem, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::filesystem; - path my_path( "foo/bar/data.txt" ); - return 0;]])], - ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_filesystem" = "xyes"; then - AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_filesystem_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - if test "x$link_filesystem" != "xyes"; then - for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - fi - else - for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_filesystem" != "xyes"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - LIBS="$LIBS_SAVED" - fi -]) diff --git a/synfig-core/m4/ax_boost_program_options.m4 b/synfig-core/m4/ax_boost_program_options.m4 deleted file mode 100644 index 65a39c8c70e..00000000000 --- a/synfig-core/m4/ax_boost_program_options.m4 +++ /dev/null @@ -1,108 +0,0 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_boost_program_options.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_BOOST_PROGRAM_OPTIONS -# -# DESCRIPTION -# -# Test for program options library from the Boost C++ libraries. The macro -# requires a preceding call to AX_BOOST_BASE. Further documentation is -# available at . -# -# This macro calls: -# -# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) -# -# And sets: -# -# HAVE_BOOST_PROGRAM_OPTIONS -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# -# 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 22 - -AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], -[ - AC_ARG_WITH([boost-program-options], - AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@], - [use the program options library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_program_options_lib="" - else - want_boost="yes" - ax_boost_user_program_options_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - export want_boost - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - AC_CACHE_CHECK([whether the Boost::Program_Options library is available], - ax_cv_boost_program_options, - [AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include - ]], - [[boost::program_options::options_description generic("Generic options"); - return 0;]])], - ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no) - AC_LANG_POP([C++]) - ]) - if test "$ax_cv_boost_program_options" = yes; then - AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_program_options_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - if test "x$link_program_options" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - fi - else - for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_program_options" != "xyes"; then - AC_MSG_ERROR([Could not link against [$ax_lib] !]) - fi - fi - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/synfig-core/m4/ax_boost_system.m4 b/synfig-core/m4/ax_boost_system.m4 deleted file mode 100644 index c4c45559d8e..00000000000 --- a/synfig-core/m4/ax_boost_system.m4 +++ /dev/null @@ -1,120 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_SYSTEM -# -# DESCRIPTION -# -# Test for System library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_SYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_SYSTEM -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2008 Michael Tindal -# Copyright (c) 2008 Daniel Casimiro -# -# 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 17 - -AC_DEFUN([AX_BOOST_SYSTEM], -[ - AC_ARG_WITH([boost-system], - AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@], - [use the System library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-system=boost_system-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_system_lib="" - else - want_boost="yes" - ax_boost_user_system_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::System library is available, - ax_cv_boost_system, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[boost::system::system_category]])], - ax_cv_boost_system=yes, ax_cv_boost_system=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_system" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_system_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - if test "x$link_system" != "xyes"; then - for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_system" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/synfig-core/src/CMakeLists.txt b/synfig-core/src/CMakeLists.txt index fc34cc820ca..19835452be9 100644 --- a/synfig-core/src/CMakeLists.txt +++ b/synfig-core/src/CMakeLists.txt @@ -2,8 +2,6 @@ ## Find packages ## -# TODO: check if we really need all of them -find_package(Boost REQUIRED) find_package(ZLIB REQUIRED) find_package(Intl REQUIRED) diff --git a/synfig-core/src/synfig/valuenodes/CMakeLists.txt b/synfig-core/src/synfig/valuenodes/CMakeLists.txt index d7bd9daff12..f96ed4f7dcf 100644 --- a/synfig-core/src/synfig/valuenodes/CMakeLists.txt +++ b/synfig-core/src/synfig/valuenodes/CMakeLists.txt @@ -70,7 +70,6 @@ target_sources(libsynfig ) file(GLOB VALUENODES_HEADERS "${CMAKE_CURRENT_LIST_DIR}/*.h") -target_include_directories(libsynfig PRIVATE ${Boost_INCLUDE_DIRS}) install( FILES ${VALUENODES_HEADERS} diff --git a/synfig-core/src/synfig/valuenodes/valuenode_dynamic.cpp b/synfig-core/src/synfig/valuenodes/valuenode_dynamic.cpp index 306220f530f..d41049a398e 100644 --- a/synfig-core/src/synfig/valuenodes/valuenode_dynamic.cpp +++ b/synfig-core/src/synfig/valuenodes/valuenode_dynamic.cpp @@ -33,19 +33,21 @@ #endif #include "valuenode_dynamic.h" + +#include + #include "valuenode_const.h" #include #include #include #include -#include #endif /* === U S I N G =========================================================== */ using namespace synfig; -using namespace boost::numeric::odeint; + /* === M A C R O S ========================================================= */ /* === G L O B A L S ======================================================= */ @@ -55,6 +57,131 @@ REGISTER_VALUENODE(ValueNode_Dynamic, RELEASE_VERSION_0_61_06, "dynamic", N_("Dy /* === P R O C E D U R E S ================================================= */ +struct MathVector : std::vector +{ + MathVector() = default; + MathVector(const MathVector&) = default; + MathVector(std::vector::iterator begin, std::vector::iterator end) + : std::vector(begin, end) + { + } + MathVector(size_type n) + : std::vector(n) + { + } + + MathVector& operator=(const MathVector& rhs) = default; + + MathVector& operator+=(const MathVector& rhs) + { + std::transform(begin(), end(), rhs.begin(), begin(), std::plus()); + return *this; + } + + MathVector operator+(const MathVector& rhs) const + { + return MathVector(*this) += rhs; + } + + MathVector& operator*=(Real rhs) + { + for (auto& i: *this) + i *= rhs; + return *this; + } + + MathVector operator*(Real rhs) const + { + return MathVector(*this) *= rhs; + } +}; + +typedef std::function&, std::vector&)> Function; + +static void +runge_kutta_cash_karp(Function oscillator, Real& t, MathVector& x, Real& step_size, Real tolerance) +{ + const auto& num_dim = x.size(); + MathVector xf; + MathVector k1(num_dim), k2(num_dim), k3(num_dim), k4(num_dim), k5(num_dim), k6(num_dim); + + auto max_delta = [] (const MathVector& a, const MathVector& b) -> Real { + Real max = 0; + const auto size = a.size(); + for (unsigned int i = 0; i < size; ++i) { + max = std::max(max, std::fabs(a[i] - b[i])); + } + return max; + }; + + typedef std::vector Solution; + + auto VRKF_err = [max_delta](const Solution& y, int order) { + return std::fabs(std::pow(max_delta(y[order], y[order - 1]), 1./(order + 1))); + }; + auto VRKF_e = [VRKF_err](const Solution& y, int order, double tolerance) { + return VRKF_err(y, order) / std::pow(tolerance, 1./(order + 1)); + }; + const Real VRKF_sf = 0.9; + + Real tf(t); + + while (true) { + tf = t + step_size; + // k1 + oscillator(t, x, k1); + k1 *= step_size; + // k2 + oscillator(t + (1/5.) * step_size, x + k1 * (1/5.), k2); + k2 *= step_size; + // k3 + oscillator(t + (3/10.) * step_size, x + k1 * (3/40.) + k2 * (9/40.), k3); + k3 *= step_size; + // k4 + oscillator(t + (3/5.) * step_size, x + k1 * (3/10.) + k2 * (-9/10.) + k3 * (6/5.), k4); + k4 *= step_size; + // k5 + oscillator(t + /*1. **/ step_size, x + k1 * (-11/54.) + k2 * (5/2.) + k3 * (-70/27.) + k4 * (35/27.), k5); + k5 *= step_size; + // k6 + oscillator(t + (7/8.) * step_size, x + k1 * (1631/55296.) + k2 * (175/512.) + k3 * (575/13824.) + k4 * (44275/110592.) + k5 * (253/4096.), k6); + k6 *= step_size; + + MathVector dy5 = k1 * (37/378.) + k3 * (250/621.) + k4 * (125/594.) + k6 * (512/1771.); + MathVector dy4 = k1 * (2825/27648.) + k3 * (18575/48384.) + k4 * (13525/55296.) + k5 * (277/14336.) + k6 * (1/4.); + + Solution solution{0, 0, 0, dy4, dy5}; + auto e_4 = VRKF_e(solution, 4, tolerance); + if (e_4 > 1) { + // No order less than 5th order is possibly good, so abandon current step + step_size *= std::max(0.2, VRKF_sf / e_4); + continue; + } else { + // accept 5th order solution + + xf = x + dy5; + + step_size *= std::min(5., VRKF_sf / e_4); + break; + } + } + x = xf; + t = tf; +} + +static void +integrate(Function oscillator, MathVector& x0, Real to, Real tf, Real step_size, Real tolerance = 1e-5) +{ + Real t = to; + MathVector x = x0; + + while (t < tf) { + step_size = std::min(step_size, tf - t); + runge_kutta_cash_karp(oscillator, t, x, step_size, tolerance); + } + x0 = x; +} + /* === M E T H O D S ======================================================= */ ValueNode_Dynamic::ValueNode_Dynamic(const ValueBase &value): @@ -146,7 +273,7 @@ ValueNode_Dynamic::operator()(Time t)const ValueNode::RHandle value_node(ValueNode::RHandle::cast_dynamic(origin_d_->get_link("link"))); value_node->replace(origin_); Oscillator oscillator(this); - std::vector x(state.begin(), state.end()); + MathVector x(state.begin(), state.end()); integrate(oscillator, x, t0, t1, step); // Remember time and state for the next call last_time=Time(t); diff --git a/synfig-core/src/synfig/valuenodes/valuenode_dynamic.h b/synfig-core/src/synfig/valuenodes/valuenode_dynamic.h index fbbe041e868..28af0a96009 100644 --- a/synfig-core/src/synfig/valuenodes/valuenode_dynamic.h +++ b/synfig-core/src/synfig/valuenodes/valuenode_dynamic.h @@ -116,7 +116,7 @@ class Oscillator public: Oscillator(const ValueNode_Dynamic* x) : d(x) { } - void operator() ( const std::vector &x , std::vector &dxdt , const double t ) + void operator() ( const double t, const std::vector &x, std::vector &dxdt ) { Vector u(cos(x[2]), sin(x[2])); Vector v(-u[1], u[0]); diff --git a/synfig-core/src/tool/Makefile.am b/synfig-core/src/tool/Makefile.am index 3c9989ac223..2530d893a0b 100644 --- a/synfig-core/src/tool/Makefile.am +++ b/synfig-core/src/tool/Makefile.am @@ -6,9 +6,7 @@ EXTRA_DIST = \ AM_CPPFLAGS = \ -I$(top_builddir) \ - -I$(top_srcdir)/src \ - @BOOST_CPPFLAGS@ - + -I$(top_srcdir)/src bin_PROGRAMS = \ synfig @@ -31,8 +29,7 @@ synfig_SOURCES = \ synfig_LDADD = \ ../synfig/libsynfig.la \ - @SYNFIG_LIBS@ \ - @BOOST_LDFLAGS@ + @SYNFIG_LIBS@ synfig_CXXFLAGS = \ @SYNFIG_CFLAGS@ diff --git a/vcpkg.json b/vcpkg.json index 9f7c739aba9..e692917a05b 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,8 +8,6 @@ "fftw3", "freetype", "libtool", - "boost-config", - "boost-odeint", "zlib", "libpng", "libjpeg-turbo",