--- qsampler/trunk/configure.ac 2005/08/30 09:52:46 767 +++ qsampler/trunk/configure.ac 2006/12/22 01:31:28 1000 @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Qsampler, 0.1.2.12, rncbc@rncbc.org, qsampler) +AC_INIT(Qsampler, 0.1.3.14, rncbc@rncbc.org, qsampler) AC_CONFIG_SRCDIR(src/qsamplerMainForm.ui.h) AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES(Makefile qsampler.pro qsampler.spec) @@ -30,6 +30,16 @@ [ac_libgig="no"], [ac_libgig="yes"]) +# Set for alternate liblscp installation dir. +AC_ARG_WITH(liblscp, + AC_HELP_STRING([--with-liblscp=PATH], [use alternate liblscp install path]), + [ac_with_paths="$ac_with_paths $withval"]) + +# Set for alternate libgig installation dir. +AC_ARG_WITH(libgig, + AC_HELP_STRING([--with-libgig=PATH], [use alternate libgig install path]), + [ac_with_paths="$ac_with_paths $withval"]) + # Checks for programs. AC_PROG_CC AC_PROG_CPP @@ -41,6 +51,23 @@ AC_LANG_C AC_LANG_CPLUSPLUS +# Prepend alternate dependencies paths. +for X in $ac_with_paths; do + if test -d $X/include; then + CFLAGS="$CFLAGS -I$X/include" + CPPFLAGS="$CPPFLAGS -I$X/include" + ac_incpath="$X/include $ac_incpath" + fi + if test -d $X/lib64; then + LIBS="$LIBS -L$X/lib64" + ac_libs="$ac_libs -L$X/lib64" + fi + if test -d $X/lib; then + LIBS="$LIBS -L$X/lib" + ac_libs="-L$X/lib $ac_libs" + fi +done + # Check for QTDIR environment variable. AC_MSG_CHECKING([whether QTDIR environment variable is set]) if test "x$QTDIR" = "x"; then @@ -52,7 +79,11 @@ CFLAGS="$CFLAGS -I$QTDIR/include" CPPFLAGS="$CPPFLAGS -I$QTDIR/include" -LIBS="-L$QTDIR/lib" +if test -d $QTDIR/lib64; then + LIBS="$LIBS -L$QTDIR/lib64" +else + LIBS="$LIBS -L$QTDIR/lib" +fi for X in qt qt3; do if test -d $QTDIR/include/$X; then CFLAGS="$CFLAGS -I$QTDIR/include/$X" @@ -131,7 +162,7 @@ if test "x$ac_liblscp" = "xno"; then AC_MSG_ERROR([LSCP library not found.]) fi -ac_libs="-llscp" +ac_libs="$ac_libs -llscp" AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t], ac_instrument_name, [ @@ -162,26 +193,38 @@ AC_DEFINE(CONFIG_MUTE_SOLO, 1, [Define if mute/solo is available.]) fi +AC_CHECK_LIB(lscp, lscp_map_midi_instrument, [ac_midi_instrument="yes"], [ac_midi_instrument="no"]) +if test "x$ac_midi_instrument" = "xyes"; then + AC_DEFINE(CONFIG_MIDI_INSTRUMENT, 1, [Define if MIDI instrument mapping is available.]) +fi + # Check for optional libraries. if test "x$ac_libgig" = "xyes"; then AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"]) if test "x$ac_libgig" = "xyes"; then AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) - ac_libs="-lgig $ac_libs" + ac_libs="$ac_libs -lgig" fi fi +# Check for round math function. +AC_CHECK_LIB(m, lroundf, [ac_round="yes"], [ac_round="no"]) +if test "x$ac_round" = "xyes"; then + AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) +fi + AC_SUBST(ac_libs) +AC_SUBST(ac_incpath) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.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 +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 # Checks for typedefs, structures, and compiler characteristics. # AC_C_CONST