--- qsampler/trunk/configure.ac 2014/01/24 16:34:11 2511 +++ qsampler/trunk/configure.ac 2014/06/16 19:31:33 2642 @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Qsampler, 0.2.3.1, rncbc@rncbc.org, qsampler) +AC_INIT(Qsampler, 0.2.3.9, rncbc@rncbc.org, qsampler) AC_CONFIG_SRCDIR(src/qsampler.cpp) AC_CONFIG_HEADERS(src/config.h) @@ -62,7 +62,11 @@ # Standard installation base dirs. -ac_with_paths="/usr /usr/local" +if test "$cross_compiling" = yes; then + ac_with_paths="" +else + ac_with_paths="/usr /usr/local" +fi # Set for alternate Qt installation dir. AC_ARG_WITH(qt, @@ -79,6 +83,12 @@ AC_HELP_STRING([--with-libgig=PATH], [use alternate libgig install path]), [ac_with_paths="$ac_with_paths $withval"]) + +# Honor user specified flags. +ac_cflags=$CFLAGS +ac_ldflags=$LDFLAGS + + # Checks for programs. AC_PROG_CC AC_PROG_CPP @@ -90,6 +100,7 @@ AC_LANG_C AC_LANG_CPLUSPLUS +PKG_PROG_PKG_CONFIG # Check for proper flags. ac_arch=`uname -m` @@ -343,29 +354,15 @@ # Check for optional libraries. if test "x$ac_libgig" = "xyes"; then - AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"]) + PKG_CHECK_MODULES(LIBGIG, gig >= 3.3.0, [ac_libgig="yes"], [ac_libgig="no"]) + AC_SUBST(LIBGIG_CFLAGS) + AC_SUBST(LIBGIG_LIBS) + ac_cflags="$ac_cflags $LIBGIG_CFLAGS" + ac_libs="$ac_libs $LIBGIG_LIBS" if test "x$ac_libgig" = "xyes"; then AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) - ac_libs="$ac_libs -lgig" - AC_MSG_CHECKING([for gig::File::SetAutoLoad() method in libgig]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - CXXFLAGS="$ac_libs" - AC_TRY_COMPILE([ -#include -#include - ],[ - gig::File file; - file.SetAutoLoad(false); - ], - have_libgig_setautoload="yes", - have_libgig_setautoload="no" - ) - AC_LANG_RESTORE - AC_MSG_RESULT([$have_libgig_setautoload]) - if test "x$have_libgig_setautoload" = "xyes"; then - AC_DEFINE(HAVE_LIBGIG_SETAUTOLOAD, 1, [Define if libgig provides gig::File::SetAutoLoad() method.]) - fi + AC_DEFINE(HAVE_LIBGIG_SETAUTOLOAD, 1, [Define if libgig provides gig::File::SetAutoLoad() method.]) + have_libgig_setautoload="yes" fi fi @@ -387,6 +384,8 @@ AC_SUBST(ac_libs) AC_SUBST(ac_incpath) +AC_SUBST(ac_cflags) +AC_SUBST(ac_ldflags) # Checks for header files. AC_HEADER_STDC