+2003-06-22 Havoc Pennington <hp@pobox.com>
+
+ * mono/*, gcj/*, configure.in, Makefile.am:
+ Check in makefiles and subdirs for mono and gcj bindings.
+ Neither binding actually exists, just trying to get through
+ all the build and other boring bits.
+
2003-06-21 Philip Blundell <philb@gnu.org>
* tools/dbus-monitor.1: Updated.
QT_SUBDIR=qt
endif
-SUBDIRS=dbus bus test doc $(GLIB_SUBDIR) $(QT_SUBDIR) tools
+if DBUS_USE_GCJ
+ GCJ_SUBDIR=gcj
+endif
+
+if DBUS_USE_MCS
+ MONO_SUBDIR=mono
+endif
+
+
+SUBDIRS=dbus bus test doc $(GLIB_SUBDIR) $(GCJ_SUBDIR) $(MONO_SUBDIR) $(QT_SUBDIR) tools
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dbus-1.pc $(GLIB_PC)
AC_ARG_ENABLE(docs, [ --enable-docs build documentation (requires Doxygen and jade)],enable_docs=$enableval,enable_docs=auto)
AC_ARG_ENABLE(gcov, [ --enable-gcov compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
AC_ARG_ENABLE(abstract-sockets, [ --enable-abstract-sockets use abstract socket namespace (linux only)],enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
-
+AC_ARG_ENABLE(gcj, [ --enable-gcj build gcj bindings],enable_gcj=$enableval,enable_gcj=no)
+AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings],enable_mono=$enableval,enable_mono=no)
AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
fi
fi
+#### can't use AM_PROG_GCJ since it fails fatally if no gcj found
+AC_CHECK_PROGS(GCJ, gcj, gcj)
+if test -z "$GCJ" ; then
+ have_gcj=no
+else
+ have_gcj=yes
+ if test "x${GCJFLAGS-unset}" = xunset; then
+ GCJFLAGS="-g -O2 -Wall"
+ fi
+ AC_SUBST(GCJFLAGS)
+ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(GCJ)])
+fi
+
+if test x$enable_gcj = xauto ; then
+ if test x$have_gcj = xno ; then
+ enable_gcj=no
+ else
+ enable_gcj=yes
+ fi
+fi
+
+if test x$enable_gcj = xyes; then
+ if test x$have_gcj = xno ; then
+ AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
+ fi
+fi
+
+AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
+
+#### Look for mono
+AC_CHECK_TOOL(MCS, mcs, mcs)
+if test -z "$MCS" ; then
+ have_mcs=no
+else
+ have_mcs=yes
+ if test "x${MCSFLAGS-unset}" = xunset; then
+ MCSFLAGS="" ### put default MCSFLAGS here
+ fi
+ AC_SUBST(MCSFLAGS)
+fi
+
+if test x$enable_mono = xauto ; then
+ if test x$have_mcs = xno ; then
+ enable_mono=no
+ else
+ enable_mono=yes
+ fi
+fi
+
+if test x$enable_mono = xyes; then
+ if test x$have_mcs = xno ; then
+ AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
+ fi
+fi
+
+AM_CONDITIONAL(DBUS_USE_MCS, test x$enable_mono = xyes)
+
changequote(,)dnl
# let ourselves use our own unstable API
CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
dbus/Makefile
glib/Makefile
qt/Makefile
+gcj/Makefile
+mono/Makefile
bus/Makefile
tools/Makefile
test/Makefile
cppflags: ${CPPFLAGS}
cxxflags: ${CXXFLAGS}
Doxygen: ${DOXYGEN}
- db2html: ${DB2HTML}
+ db2html: ${DB2HTML}"
+
+if test x$enable_gcj = xyes ; then
+echo \
+" gcj: ${GCJ}
+ gcjflags: ${GCJFLAGS}"
+else
+echo \
+" gcj: (not enabled)"
+fi
+
+if test x$enable_mono = xyes ; then
+echo \
+" mcs: ${MCS}
+ mcsflags: ${MCSFLAGS}
+"
+else
+echo \
+" mcs: (not enabled)
+"
+fi
+echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
gcc coverage profiling: ${enable_gcov}
Building unit tests: ${enable_tests}
--- /dev/null
+.deps
+.libs
+Makefile
+Makefile.in
+*.lo
+*.la
+dbus-test
+*.bb
+*.bbg
+*.gcov
+*.da
+dbus-arch-deps.h
+.dbus-keyrings
--- /dev/null
+
+class Hello {
+ public static void main(String[] args) {
+ System.out.println("Hello World!"); //Display the string.
+ }
+}
\ No newline at end of file
--- /dev/null
+noinst_PROGRAMS=hello
+
+hello_SOURCES=Hello.java
+
+hello_LDFLAGS=--main=Hello
--- /dev/null
+.deps
+.libs
+Makefile
+Makefile.in
+*.lo
+*.la
+*.bb
+*.bbg
+*.gcov
+*.da
+.dbus-keyrings
+*.dll
+*.exe
+test-dbus-sharp
--- /dev/null
+DESTDIR=
+
+DLLS=dbus-sharp.dll
+NOINST_EXES=test-dbus-sharp
+
+DBUS_SHARP_FILES=Message.cs
+TEST_DBUS_SHARP_FILES=Test.cs
+
+all: $(DLLS) $(NOINST_EXES)
+
+dbus-sharp.dll: $(DBUS_SHARP_FILES)
+ $(MCS) $(MCSFLAGS) --unsafe --target library -o dbus-sharp.dll --recurse '$(DBUS_SHARP_FILES)'
+
+test-dbus-sharp: $(TEST_DBUS_SHARP_FILES)
+ $(MCS) $(MCSFLAGS) --unsafe --target exe -L . -r dbus-sharp.dll -o test-dbus-sharp --recurse '$(TEST_DBUS_SHARP_FILES)'
+
+clean:
+ rm -f $(DLLS) $(NOINST_EXES)
+
+install: all
+ ../mkinstalldirs $(DESTDIR)$(prefix)/lib && \
+ cp $(DLLS) $(DESTDIR)$(prefix)/lib || exit 1
+
+EXTRA_DIST=$(DBUS_SHARP_FILES)
+
--- /dev/null
+namespace DBus {
+
+ using System;
+ using System.Runtime.InteropServices;
+
+ public class Message {
+
+ public Message (string name,
+ string dest_service) {
+ raw = dbus_message_new (name, dest_service);
+ }
+
+ public string Name {
+ get {
+ return dbus_message_get_name (raw);
+ }
+ }
+
+ IntPtr raw;
+
+ ~Message () {
+ dbus_message_unref (raw);
+ }
+
+ Message (IntPtr r) {
+ raw = r;
+ dbus_message_ref (r);
+ }
+
+ // static constructor runs before any methods
+ static Message () {
+
+ }
+
+ const string libname = "libdbus-1.so.0";
+
+ [DllImport (libname, EntryPoint="dbus_message_new")]
+ private extern static IntPtr dbus_message_new (string name,
+ string dest_service);
+
+ [DllImport (libname, EntryPoint="dbus_message_unref")]
+ private extern static void dbus_message_unref (IntPtr ptr);
+
+ [DllImport (libname, EntryPoint="dbus_message_ref")]
+ private extern static void dbus_message_ref (IntPtr ptr);
+
+ [DllImport (libname, EntryPoint="dbus_message_get_name")]
+ private extern static string dbus_message_get_name (IntPtr ptr);
+ }
+}
--- /dev/null
+
+using System;
+
+class Test {
+ static void Main() {
+ DBus.Message m;
+
+ m = new DBus.Message ("org.freedesktop.Foo", null);
+
+ Console.WriteLine ("Message name is {0}\n", m.Name);
+ }
+}