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.
This commit is contained in:
Havoc Pennington 2003-06-22 05:53:06 +00:00
parent 8e99e853a7
commit 93b5a19c9f
10 changed files with 225 additions and 3 deletions

View file

@ -1,3 +1,10 @@
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.

View file

@ -8,7 +8,16 @@ if HAVE_QT
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)

View file

@ -33,7 +33,8 @@ AC_ARG_ENABLE(checks, [ --enable-checks include sanity checks o
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])
@ -134,6 +135,63 @@ else
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"
@ -736,6 +794,8 @@ Makefile
dbus/Makefile
glib/Makefile
qt/Makefile
gcj/Makefile
mono/Makefile
bus/Makefile
tools/Makefile
test/Makefile
@ -765,8 +825,29 @@ echo "
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}

13
gcj/.cvsignore Normal file
View file

@ -0,0 +1,13 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la
dbus-test
*.bb
*.bbg
*.gcov
*.da
dbus-arch-deps.h
.dbus-keyrings

6
gcj/Hello.java Normal file
View file

@ -0,0 +1,6 @@
class Hello {
public static void main(String[] args) {
System.out.println("Hello World!"); //Display the string.
}
}

5
gcj/Makefile.am Normal file
View file

@ -0,0 +1,5 @@
noinst_PROGRAMS=hello
hello_SOURCES=Hello.java
hello_LDFLAGS=--main=Hello

14
mono/.cvsignore Normal file
View file

@ -0,0 +1,14 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la
*.bb
*.bbg
*.gcov
*.da
.dbus-keyrings
*.dll
*.exe
test-dbus-sharp

25
mono/Makefile.am Normal file
View file

@ -0,0 +1,25 @@
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)

50
mono/Message.cs Normal file
View file

@ -0,0 +1,50 @@
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);
}
}

12
mono/Test.cs Normal file
View file

@ -0,0 +1,12 @@
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);
}
}