2002-04-25 Mike Kestner <mkestner@speakeasy.net>
* autogen.sh : simple config for the glue build * configure.in : simple config for the glue build * makefile : add glue dir to build * glib/SList.cs : Fix some leakage. * glue/value.c : a helper function for heap alloc of GValues * glue/Makefile.am : build for libgtksharpglue svn path=/trunk/gtk-sharp/; revision=4042
This commit is contained in:
parent
b5c0054787
commit
fa98aa165a
9 changed files with 260 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
*.dll
|
*.dll
|
||||||
*.exe
|
*.exe
|
||||||
|
config.*
|
||||||
|
*.m4
|
||||||
|
libtool
|
||||||
|
ltconfig
|
||||||
|
ltmain.sh
|
||||||
|
stamp*
|
||||||
|
configure
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
2002-04-25 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
|
* autogen.sh : simple config for the glue build
|
||||||
|
* configure.in : simple config for the glue build
|
||||||
|
* makefile : add glue dir to build
|
||||||
|
* glib/SList.cs : Fix some leakage.
|
||||||
|
* glue/value.c : a helper function for heap alloc of GValues
|
||||||
|
* glue/Makefile.am : build for libgtksharpglue
|
||||||
|
|
||||||
2002-04-19 Mike Kestner <mkestner@speakeasy.net>
|
2002-04-19 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
* glib/SList.cs : A more sane approach.
|
* glib/SList.cs : A more sane approach.
|
||||||
|
|
103
autogen.sh
Executable file
103
autogen.sh
Executable file
|
@ -0,0 +1,103 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Run this to generate all the initial makefiles, etc.
|
||||||
|
# Ripped off from GNOME macros version
|
||||||
|
|
||||||
|
DIE=0
|
||||||
|
|
||||||
|
srcdir=`dirname $0`
|
||||||
|
test -z "$srcdir" && srcdir=.
|
||||||
|
|
||||||
|
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||||
|
echo
|
||||||
|
echo "**Error**: You must have \`autoconf' installed to compile Gtk#."
|
||||||
|
echo "Download the appropriate package for your distribution,"
|
||||||
|
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||||
|
DIE=1
|
||||||
|
}
|
||||||
|
|
||||||
|
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
|
||||||
|
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
||||||
|
echo
|
||||||
|
echo "**Error**: You must have \`libtool' installed to compile Gtk#."
|
||||||
|
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
|
||||||
|
echo "(or a newer version if it is available)"
|
||||||
|
DIE=1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||||
|
echo
|
||||||
|
echo "**Error**: You must have \`automake' installed to compile Gtk#."
|
||||||
|
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
|
||||||
|
echo "(or a newer version if it is available)"
|
||||||
|
DIE=1
|
||||||
|
NO_AUTOMAKE=yes
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# if no automake, don't bother testing for aclocal
|
||||||
|
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
|
||||||
|
echo
|
||||||
|
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
|
||||||
|
echo "installed doesn't appear recent enough."
|
||||||
|
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
|
||||||
|
echo "(or a newer version if it is available)"
|
||||||
|
DIE=1
|
||||||
|
}
|
||||||
|
|
||||||
|
if test "$DIE" -eq 1; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$*"; then
|
||||||
|
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||||
|
echo "If you wish to pass any to it, please specify them on the"
|
||||||
|
echo \`$0\'" command line."
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $CC in
|
||||||
|
xlc )
|
||||||
|
am_opt=--include-deps;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
|
||||||
|
if test -z "$NO_LIBTOOLIZE" ; then
|
||||||
|
echo "Running libtoolize..."
|
||||||
|
libtoolize --force --copy
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Running aclocal $ACLOCAL_FLAGS ..."
|
||||||
|
aclocal $ACLOCAL_FLAGS || {
|
||||||
|
echo
|
||||||
|
echo "**Error**: aclocal failed. This may mean that you have not"
|
||||||
|
echo "installed all of the packages you need, or you may need to"
|
||||||
|
echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
|
||||||
|
echo "for the prefix where you installed the packages whose"
|
||||||
|
echo "macros were not found"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
|
||||||
|
echo "Running autoheader..."
|
||||||
|
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Running automake --gnu $am_opt ..."
|
||||||
|
automake --add-missing --gnu $am_opt ||
|
||||||
|
{ echo "**Error**: automake failed."; exit 1; }
|
||||||
|
echo "Running autoconf ..."
|
||||||
|
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
|
||||||
|
|
||||||
|
|
||||||
|
conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||||
|
|
||||||
|
if test x$NOCONFIGURE = x; then
|
||||||
|
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||||
|
$srcdir/configure $conf_flags "$@" \
|
||||||
|
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
|
||||||
|
else
|
||||||
|
echo Skipping configure process.
|
||||||
|
fi
|
85
configure.in
Normal file
85
configure.in
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
|
||||||
|
AC_INIT(README)
|
||||||
|
AC_CANONICAL_SYSTEM
|
||||||
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
AM_INIT_AUTOMAKE(gtk-sharp, 0.2)
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
|
AC_CHECK_TOOL(CC, gcc, gcc)
|
||||||
|
AC_PROG_CC
|
||||||
|
AM_PROG_CC_STDC
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
|
dnl may require a specific autoconf version
|
||||||
|
dnl AC_PROG_CC_FOR_BUILD
|
||||||
|
dnl CC_FOR_BUILD not automatically detected
|
||||||
|
CC_FOR_BUILD=$CC
|
||||||
|
BUILD_EXEEXT=
|
||||||
|
if test "x$cross_compiling" = "xyes"; then
|
||||||
|
CC_FOR_BUILD=cc
|
||||||
|
BUILD_EXEEXT=""
|
||||||
|
fi
|
||||||
|
AC_SUBST(CC_FOR_BUILD)
|
||||||
|
AC_SUBST(HOST_CC)
|
||||||
|
AC_SUBST(BUILD_EXEEXT)
|
||||||
|
|
||||||
|
# Set STDC_HEADERS
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
|
# not 64 bit clean in cross-compile
|
||||||
|
AC_CHECK_SIZEOF(void *, 4)
|
||||||
|
|
||||||
|
CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wshadow -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
|
||||||
|
|
||||||
|
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||||
|
if test "x$PKG_CONFIG" = "xno"; then
|
||||||
|
AC_MSG_ERROR([You need to install pkg-config])
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl for use on the build system
|
||||||
|
dnl pkg-config is stupid
|
||||||
|
BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
|
||||||
|
BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
|
||||||
|
AC_SUBST(BUILD_GLIB_CFLAGS)
|
||||||
|
AC_SUBST(BUILD_GLIB_LIBS)
|
||||||
|
|
||||||
|
PKG_PATH=
|
||||||
|
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
|
||||||
|
if test x$with_crosspkgdir = "x"; then
|
||||||
|
if test -s $PKG_CONFIG_PATH; then
|
||||||
|
PKG_PATH=$PKG_CONFIG_PATH
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
PKG_PATH=$with_crosspkgdir
|
||||||
|
PKG_CONFIG_PATH=$PKG_PATH
|
||||||
|
export PKG_CONFIG_PATH
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
|
## Versions of dependencies
|
||||||
|
GLIB_REQUIRED_VERSION=2.0.0
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
|
||||||
|
|
||||||
|
GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
|
||||||
|
GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
|
||||||
|
GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
|
||||||
|
GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
|
||||||
|
|
||||||
|
AC_SUBST(GLIB_CFLAGS)
|
||||||
|
AC_SUBST(GLIB_LIBS)
|
||||||
|
AC_SUBST(GMODULE_CFLAGS)
|
||||||
|
AC_SUBST(GMODULE_LIBS)
|
||||||
|
|
||||||
|
AC_SUBST(CFLAGS)
|
||||||
|
|
||||||
|
AC_OUTPUT([
|
||||||
|
glue/Makefile
|
||||||
|
])
|
||||||
|
|
||||||
|
echo "
|
||||||
|
|
||||||
|
Now do a "make linux" or "make windows" to build Gtk#.
|
||||||
|
|
||||||
|
"
|
|
@ -20,6 +20,17 @@ namespace GLib {
|
||||||
|
|
||||||
public class SList : ArrayList {
|
public class SList : ArrayList {
|
||||||
|
|
||||||
|
private IntPtr list_ptr;
|
||||||
|
|
||||||
|
[DllImport("gobject-2.0")]
|
||||||
|
static extern void g_slist_free(IntPtr l);
|
||||||
|
|
||||||
|
~SList ()
|
||||||
|
{
|
||||||
|
if (list_ptr != IntPtr.Zero)
|
||||||
|
g_slist_free (list_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle Property
|
/// Handle Property
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -33,6 +44,9 @@ namespace GLib {
|
||||||
|
|
||||||
public IntPtr Handle {
|
public IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
|
if (list_ptr != IntPtr.Zero)
|
||||||
|
g_slist_free (list_ptr);
|
||||||
|
|
||||||
IntPtr l = IntPtr.Zero;
|
IntPtr l = IntPtr.Zero;
|
||||||
foreach (object o in this) {
|
foreach (object o in this) {
|
||||||
IntPtr data = IntPtr.Zero;
|
IntPtr data = IntPtr.Zero;
|
||||||
|
@ -41,9 +55,10 @@ namespace GLib {
|
||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list_ptr = l;
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
6
glue/.cvsignore
Normal file
6
glue/.cvsignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
*.lo
|
||||||
|
*.la
|
||||||
|
Makefile.in
|
||||||
|
Makefile
|
||||||
|
.deps
|
||||||
|
.libs
|
13
glue/Makefile.am
Normal file
13
glue/Makefile.am
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
lib_LTLIBRARIES = libgtksharpglue.la
|
||||||
|
|
||||||
|
INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
|
||||||
|
|
||||||
|
libgtksharpglue_la_SOURCES = \
|
||||||
|
value.c \
|
||||||
|
#
|
||||||
|
|
||||||
|
libgtksharpglue.dll: $(libgtksharpglue_la_OBJECTS) libgtksharpglue.rc libgtksharpglue.def
|
||||||
|
./build-dll libgtksharpglue 0.1
|
||||||
|
|
||||||
|
CLEANFILES = lib*.a lib*.dll
|
||||||
|
|
18
glue/value.c
Normal file
18
glue/value.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/* value.c : Glue to allocate GValues on the heap.
|
||||||
|
*
|
||||||
|
* Author: Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
*
|
||||||
|
* <c> 2002 Mike Kestner
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
GValue *
|
||||||
|
gtksharp_value_create (GType g_type)
|
||||||
|
{
|
||||||
|
GValue *val = g_new0 (GValue, 1);
|
||||||
|
val = g_value_init (val, g_type);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
4
makefile
4
makefile
|
@ -15,7 +15,9 @@ windows:
|
||||||
unix:
|
unix:
|
||||||
@echo "'make unix' is broken for now."
|
@echo "'make unix' is broken for now."
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
|
(cd glue;make) || exit 1
|
||||||
for i in $(DIRS); do \
|
for i in $(DIRS); do \
|
||||||
(cd $$i; MCS="$(MCS)" make linux) || exit 1;\
|
(cd $$i; MCS="$(MCS)" make linux) || exit 1;\
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue