]> git.meshlink.io Git - catta/commitdiff
Include qt mainloop adapter in build system. Moc finding code is cracktastic thanks to
authorJakub Stachowski <qbast@go2.pl>
Mon, 29 Aug 2005 22:35:06 +0000 (22:35 +0000)
committerJakub Stachowski <qbast@go2.pl>
Mon, 29 Aug 2005 22:35:06 +0000 (22:35 +0000)
not providing its location in .pc file and debian that renames it to moc-qt3 and moc-qt4

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@495 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

Makefile.am
avahi-qt/Makefile.am [new file with mode: 0644]
avahi-qt/qt-watch.cpp
avahi-qt/qt-watch.h
configure.ac

index fd1930089194aae64c96b2e177549b2a80085f77..f22fa04d45406f8d4a8b7702545d787edb7ca1c6 100644 (file)
@@ -46,6 +46,7 @@ SUBDIRS = \
        avahi-glib \
        avahi-core \
        avahi-discover-standalone \
+       avahi-qt \
        avahi-client \
        avahi-daemon \
        initscript \
diff --git a/avahi-qt/Makefile.am b/avahi-qt/Makefile.am
new file mode 100644 (file)
index 0000000..ebf454c
--- /dev/null
@@ -0,0 +1,53 @@
+AM_CFLAGS=-I$(top_srcdir)
+
+avahiincludedir=$(includedir)/avahi-qt
+
+lib_LTLIBRARIES = 
+BUILT_SOURCES = 
+
+if HAVE_QT3
+
+avahiinclude_HEADERS = \
+       qt-watch.h 
+
+lib_LTLIBRARIES += \
+       libavahi-qt3.la
+
+BUILT_SOURCES += qt-watch.moc3
+
+libavahi_qt3_la_SOURCES = \
+       qt-watch.cpp 
+
+qt-watch.moc3: 
+       $(MOC_QT3) qt-watch.cpp > $@
+
+
+libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS)
+libavahi_qt3_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT3_LIBS)
+libavahi_qt3_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info 0:1:0
+
+endif
+
+
+if HAVE_QT4
+
+avahiinclude_HEADERS = \
+       qt-watch.h 
+
+lib_LTLIBRARIES += \
+       libavahi-qt4.la
+
+BUILT_SOURCES += qt-watch.moc4
+
+libavahi_qt4_la_SOURCES = \
+       qt-watch.cpp 
+
+qt-watch.moc4: 
+       $(MOC_QT4) qt-watch.cpp > $@
+
+
+libavahi_qt4_la_CPPFLAGS = $(AM_CFLAGS) $(QT4_CFLAGS) -DQT4
+libavahi_qt4_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT4_LIBS)
+libavahi_qt4_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info 0:1:0
+
+endif
\ No newline at end of file
index 407a9055a972c8f072d17202f404e62426a62e20..c5052fd411f875d720383701bf2e3ff4d8d09a95 100644 (file)
@@ -170,7 +170,7 @@ static void q_timeout_free(AvahiTimeout *t)
 
 static AvahiPoll qt_poll;
 
-const AvahiPoll* avahi_qt_poll_get() 
+const AvahiPoll* avahi_qt_poll_get(void
 {
     qt_poll.userdata=0;
     qt_poll.watch_new = q_watch_new;
@@ -184,4 +184,8 @@ const AvahiPoll* avahi_qt_poll_get()
     return &qt_poll;
 }
 
-#include "qt-watch.moc"
+#ifdef QT4
+#include "qt-watch.moc4"
+#else
+#include "qt-watch.moc3"
+#endif
index 05b5010c7e7c7709cde64fcc5e9202be9840dc35..bbcf30c111a27221c7e3e729d0813935e751859c 100644 (file)
@@ -29,7 +29,7 @@ AVAHI_C_DECL_BEGIN
 /**
 Setup abstract poll structure for integration with Qt main loop  */
 
-const AvahiPoll* avahi_qt_poll_get();
+const AvahiPoll* avahi_qt_poll_get(void);
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 AVAHI_C_DECL_END
index 0525ffb0b57fa37343fcbb01a632091b8f1f9f79..32364afa1fd25949ec8b35a66088e1db12160afb 100644 (file)
@@ -169,6 +169,59 @@ if test "x$HAVE_GLIB" = "xyes" ; then
 fi
 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
 
+#
+# Check for Qt 3
+#
+AC_ARG_ENABLE(qt3,
+        AS_HELP_STRING([--disable-qt3],[Disable building of Qt3 mainloop integration]),
+        [case "${enableval}" in
+                yes) HAVE_QT3=yes ;;
+                no)  HAVE_QT3=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt3) ;;
+        esac],
+        [HAVE_QT3=yes])
+
+if test "x$HAVE_QT3" = "xyes" ; then
+        PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ], [ 
+        AC_SUBST(QT3_CFLAGS)
+       AC_SUBST(QT3_LIBS)
+       QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
+        MOC_QT3="no"
+       AC_CHECK_FILE( "$QT3_PREFIX/moc-qt3", [ MOC_QT3=$QT3_PREFIX/moc-qt3 ], [
+           AC_CHECK_FILE("$QT3_PREFIX/moc", [ MOC_QT3=$QT3_PREFIX/moc ], [ HAVE_QT3=no ] ) 
+       ] )   
+       AC_SUBST(MOC_QT3)
+      ], [ HAVE_QT3=no ] )
+fi
+AM_CONDITIONAL(HAVE_QT3, test "x$HAVE_QT3" = "xyes")
+
+#
+# Check for Qt 4
+#
+AC_ARG_ENABLE(qt4,
+        AS_HELP_STRING([--disable-qt4],[Disable building of Qt4Core mainloop integration]),
+        [case "${enableval}" in
+                yes) HAVE_QT4=yes ;;
+                no)  HAVE_QT4=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt4) ;;
+        esac],
+        [HAVE_QT4=yes])
+
+if test "x$HAVE_QT4" = "xyes" ; then
+        PKG_CHECK_MODULES( QT4, [ QtCore >= 4.0.0 ], [ 
+        AC_SUBST(QT4_CFLAGS)
+       AC_SUBST(QT4_LIBS)
+       QT4_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
+        MOC_QT4="no"
+       AC_CHECK_FILE( "$QT4_PREFIX/moc-qt4", [ MOC_QT4=$QT4_PREFIX/moc-qt4 ], [
+           AC_CHECK_FILE("$QT4_PREFIX/moc", [ MOC_QT4=$QT4_PREFIX/moc ], [ HAVE_QT4=no ] ) 
+       ] )   
+       AC_SUBST(MOC_QT4)
+      ], [ HAVE_QT4=no ] )
+fi
+AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
+
+
 #
 # Check for GTK+
 #
@@ -375,6 +428,7 @@ Makefile
 avahi-common/Makefile 
 avahi-core/Makefile 
 avahi-glib/Makefile 
+avahi-qt/Makefile
 avahi-daemon/Makefile 
 avahi-daemon/avahi-dbus.conf
 avahi-discover-standalone/Makefile