jamulus/configure.in
Volker Fischer 9673af8745 new version
2009-07-08 18:53:37 +00:00

104 lines
2.8 KiB
Text
Executable file

dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(src/main.cpp)
AM_INIT_AUTOMAKE(llcon,2.3.1cvs)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_SUBST(LIBTOOL_DEPS)
AC_PROG_MAKE_SET
AC_CHECK_PROGS(RPMBUILD, rpmbuild, rpm)
dnl Configuration Arguments
AC_ARG_ENABLE( sound,[ --enable-sound generic sound support], enable_sound=$enableval, enable_sound=yes)
AC_ARG_ENABLE( alsa,[ --enable-alsa use ALSA interface], enable_alsa=$enableval, enable_alsa=no)
if test "$enable_alsa" = "yes"; then
dnl checks for ALSA audio
AC_CHECK_HEADER(sys/asoundlib.h, , enable_sound=no)
AC_CHECK_LIB(asound, snd_pcm_open, , enable_sound=no)
else
dnl checks for JACK audio
AC_CHECK_HEADER([jack/jack.h], have_jack=yes, have_jack=no, [
])
dnl AM_CONDITIONAL(USE_JACK,test "$have_jack" = yes)
if test "$have_jack" = yes; then
JACK_LIB="-ljack"
AC_DEFINE(USE_JACK, 1,[Define to enable JACK input module])
fi
fi
if test "$enable_sound" = "yes"; then
AC_DEFINE(WITH_SOUND, 1, [Define if you want to use sound])
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_LANG_CPLUSPLUS
dnl Checks for some external libraries that need to be installed
AC_LANG(C++)
dnl QT4 -------------------------------------------------------------------------
dnl The QT4 check code was taken from the FreeMat-3.0 code by Samit Basu
PKG_CHECK_MODULES(QT, QtCore QtGui QtNetwork QtXml >= 4.0.1, HAVE_QT4="yes", HAVE_QT4="no")
if test "x$HAVE_QT4" = "xyes"; then
dnl Check needed because in some cases the QtGui includedir
dnl doesn't contain the subsystem dir.
QT_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir QtGui)
EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
AC_MSG_WARN([QWidget not found])))
AC_CHECK_PROGS(QT_MOC, [moc4 moc-qt4 moc], [])
AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], [])
AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], [])
if (test "$QT_MOC" = ""); then
AC_MSG_ERROR([QT4 moc is required.])
fi
if (test "$QT_RCC" = ""); then
AC_MSG_ERROR([QT4 rcc is required.])
fi
if (test "$QT_UIC" = ""); then
AC_MSG_ERROR([QT4 uic is required.])
fi
QT_LIB="-lQtCore -lQtGui -lQtNetwork -lQtXml"
fi
QT_LIBS="$QT_LIB"
QT_LDADD="-L$QTDIR/lib $QT_LIBS"
JACK_LIBS="$JACK_LIB"
JACK_LDADD="$JACK_LIBS"
LDFLAGS="$QT_LDADD $JACK_LDADD $LDFLAGS"
AC_MSG_NOTICE([Set LDFLAGS... $LDFLAGS])
AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
AC_SUBST(QT_MOC)
AC_SUBST(QT_RCC)
AC_SUBST(QT_UIC)
AC_CONFIG_FILES(Makefile linux/Makefile)
AC_OUTPUT