jamulus/configure.in
2008-01-27 12:45:09 +00:00

120 lines
3.1 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,1.0cvs)
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)
dnl AC_ARG_WITH( qt4dir,[ --with-qtdir=path to QT],QT4DIR=$withval)
AC_CHECK_HEADER(sys/asoundlib.h, , enable_sound=no)
AC_CHECK_LIB(asound, snd_pcm_open, , enable_sound=no)
if test "$enable_sound" = "yes"; then
AC_DEFINE(WITH_SOUND, 1, [Define if you want to use sound])
fi
if test "$enable_client" = "yes"; then
AC_DEFINE(APPL_TYPE_CLIENT, 1, [Define if you want to use client])
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"
LDFLAGS="$QT_LDADD $LDFLAGS"
dnl FOO=`echo $QT_LIBS | sed -e 's/-L/-Wl,-rpath,/' | sed -e 's/-L.*//'`
dnl LDFLAGS="$LDFLAGS $FOO"
dnl LDFLAGS="-L/usr/lib $QT_LIBS $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)
dnl old QT2/QT3 code:
dnl if test "no$QTDIR" = "no"; then
dnl AC_MSG_ERROR( "*** Please set QTDIR ***" )
dnl fi
dnl
dnl saved_ldflags="$LDFLAGS"
dnl LDFLAGS="$LDFLAGS -L$QTDIR/lib"
dnl
dnl AC_HAVE_LIBRARY(qt-mt,,exit 1)
dnl
dnl AC_PATH_PROG(MOC, moc,, "$QTDIR/bin")
dnl if test -z "$MOC"; then
dnl AC_MSG_ERROR("No moc found in $QTDIR/bin");
dnl fi
dnl AC_PATH_PROG(UIC, uic,, "$QTDIR/bin")
dnl if test -z "$UIC"; then
dnl AC_MSG_ERROR("No uic found in $QTDIR/bin");
dnl fi
dnl AC_SUBST(QTDIR)
AC_CONFIG_FILES(Makefile linux/Makefile)
AC_OUTPUT