summaryrefslogtreecommitdiffstats
path: root/avahi-qt
diff options
context:
space:
mode:
authorJakub Stachowski <qbast@go2.pl>2005-08-29 22:35:06 +0000
committerJakub Stachowski <qbast@go2.pl>2005-08-29 22:35:06 +0000
commit4ddfb3cc4ac10efff11fc58693ae2aacf592fb73 (patch)
tree6de976ac6e5e9fe6bb5535e583bb408398990b7e /avahi-qt
parent520f6eb0e117cc9010a307cf1ec9237188e663ee (diff)
Include qt mainloop adapter in build system. Moc finding code is cracktastic thanks to
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
Diffstat (limited to 'avahi-qt')
-rw-r--r--avahi-qt/Makefile.am53
-rw-r--r--avahi-qt/qt-watch.cpp8
-rw-r--r--avahi-qt/qt-watch.h2
3 files changed, 60 insertions, 3 deletions
diff --git a/avahi-qt/Makefile.am b/avahi-qt/Makefile.am
new file mode 100644
index 0000000..ebf454c
--- /dev/null
+++ b/avahi-qt/Makefile.am
@@ -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
diff --git a/avahi-qt/qt-watch.cpp b/avahi-qt/qt-watch.cpp
index 407a905..c5052fd 100644
--- a/avahi-qt/qt-watch.cpp
+++ b/avahi-qt/qt-watch.cpp
@@ -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
diff --git a/avahi-qt/qt-watch.h b/avahi-qt/qt-watch.h
index 05b5010..bbcf30c 100644
--- a/avahi-qt/qt-watch.h
+++ b/avahi-qt/qt-watch.h
@@ -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