diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-14 14:24:34 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-14 14:24:34 +0200 |
commit | 0ff825e0e6fe5fc7238e3964d24779a07cb53518 (patch) | |
tree | 7b47a9fe58a09e12ed99fdfacc84fff198ce5ce1 /configure.in | |
parent | 29ae5ac36d4ffc520232ff393b2455130ec0227e (diff) |
Split miav server and client apart. Port client to Qt4. Replace libraw1994 with libiec61883. Add unit tests for multiplexer and fix some bugs in it.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 187 |
1 files changed, 122 insertions, 65 deletions
diff --git a/configure.in b/configure.in index 2d5721a..d72b88d 100644 --- a/configure.in +++ b/configure.in @@ -9,33 +9,53 @@ AM_PROG_LIBTOOL AM_CONFIG_HEADER(config.h) AC_STDC_HEADERS -CXXFLAGS="$CXXFLAGS -Wall -Werror" + +#################### +# Setup debug flags +AC_ARG_WITH(debug, [ --with-debug build with debug support]) +if test x$with_debug == xyes; then + AC_MSG_WARN([*** Building with debug support!]) + CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Werror -g" + AC_DEFINE_UNQUOTED(WITH_DEBUG, , + [The project is configured to use debug output]) +fi + +dnl ====================== +dnl Init pkg-config +dnl ====================== +PKG_PROG_PKG_CONFIG(0.23) AC_ARG_WITH(gui, [ --without-gui build without GUI support]) if test x$with_gui != xno && test -z "$GUI"; then - dnl ===================== - dnl Check for QT library - dnl ===================== - gw_CHECK_QT - CXXFLAGS="$CXXFLAGS $QT_CXXLAGS" - LDFLAGS="$LDFLAGS $QT_LDADD" + dnl ====================== + dnl Check for Qt + dnl ====================== + PKG_CHECK_MODULES(QT, QtCore QtGui QtNetwork >= 4.5) + 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 dnl ===================== dnl Check for SDL library dnl ===================== SDL_VERSION=1.2.0 AM_PATH_SDL($SDL_VERSION,:,AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])) - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LDFLAGS="$LDFLAGS $SDL_LIBS" + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) dnl ====================== - dnl Check for raw1394 library + dnl Check for iec61883 library dnl ====================== - AC_CHECK_HEADER(libraw1394/raw1394.h, , AC_MSG_ERROR([*** libraw1394 headers not found!])) - AC_CHECK_LIB(raw1394, raw1394_get_userdata, , AC_MSG_ERROR([*** libraw1394 not found!])) - - dnl Make code aware of the gui - AC_DEFINE([USE_GUI], [], [Is defined if the project is configured to compile with gui]) + PKG_CHECK_MODULES(IEC61883, libiec61883 >= 1.2) else AC_MSG_WARN([*** Building without GUI support!]) fi @@ -43,81 +63,118 @@ fi dnl ====================== dnl Check for pthread library dnl ====================== +tmp_CXXFLAGS="$CXXFLAGS" +tmp_CPPFLAGS="$CPPFLAGS" +tmp_CFLAGS="$CFLAGS" +tmp_LDFLAGS="$LDFLAGS" +tmp_LIBS="$LIBS" +CXXFLAGS="" +CPPFLAGS="" +CFLAGS="" +LDFLAGS="" +LIBS="" AC_CHECK_HEADER(pthread.h, , AC_MSG_ERROR([*** pthread headers not found!])) AC_CHECK_LIB(pthread, sem_init, , AC_MSG_ERROR([*** libpthread not found!])) +PTHREAD_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" +PTHREAD_LIBS="$LDFLAGS $LIBS" +CXXFLAGS="$tmp_CXXFLAGS" +CPPFLAGS="$tmp_CPPFLAGS" +CFLAGS="$tmp_CFLAGS" +LDFLAGS="$tmp_LDFLAGS" +LIBS="$tmp_LIBS" +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_LIBS) dnl ====================== dnl Check for dv library dnl ====================== -AC_CHECK_HEADER(libdv/dv.h, , AC_MSG_ERROR([*** libdv headers not found!])) -AC_CHECK_LIB(dv, dv_decode_full_frame, , AC_MSG_ERROR([*** libdv not found!])) +PKG_CHECK_MODULES(DV, libdv >= 1.0) dnl ====================== dnl Check for Jpeg library dnl ====================== +tmp_CXXFLAGS="$CXXFLAGS" +tmp_CPPFLAGS="$CPPFLAGS" +tmp_CFLAGS="$CFLAGS" +tmp_LDFLAGS="$LDFLAGS" +tmp_LIBS="$LIBS" +CXXFLAGS="" +CPPFLAGS="" +CFLAGS="" +LDFLAGS="" +LIBS="" AC_CHECK_HEADER(jpeglib.h, , AC_MSG_ERROR([*** libJpeg not found!])) AC_CHECK_LIB(jpeg, jpeg_start_compress, , AC_MSG_ERROR([*** libJpeg not found!])) +JPEG_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" +JPEG_LIBS="$LDFLAGS $LIBS" +CXXFLAGS="$tmp_CXXFLAGS" +CPPFLAGS="$tmp_CPPFLAGS" +CFLAGS="$tmp_CFLAGS" +LDFLAGS="$tmp_LDFLAGS" +LIBS="$tmp_LIBS" +AC_SUBST(JPEG_CFLAGS) +AC_SUBST(JPEG_LIBS) dnl ====================== dnl Check for Fame library dnl ====================== +tmp_CXXFLAGS="$CXXFLAGS" +tmp_CPPFLAGS="$CPPFLAGS" +tmp_CFLAGS="$CFLAGS" +tmp_LDFLAGS="$LDFLAGS" +tmp_LIBS="$LIBS" +CXXFLAGS="" +CPPFLAGS="" +CFLAGS="" +LDFLAGS="" +LIBS="" AC_CHECK_HEADER(fame.h, , AC_MSG_ERROR([*** libFAME include files not found!])) AC_CHECK_LIB(fame, fame_init, , AC_MSG_ERROR([*** libFAME not found!])) +FAME_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" +FAME_LIBS="$LDFLAGS $LIBS" +CXXFLAGS="$tmp_CXXFLAGS" +CPPFLAGS="$tmp_CPPFLAGS" +CFLAGS="$tmp_CFLAGS" +LDFLAGS="$tmp_LDFLAGS" +LIBS="$tmp_LIBS" +AC_SUBST(FAME_CFLAGS) +AC_SUBST(FAME_LIBS) dnl ====================== dnl Check for Lame library dnl ====================== +tmp_CXXFLAGS="$CXXFLAGS" +tmp_CPPFLAGS="$CPPFLAGS" +tmp_CFLAGS="$CFLAGS" +tmp_LDFLAGS="$LDFLAGS" +tmp_LIBS="$LIBS" +CXXFLAGS="" +CPPFLAGS="" +CFLAGS="" +LDFLAGS="" +LIBS="" AC_CHECK_HEADER(lame/lame.h, , AC_MSG_ERROR([*** libLAME (libmp3lame) include files not found!])) AC_CHECK_LIB(mp3lame, lame_init, , AC_MSG_ERROR([*** libLAME (libmp3lame) not found!])) +LAME_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" +LAME_LIBS="$LDFLAGS $LIBS" +CXXFLAGS="$tmp_CXXFLAGS" +CPPFLAGS="$tmp_CPPFLAGS" +CFLAGS="$tmp_CFLAGS" +LDFLAGS="$tmp_LDFLAGS" +LIBS="$tmp_LIBS" +AC_SUBST(LAME_CFLAGS) +AC_SUBST(LAME_LIBS) -#dnl ====================== -#dnl Check for mplex library -#dnl ====================== -#PKG_CHECK_MODULES(MPLEX, mjpegtools >= 1.6.1.93, [ -# dnl switch over to c++ to test things -# AC_LANG_CPLUSPLUS -# OLD_CPPFLAGS="$CPPFLAGS" -# CPPFLAGS="$CPPFLAGS $MPLEX_CFLAGS" -# AC_CHECK_HEADER(interact.hpp, [ -# MPLEX_LIBS="$MPLEX_LIBS -lmplex2 -lm" -# OLD_LIBS="$LIBS" -# LIBS="$LIBS $MPLEX_LIBS" -# AC_MSG_CHECKING([for valid mplex objects]) -# AC_TRY_RUN([ -##include <interact.hpp> -##include <outputstrm.hpp> -##include <multiplexor.hpp> -# -#int main (int argc, char *argv[]) -#{ -# class TestOutputStream : public OutputStream { -# public: -# TestOutputStream () : OutputStream () { } -# void Write (uint8_t *a, unsigned int b) { } -# void NextSegment () { } -# off_t SegmentSize () { } -# void Close () { } -# int Open () { } -# }; -# MultiplexJob *job = new MultiplexJob (); -# vector<IBitStream *> inputs; -# job->SetupInputStreams (inputs); -# TestOutputStream *out = new TestOutputStream (); -# Multiplexor *mux = new Multiplexor(*job, *out); -# return 0; -#} -# ],[ -# HAVE_MPLEX="yes" -# AC_SUBST(MPLEX_CFLAGS) -# AC_SUBST(MPLEX_LIBS) -# AC_MSG_RESULT(yes) -# ], AC_MSG_RESULT(no)) -# #LIBS="$OLD_LIBS" -# ]) -# #CPPFLAGS="$OLD_CPPFLAGS" -# AC_LANG_C -# ], HAVE_MPLEX="no") -#AC_CHECK_LIB(mplex2, main, , AC_MSG_ERROR([*** libmplex2 not found (part of the mjpegtools package)!])) +################################## +# Check if tests should be built. +AC_ARG_WITH(test, + [ --with-test build tests (default=no)], + [], + [with_test=no]) +if test x$with_test == xyes; then + AM_PATH_CPPUNIT(1.9.6) + AC_CONFIG_FILES(test/Makefile) +fi AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) |