From 2ef352d365b38b6feeac5eb9316ddd02f49d3728 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 24 Dec 2013 16:33:18 -0800 Subject: [PATCH] Add an option to skip all of the slow configure checks Cuts the total runtime of the configure script from 19 seconds to 5 seconds for me. --- aegisub/configure.ac | 10 +++++----- aegisub/m4macros/ax_boost_asio.m4 | 2 ++ aegisub/m4macros/ax_boost_chrono.m4 | 2 ++ aegisub/m4macros/ax_boost_filesystem.m4 | 2 ++ aegisub/m4macros/ax_boost_locale.m4 | 2 ++ aegisub/m4macros/ax_boost_regex.m4 | 2 ++ aegisub/m4macros/ax_boost_system.m4 | 2 ++ aegisub/m4macros/ax_boost_thread.m4 | 2 ++ 8 files changed, 19 insertions(+), 5 deletions(-) diff --git a/aegisub/configure.ac b/aegisub/configure.ac index 00ca7d74c..1df7f82fa 100644 --- a/aegisub/configure.ac +++ b/aegisub/configure.ac @@ -188,6 +188,9 @@ AS_IF([test x$with_libc__ != xno], [ AC_CHECK_LIB([m], [main]) AC_CHECK_HEADERS([sys/time.h]) +AC_ARG_ENABLE(sanity-checks, + AS_HELP_STRING([--disable-sanity-checks],[Skip verifying that found libraries work.])) + ############################## # Program Support and Features ############################## @@ -223,7 +226,7 @@ PKG_CHECK_MODULES(ICU_I18N, icu-i18n >= icu_required_version) ######## ## boost ######## -AS_IF([test x$enable_slow_wx_checks != xno], [ +AS_IF([test x$enable_sanity_checks != xno], [ AC_AGI_COMPILE([boost ICU support], [boost_icu], [$BOOST_CPPFLAGS], [$BOOST_LDFLAGS $BOOST_REGEX_LIB $ICU_UC_LIBS $ICU_I18N_LIBS],[ #include @@ -431,10 +434,7 @@ AC_SUBST(WX_CONFIG_PATH) AS_IF([test x$WX_VERSION = x], [AC_MSG_FAILURE([wxWidgets detection failed, please set --with-wx* or add the libraries to your LIBS, CXX/CFLAGS.])]) -AC_ARG_ENABLE(slow-wx-checks, - AS_HELP_STRING([--disable-slow-wx-checks],[Disable slow-running checks for wx components.])) - -AS_IF([test x$enable_slow_wx_checks != xno], [ +AS_IF([test x$enable_sanity_checks != xno], [ AC_AGI_LINK([wxWidgets OpenGL support], [wxopengl], [wx/glcanvas.h], [$GL_CFLAGS $WX_CFLAGS], [$GL_LIBS $WX_LIBS],[ #include int main(void) { diff --git a/aegisub/m4macros/ax_boost_asio.m4 b/aegisub/m4macros/ax_boost_asio.m4 index 20861eba8..bc209be0c 100644 --- a/aegisub/m4macros/ax_boost_asio.m4 +++ b/aegisub/m4macros/ax_boost_asio.m4 @@ -62,6 +62,7 @@ AC_DEFUN([AX_BOOST_ASIO], LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::ASIO library is available, ax_cv_boost_asio, [AC_LANG_PUSH([C++]) @@ -79,6 +80,7 @@ AC_DEFUN([AX_BOOST_ASIO], ax_cv_boost_asio=yes, ax_cv_boost_asio=no) AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_asio=yes]) if test "x$ax_cv_boost_asio" = "xyes"; then AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available]) BN=boost_system diff --git a/aegisub/m4macros/ax_boost_chrono.m4 b/aegisub/m4macros/ax_boost_chrono.m4 index 9b3958ec7..6b918e870 100644 --- a/aegisub/m4macros/ax_boost_chrono.m4 +++ b/aegisub/m4macros/ax_boost_chrono.m4 @@ -62,6 +62,7 @@ AC_DEFUN([AX_BOOST_CHRONO], LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::Chrono library is available, ax_cv_boost_chrono, [AC_LANG_PUSH([C++]) @@ -73,6 +74,7 @@ AC_DEFUN([AX_BOOST_CHRONO], CXXFLAGS=$CXXFLAGS_SAVE AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_chrono=yes]) if test "x$ax_cv_boost_chrono" = "xyes"; then AC_SUBST(BOOST_CPPFLAGS) diff --git a/aegisub/m4macros/ax_boost_filesystem.m4 b/aegisub/m4macros/ax_boost_filesystem.m4 index f162163cd..a5a08d03a 100644 --- a/aegisub/m4macros/ax_boost_filesystem.m4 +++ b/aegisub/m4macros/ax_boost_filesystem.m4 @@ -67,6 +67,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM], LIBS="$LIBS $BOOST_SYSTEM_LIB" export LIBS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::Filesystem library is available, ax_cv_boost_filesystem, [AC_LANG_PUSH([C++]) @@ -77,6 +78,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM], ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_filesystem=yes]) 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/@<:@^\/@:>@*//'` diff --git a/aegisub/m4macros/ax_boost_locale.m4 b/aegisub/m4macros/ax_boost_locale.m4 index 8db8c4181..e74b42ec4 100644 --- a/aegisub/m4macros/ax_boost_locale.m4 +++ b/aegisub/m4macros/ax_boost_locale.m4 @@ -62,6 +62,7 @@ AC_DEFUN([AX_BOOST_LOCALE], LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::Locale library is available, ax_cv_boost_locale, [AC_LANG_PUSH([C++]) @@ -74,6 +75,7 @@ AC_DEFUN([AX_BOOST_LOCALE], CXXFLAGS=$CXXFLAGS_SAVE AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_locale=yes]) if test "x$ax_cv_boost_locale" = "xyes"; then AC_SUBST(BOOST_CPPFLAGS) diff --git a/aegisub/m4macros/ax_boost_regex.m4 b/aegisub/m4macros/ax_boost_regex.m4 index 918f16a47..4e18e2a0d 100644 --- a/aegisub/m4macros/ax_boost_regex.m4 +++ b/aegisub/m4macros/ax_boost_regex.m4 @@ -62,6 +62,7 @@ AC_DEFUN([AX_BOOST_REGEX], LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::Regex library is available, ax_cv_boost_regex, [AC_LANG_PUSH([C++]) @@ -71,6 +72,7 @@ AC_DEFUN([AX_BOOST_REGEX], ax_cv_boost_regex=yes, ax_cv_boost_regex=no) AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_regex=yes]) if test "x$ax_cv_boost_regex" = "xyes"; then AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` diff --git a/aegisub/m4macros/ax_boost_system.m4 b/aegisub/m4macros/ax_boost_system.m4 index c4c45559d..fdbe5595e 100644 --- a/aegisub/m4macros/ax_boost_system.m4 +++ b/aegisub/m4macros/ax_boost_system.m4 @@ -64,6 +64,7 @@ AC_DEFUN([AX_BOOST_SYSTEM], LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::System library is available, ax_cv_boost_system, [AC_LANG_PUSH([C++]) @@ -75,6 +76,7 @@ AC_DEFUN([AX_BOOST_SYSTEM], CXXFLAGS=$CXXFLAGS_SAVE AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_system=yes]) if test "x$ax_cv_boost_system" = "xyes"; then AC_SUBST(BOOST_CPPFLAGS) diff --git a/aegisub/m4macros/ax_boost_thread.m4 b/aegisub/m4macros/ax_boost_thread.m4 index 79e12cdb4..b864a3007 100644 --- a/aegisub/m4macros/ax_boost_thread.m4 +++ b/aegisub/m4macros/ax_boost_thread.m4 @@ -63,6 +63,7 @@ AC_DEFUN([AX_BOOST_THREAD], LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AS_IF([test x$enable_sanity_checks != xno], [ AC_CACHE_CHECK(whether the Boost::Thread library is available, ax_cv_boost_thread, [AC_LANG_PUSH([C++]) @@ -82,6 +83,7 @@ AC_DEFUN([AX_BOOST_THREAD], CXXFLAGS=$CXXFLAGS_SAVE AC_LANG_POP([C++]) ]) + ], [ax_cv_boost_thread=yes]) if test "x$ax_cv_boost_thread" = "xyes"; then if test "x$host_os" = "xsolaris" ; then BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"