--- qsampler/trunk/configure.ac 2015/11/01 21:35:09 2852 +++ qsampler/trunk/configure.ac 2016/10/09 10:14:12 3002 @@ -1,19 +1,45 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Qsampler, 0.3.1.11, rncbc@rncbc.org, qsampler) +AC_INIT(Qsampler, 0.4.1.6, 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) +# Sanitize version string. +ac_version=$(echo $PACKAGE_VERSION | sed -r 's/^([0-9|\.]+).*$/\1/') +AC_SUBST(ac_version) + # Set default installation prefix. AC_PREFIX_DEFAULT(/usr/local) -ac_prefix=$prefix -if test "x$ac_prefix" = "xNONE"; then - ac_prefix=$ac_default_prefix +if test "x$prefix" = "xNONE"; then + prefix=$ac_default_prefix +fi +if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix fi +eval ac_prefix=$prefix AC_SUBST(ac_prefix) AC_DEFINE_UNQUOTED(CONFIG_PREFIX, ["$ac_prefix"], [Default installation prefix.]) +# Set default installation directories. +eval ac_bindir=$bindir +AC_SUBST(ac_bindir) +AC_DEFINE_UNQUOTED(CONFIG_BINDIR, ["$ac_bindir"], [Default executable binary path.]) + +eval ac_libdir=$libdir +AC_SUBST(ac_libdir) +AC_DEFINE_UNQUOTED(CONFIG_LIBDIR, ["$ac_libdir"], [Default object library path.]) + +eval datarootdir=$datarootdir +eval ac_datadir=$datadir +AC_SUBST(ac_datadir) +AC_DEFINE_UNQUOTED(CONFIG_DATADIR, ["$ac_datadir"], [Default arch-idependent data path.]) + +eval ac_mandir=$mandir +AC_SUBST(ac_mandir) +AC_DEFINE_UNQUOTED(CONFIG_MANDIR, ["$ac_mandir"], [Default man page path.]) + + # Enable debugging argument option. AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]), @@ -36,12 +62,6 @@ [ac_qt4="$enableval"], [ac_qt4="no"]) -AC_ARG_ENABLE(qt5, - AC_HELP_STRING([--enable-qt5], [enable Qt5 build (default=yes)]), - [ac_qt5="$enableval"], - [ac_qt5="yes"]) - - # Enable libgig availability. AC_ARG_ENABLE(libgig, @@ -62,11 +82,7 @@ # Standard installation base dirs. -if test "$cross_compiling" = yes; then - ac_with_paths="" -else - ac_with_paths="/usr /usr/local" -fi +ac_with_paths="" # Set for alternate Qt4/5 installation dir. AC_ARG_WITH(qt4, @@ -84,14 +100,7 @@ if test "x$ac_qt5_path" != "xno"; then ac_with_paths="$ac_with_paths $ac_qt5_path" - ac_qt5="yes" -fi - -if test "x$ac_qt5" = "xno"; then - ac_qt4="yes" -fi -if test "x$ac_qt4" = "xyes"; then - ac_qt5="no" + ac_qt4="no" fi # Set for alternate liblscp installation dir. @@ -111,16 +120,14 @@ # Checks for programs. -AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_CXXCPP -AC_PROG_GCC_TRADITIONAL # Checks for languages. -AC_LANG_C AC_LANG_CPLUSPLUS +# Check for pkg-config. PKG_PROG_PKG_CONFIG # Check for proper flags. @@ -161,8 +168,7 @@ if test "x$ac_qt4" = "xyes"; then AC_PATH_PROG(ac_qmake, qmake-qt4, [no], $ac_path) -fi -if test "x$ac_qt5" = "xyes"; then +else AC_PATH_PROG(ac_qmake, qmake-qt5, [no], $ac_path) fi if test "x$ac_qmake" = "xno"; then @@ -175,11 +181,14 @@ # Check for proper Qt4/5 major version. ac_qt_version_major=`$ac_qmake -query QT_VERSION | cut -d. -f1` -if test "x$ac_qt4" = "xyes" -a "x$ac_qt_version_major" != "x4"; then - AC_MSG_ERROR([qmake-qt4 $ac_errmsg (qt4-devel)]) -fi -if test "x$ac_qt5" = "xyes" -a "x$ac_qt_version_major" != "x5"; then - AC_MSG_ERROR([qmake-qt5 $ac_errmsg (qt5-devel)]) +if test "x$ac_qt4" = "xyes"; then + if test "x$ac_qt_version_major" != "x4"; then + AC_MSG_ERROR([qmake-qt4 $ac_errmsg (qt4-devel)]) + fi +else + if test "x$ac_qt_version_major" != "x5"; then + AC_MSG_ERROR([qmake-qt5 $ac_errmsg (qt5-devel)]) + fi fi ac_qt_install_bins=`$ac_qmake -query QT_INSTALL_BINS` @@ -222,9 +231,7 @@ exit 1 ]) ]) -fi - -if test "x$ac_qt5" = "xyes"; then +else AC_CACHE_CHECK([for Qt library version >= 5.1], ac_cv_qtversion, [ AC_TRY_COMPILE([#include "QtCore/qglobal.h"], [ @@ -279,16 +286,20 @@ fi # Check for mandatory libraries. -AC_CHECK_LIB(lscp, main, [ac_liblscp="yes"], [ac_liblscp="no"]) -if test "x$ac_liblscp" = "xno"; then - AC_MSG_ERROR([LSCP library not found.]) +PKG_CHECK_MODULES([LSCP], [lscp], [ac_liblscp="yes"], [ac_liblscp="no"]) +if test "x$ac_liblscp" = "xyes"; then + AC_DEFINE(CONFIG_LIBLSCP, 1, [Define if liblscp is available.]) + ac_cflags="$ac_cflags $LSCP_CFLAGS" + ac_libs="$ac_libs $LSCP_LIBS" +else + AC_MSG_ERROR([*** LSCP library not found (liblscp).]) fi -ac_libs="$ac_libs -llscp" + case "{$host}" in - *mingw*) - ac_libs="$ac_libs -lws2_32" - LIBS="$LIBS -lws2_32" - ;; + *mingw*) + ac_libs="$ac_libs -lws2_32" + LIBS="$LIBS -lws2_32" + ;; esac AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t], @@ -406,16 +417,16 @@ # Check for optional libraries. if test "x$ac_libgig" = "xyes"; then - PKG_CHECK_MODULES(LIBGIG, gig >= 3.3.0, [ac_libgig="yes"], [ac_libgig="no"]) - if test "x$ac_libgig" = "xyes"; then - AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) - AC_SUBST(LIBGIG_CFLAGS) - AC_SUBST(LIBGIG_LIBS) - ac_cflags="$ac_cflags $LIBGIG_CFLAGS" - ac_libs="$ac_libs $LIBGIG_LIBS" - AC_DEFINE(CONFIG_LIBGIG_SETAUTOLOAD, 1, [Define if libgig provides gig::File::SetAutoLoad() method.]) - ac_libgig_setautoload="yes" - fi + PKG_CHECK_MODULES([GIG], [gig >= 3.3.0], [ac_libgig="yes"], [ac_libgig="no"]) +fi +if test "x$ac_libgig" = "xyes"; then + AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) + ac_cflags="$ac_cflags $GIG_CFLAGS" + ac_libs="$ac_libs $GIG_LIBS" + AC_DEFINE(CONFIG_LIBGIG_SETAUTOLOAD, 1, [Define if libgig provides gig::File::SetAutoLoad() method.]) + ac_libgig_setautoload="yes" +else + AC_MSG_WARN([*** GIG library not found (libgig).]) fi # Check for round math function. @@ -424,42 +435,42 @@ AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) fi + +# Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h sys/socket.h) + +if test "x$ac_libgig" = "xyes"; then + AC_CHECK_HEADER(libgig/SF.h, [ac_libgig_sf2="yes"], [ac_libgig_sf2="no"]) + if test "x$ac_libgig_sf2" = "xyes"; then + AC_DEFINE(CONFIG_LIBGIG_SF2, 1, [Define if libgig/SF.h is available.]) + fi +fi + # Check for X11 unique/single instance. if test "x$ac_xunique" = "xyes"; then AC_DEFINE(CONFIG_XUNIQUE, 1, [Define if X11 unique/single instance is enabled.]) + if test "x$ac_qt4" = "xno"; then + ac_qx11extras="x11extras" + fi + # Some recent distros (eg. fedora, debian) require this. + if test "x$ac_cv_lib_X11_main" = "xyes"; then + ac_libs="$ac_libs -lX11" + fi fi +AC_SUBST(ac_qx11extras) # Check for debugging stack-trace. if test "x$ac_stacktrace" = "xyes"; then AC_DEFINE(CONFIG_STACKTRACE, 1, [Define if debugger stack-trace is enabled.]) fi -# Some recent distros (eg. fedora, debian) require this. -if test "x$ac_cv_lib_X11_main" = "xyes"; then - ac_libs="$ac_libs -lX11" -fi - -AC_SUBST(ac_libs) -AC_SUBST(ac_incpath) AC_SUBST(ac_cflags) AC_SUBST(ac_ldflags) +AC_SUBST(ac_incpath) +AC_SUBST(ac_libs) -# Checks for header files. -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h sys/socket.h) - -AC_CHECK_HEADER(lscp/client.h, [ac_lscp_h="yes"], [ac_lscp_h="no"]) -if test "x$ac_lscp_h" = "xno"; then - AC_MSG_ERROR([LSCP headers not found.]) -fi - -if test "x$ac_libgig" = "xyes"; then - AC_CHECK_HEADER(libgig/SF.h, [ac_libgig_sf2="yes"], [ac_libgig_sf2="no"]) - if test "x$ac_libgig_sf2" = "xyes"; then - AC_DEFINE(CONFIG_LIBGIG_SF2, 1, [Define if libgig/SF.h is available.]) - fi -fi # Checks for typedefs, structures, and compiler characteristics. # AC_C_CONST