--- qsampler/trunk/configure.ac 2016/10/09 10:14:12 3002 +++ qsampler/trunk/configure.ac 2016/11/04 23:54:44 3037 @@ -1,12 +1,20 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Qsampler, 0.4.1.6, rncbc@rncbc.org, qsampler) +AC_INIT(Qsampler, 0.4.1.10, rncbc@rncbc.org, qsampler) AC_CONFIG_SRCDIR(src/qsampler.cpp) AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_FILES(Makefile qsampler.spec src/src.pri src/qsampler.desktop) +# Build date and time. +AC_CACHE_VAL([ac_cv_build_date], + [ac_cv_build_date=$(date +"%b %d %Y %H:%M %z")]) +ac_build_date="$ac_cv_build_date" +AC_DEFINE_UNQUOTED(CONFIG_BUILD_DATE, ["$ac_build_date"], [Build date and time.]) + # Sanitize version string. -ac_version=$(echo $PACKAGE_VERSION | sed -r 's/^([0-9|\.]+).*$/\1/') +AC_CACHE_VAL([ac_cv_build_version], + [ac_cv_build_version=$(echo $PACKAGE_VERSION | sed -r 's/^([[0-9|\.]]+).*$/\1/')]) +ac_version="$ac_cv_build_version" AC_SUBST(ac_version) # Set default installation prefix. @@ -130,8 +138,21 @@ # Check for pkg-config. PKG_PROG_PKG_CONFIG +# Check whether -std=c++11 support is necessary (4 < g++ version < 6). +AC_CACHE_CHECK([for g++ major version], [ac_cv_gxx_version_major], [ + ac_cv_gxx_version_major=$($CC -dumpversion) + if test -n "$ac_cv_gxx_version_major"; then + ac_cv_gxx_version_major=$(echo $ac_cv_gxx_version_major | cut -d'.' -f1); + fi + ac_gxx_version_major=$(($ac_cv_gxx_version_major + 0)) +]) +ac_gxx_version_major=$ac_cv_gxx_version_major +if test $ac_gxx_version_major -gt 4 -a $ac_gxx_version_major -lt 6; then + CXXFLAGS="-std=c++11 $CXXFLAGS" +fi + # Check for proper flags. -ac_arch=`uname -m` +ac_arch=$(uname -m) # Check for install paths and alternatives... ac_libdirs="lib" @@ -179,21 +200,29 @@ AC_MSG_ERROR([qmake $ac_errmsg]) fi -# Check for proper Qt4/5 major version. -ac_qt_version_major=`$ac_qmake -query QT_VERSION | cut -d. -f1` +# Check for proper Qt major version. +AC_CACHE_CHECK([for Qt major version], [ac_cv_qt_version_major], [ + ac_cv_qt_version_major=$($ac_qmake -query QT_VERSION | cut -d'.' -f1) + ac_cv_qt_version_major=$(($ac_cv_qt_version_major + 0)) +]) +ac_qt_version_major=$ac_cv_qt_version_major if test "x$ac_qt4" = "xyes"; then - if test "x$ac_qt_version_major" != "x4"; then + if test $ac_qt_version_major -ne 4; then AC_MSG_ERROR([qmake-qt4 $ac_errmsg (qt4-devel)]) fi else - if test "x$ac_qt_version_major" != "x5"; then + if test $ac_qt_version_major -ne 5; then AC_MSG_ERROR([qmake-qt5 $ac_errmsg (qt5-devel)]) fi fi -ac_qt_install_bins=`$ac_qmake -query QT_INSTALL_BINS` -if test -d $ac_qt_install_bins; then - ac_path="$ac_qt_install_bins:$ac_path" +# Check for proper Qt install path. +AC_CACHE_CHECK([for Qt install path], [ac_cv_qt_install_path], [ + ac_cv_qt_install_path=$($ac_qmake -query QT_INSTALL_BINS) +]) +ac_qt_install_path=$ac_cv_qt_install_path +if test -d $ac_qt_install_path; then + ac_path="$ac_qt_install_path:$ac_path" fi # Check it again, now with updated PATH, just in case... @@ -205,20 +234,26 @@ AC_SUBST(ac_qmake) -ac_qt_install_headers=`$ac_qmake -query QT_INSTALL_HEADERS` +AC_CACHE_CHECK([for Qt install headers], [ac_cv_qt_install_headers], [ + ac_cv_qt_install_headers=$($ac_qmake -query QT_INSTALL_HEADERS) +]) +ac_qt_install_headers=$ac_cv_qt_install_headers if test -d $ac_qt_install_headers; then CFLAGS="-I$ac_qt_install_headers $CFLAGS " CPPFLAGS="-I$ac_qt_install_headers $CPPFLAGS" ac_incpath="$ac_qt_install_headers $ac_incpath" fi -ac_qt_install_libs=`$ac_qmake -query QT_INSTALL_LIBS` +AC_CACHE_CHECK([for Qt install libraries], [ac_cv_qt_install_libs], [ + ac_cv_qt_install_libs=$($ac_qmake -query QT_INSTALL_LIBS) +]) +ac_qt_install_libs=$ac_cv_qt_install_libs if test -d $ac_qt_install_libs; then LIBS="-L$ac_qt_install_libs $LIBS" ac_libs="-L$ac_qt_install_libs $ac_libs" fi -# Check for proper Qt4/5 version. +# Finally, check for proper Qt4/5 version. if test "x$ac_qt4" = "xyes"; then AC_CACHE_CHECK([for Qt library version >= 4.4], ac_cv_qtversion, [ @@ -486,7 +521,7 @@ # Output summary message echo -echo " $PACKAGE_NAME $PACKAGE_VERSION" +echo " $PACKAGE_NAME $PACKAGE_VERSION ($ac_build_date)" echo echo " Build target . . . . . . . . . . . . . . . . . . .: $ac_debug" echo