--- qsampler/trunk/configure.ac 2013/11/01 17:44:30 2480 +++ qsampler/trunk/configure.ac 2013/11/07 18:22:48 2481 @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Qsampler, 0.2.2.41, rncbc@rncbc.org, qsampler) +AC_INIT(Qsampler, 0.2.2.42, rncbc@rncbc.org, qsampler) AC_CONFIG_SRCDIR(src/qsampler.cpp) AC_CONFIG_HEADERS(src/config.h) @@ -29,6 +29,25 @@ fi AC_SUBST(ac_debug) + +# Enable Qt4/5 availability. +AC_ARG_ENABLE(qt4, + AC_HELP_STRING([--enable-qt4], [enable Qt4 build (default=yes)]), + [ac_qt4="$enableval"], + [ac_qt4="yes"]) + +AC_ARG_ENABLE(qt5, + AC_HELP_STRING([--enable-qt5], [enable Qt5 build (default=no)]), + [ac_qt5="$enableval"], + [ac_qt5="no"]) + +if test "x$ac_qt4" = "xno"; then + ac_qt5="yes" +fi +if test "x$ac_qt5" = "xyes"; then + ac_qt4="no" +fi + # Enable libgig availability. AC_ARG_ENABLE(libgig, AC_HELP_STRING([--enable-libgig], [enable libgig interface (default=yes)]), @@ -45,9 +64,18 @@ # Standard installation base dirs. ac_with_paths="/usr /usr/local" +ac_qtdirs="qt" + +if test "x$ac_qt4" = "xyes"; then + ac_qtdirs="qt4 $ac_qtdirs" +fi +if test "x$ac_qt5" = "xyes"; then + ac_qtdirs="qt5 $ac_qtdirs" +fi + # Some a-la-debian alternatives... for X in /usr/lib /usr/lib64 /usr/share; do - for Y in qt qt4 qt5; do + for Y in $ac_qtdirs; do if test -d $X/$Y/bin; then ac_with_paths="$ac_with_paths $X/$Y" fi @@ -91,7 +119,7 @@ # ac_path="$X:$ac_path" # fi if test -d $X/include; then - for Y in qt qt4 qt5; do + for Y in $ac_qtdirs; do if test -d $X/include/$Y; then CFLAGS="-I$X/include/$Y $CFLAGS" CPPFLAGS="-I$X/include/$Y $CPPFLAGS" @@ -114,7 +142,7 @@ # Check for proper flags. ac_arch=`uname -m` -if test "$ac_arch" == "x86_64"; then +if test "x$ac_arch" = "xx86_64"; then CFLAGS="-fPIC $CFLAGS" CPPFLAGS="-fPIC $CPPFLAGS" fi