Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial import

svn path=/trunk/monoskel-gapi/; revision=102992
  • Loading branch information...
commit 60962f7c8d1d56580d66d6534c42cc17274c8f1c 0 parents
Everaldo Canuto authored
1  AUTHORS
@@ -0,0 +1 @@
+
1  ChangeLog
@@ -0,0 +1 @@
+
2  Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = sources samples doc
+
1  NEWS
@@ -0,0 +1 @@
+
1  README
@@ -0,0 +1 @@
+
4 autogen.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+autoreconf -i --force --warnings=none
+./configure --enable-maintainer-mode $*
162 configure.in
@@ -0,0 +1,162 @@
+AC_INIT(README)
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE(monoskel-sharp, 0.1)
+AM_MAINTAINER_MODE
+AC_PROG_INSTALL
+
+dnl Package settings
+ASSEMBLY_NAME=$PACKAGE
+ASSEMBLY_VERSION="1.0.0.0"
+ASSEMBLY_NAMESPACE="MonoSkel"
+ASSEMBLY_SHORTNAME="monoskel"
+ASSEMBLY_TITLE="MonoSkel#"
+ASSEMBLY_DESCRIPTION="MonoSkel Bindings"
+ASSEMBLY_COMPANY="Novell, Inc."
+ASSEMBLY_COPYRIGHT="2008 Novell, Inc."
+
+AC_SUBST(ASSEMBLY_NAME)
+AC_SUBST(ASSEMBLY_VERSION)
+AC_SUBST(ASSEMBLY_NAMESPACE)
+AC_SUBST(ASSEMBLY_SHORTNAME)
+AC_SUBST(ASSEMBLY_TITLE)
+AC_SUBST(ASSEMBLY_DESCRIPTION)
+AC_SUBST(ASSEMBLY_COMPANY)
+AC_SUBST(ASSEMBLY_COPYRIGHT)
+
+dnl Check for pkg-config
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "x$PKG_CONFIG" = "xno"; then
+ AC_MSG_ERROR(['pkg-config' is not in your PATH.])
+fi
+
+dnl Check for Mono
+PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= 1.0, has_mono=true, has_mono=false)
+PKG_CHECK_MODULES(MONO_DEPENDENCY, mint >= 1.0, has_mint=true, has_mint=false)
+
+if test "x$has_mono" = "xtrue"; then
+ if test `uname -s` = "Darwin"; then
+ AC_PATH_PROG(RUNTIME, mono, no)
+ AC_PATH_PROG(CSC, mcs, no)
+ LIB_PREFIX=
+ LIB_SUFFIX=.dylib
+ else
+ AC_PATH_PROG(RUNTIME, mono, no)
+ AC_PATH_PROG(CSC, mcs, no)
+ LIB_PREFIX=.so
+ LIB_SUFFIX=
+ fi
+else
+ if test "x$has_mint" = "xtrue"; then
+ AC_PATH_PROG(RUNTIME, mint, no)
+ AC_PATH_PROG(CSC, mcs, no)
+ LIB_PREFIX=.so
+ LIB_SUFFIX=
+ else
+ AC_PATH_PROG(CSC, csc.exe, no)
+ if test x$CSC = "xno"; then
+ AC_MSG_ERROR([You need to install either mono or .Net])
+ else
+ RUNTIME=
+ LIB_PREFIX=
+ LIB_SUFFIX=.dylib
+ fi
+ fi
+fi
+
+CS="C#"
+if test "x$CSC" = "xno" ; then
+ AC_MSG_ERROR([No $CS compiler found])
+fi
+
+AC_PATH_PROG(GACUTIL, gacutil, no)
+if test "x$GACUTIL" = "xno" ; then
+ AC_MSG_ERROR([No gacutil tool found])
+fi
+
+GACUTIL_FLAGS='/package $ASSEMBLY_NAME /root $(DESTDIR)$(prefix)/lib'
+
+AC_SUBST(RUNTIME)
+AC_SUBST(CSC)
+AC_SUBST(GACUTIL)
+AC_SUBST(GACUTIL_FLAGS)
+AC_SUBST(LIB_PREFIX)
+AC_SUBST(LIB_SUFFIX)
+
+dnl Check for gtk-sharp
+PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= 1.9.0)
+AC_SUBST(GTK_SHARP_CFLAGS)
+AC_SUBST(GTK_SHARP_LIBS)
+gtksharp_prefix=`pkg-config --variable=prefix gtk-sharp-2.0`
+AC_SUBST(gtksharp_prefix)
+
+dnl Check for gapi
+AC_PATH_PROG(GAPI_PARSER, gapi2-parser, no)
+if test "x$GAPI_PARSER" = "xno"; then
+ AC_MSG_CHECKING(for gapi2-parser.exe)
+ GAPI_PARSER=`which gapi2-parser.exe 2> /dev/null`
+ if test "x$GAPI_PARSER" = "xno" ; then
+ AC_MSG_ERROR(['gapi2_parser'/'gapi2-parser.exe' not found.])
+ fi
+ AC_MSG_RESULT($GAPI_PARSER)
+ GAPI_PARSER="$MONO $GAPI_PARSER"
+fi
+AC_SUBST(GAPI_PARSER)
+
+AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup, no)
+if test "x$GAPI_FIXUP" = "xno"; then
+ AC_MSG_CHECKING(for gapi2-fixup.exe)
+ GAPI_FIXUP=`which gapi2-fixup.exe 2> /dev/null`
+ if test "x$GAPI_FIXUP" = "xno" ; then
+ AC_MSG_ERROR(['gapi2_fixup'/'gapi2-fixup.exe' not found.])
+ fi
+ AC_MSG_RESULT($GAPI_FIXUP)
+ GAPI_FIXUP="$MONO $GAPI_FIXUP"
+fi
+AC_SUBST(GAPI_FIXUP)
+
+AC_PATH_PROG(GAPI_CODEGEN, gapi2-codegen, no)
+if test "x$GAPI_CODEGEN" = "xno"; then
+ AC_MSG_CHECKING(for gapi2_codegen.exe)
+ GAPI_CODEGEN=`which gapi2_codegen.exe 2> /dev/null`
+ if test "x$GAPI_CODEGEN" = "xno" ; then
+ AC_MSG_ERROR(['gapi2-codegen'/'gapi2_codegen.exe' not found.])
+ fi
+ AC_MSG_RESULT([$GAPI_CODEGEN])
+ GAPI_CODEGEN="$MONO $GAPI_CODEGEN"
+fi
+AC_SUBST(GAPI_CODEGEN)
+
+dnl Check for monodoc
+AC_PATH_PROG(MDASSEMBLER, mdassembler, no)
+AC_PATH_PROG(MONODOCER, monodocer, no)
+if test "x$MONODOCER" = "xno" -o "x$MDASSEMBLER" = "xno"; then
+ enable_monodoc=no
+ doc_sources_dir=
+else
+ enable_monodoc=yes
+ doc_sources_dir="`pkg-config --variable=sourcesdir monodoc`"
+fi
+AC_SUBST(MDASSEMBLER)
+AC_SUBST(MONODOCER)
+
+AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_monodoc" = "xyes")
+
+AC_OUTPUT([
+Makefile
+ doc/Makefile
+ samples/Makefile
+ sources/Makefile
+ sources/AssemblyInfo.cs
+ sources/$ASSEMBLY_NAME.pc
+ sources/$ASSEMBLY_NAME.dll.config
+])
+
+echo ""
+echo "Configuration summary"
+echo "---------------------"
+echo ""
+echo " * Installation prefix: $prefix"
+echo " * compiler: $CSC"
+echo " * Documentation: $enable_monodoc ($MONODOC)"
+echo ""
+
43 doc/Makefile.am
@@ -0,0 +1,43 @@
+if ENABLE_MONODOC
+TARGETS = $(ASSEMBLY_NAME)-docs.source $(ASSEMBLY_NAME)-docs.zip $(ASSEMBLY_NAME)-docs.tree
+docsdir = $(prefix)/lib/monodoc/sources
+docs_DATA = $(TARGETS)
+else
+TARGETS =
+docsdir = $(datadir)
+docs_DATA =
+endif
+
+ASSEMBLIES = ../sources/$(ASSEMBLY_NAME).dll
+
+UPDATE_ASSEMBLIES = $(addprefix -assembly:, $(ASSEMBLIES))
+
+all: $(TARGETS)
+
+update:
+ $(MONODOCER) $(UPDATE_ASSEMBLIES) -path:en
+
+$(srcdir)/en/*/*.xml $(srcdir)/en/*.xml:
+ $(MONODOCER) $(UPDATE_ASSEMBLIES) -path:en
+
+$(ASSEMBLY_NAME)-docs.source:
+ @echo "Generating $@"
+ @echo "<?xml version=\"1.0\"?>" > $@
+ @echo "<monodoc>" >> $@
+ @echo " <source provider=\"ecma\" basefile=\"$(ASSEMBLY_NAME)-docs\" path=\"classlib-$(ASSEMBLY_SHORTNAME)\"/>" >> $@
+ @echo "</monodoc>" >> $@
+
+$(ASSEMBLY_NAME)-docs.zip $(ASSEMBLY_NAME)-docs.tree: $(srcdir)/en/*/*.xml $(srcdir)/en/*.xml
+ $(MDASSEMBLER) --ecma $(srcdir)/en -o $(ASSEMBLY_NAME)-docs
+
+CLEANFILES = $(TARGETS)
+
+NAMESPACES=$(ASSEMBLY_NAMESPACE)
+
+dist-hook:
+ mkdir -p $(distdir)/en
+ cp $(srcdir)/en/*.xml $(distdir)/en/
+ for i in $(NAMESPACES); do \
+ mkdir -p $(distdir)/en/$$i; \
+ cp $(srcdir)/en/$$i/*.xml $(distdir)/en/$$i; \
+ done
9 samples/AdvancedSample.cs
@@ -0,0 +1,9 @@
+using System;
+
+public class AdvancedSample
+{
+ public static void Main(string [] args)
+ {
+ Console.WriteLine ("Advanced Sample");
+ }
+}
9 samples/BasicSample.cs
@@ -0,0 +1,9 @@
+using System;
+
+public class BasicSample
+{
+ public static void Main(string [] args)
+ {
+ Console.WriteLine ("Basic Sample");
+ }
+}
28 samples/Makefile.am
@@ -0,0 +1,28 @@
+
+TARGETS = \
+ basic.exe \
+ advanced.exe
+
+EXTRA_DIST = \
+ BasicSample.cs \
+ AdvancedSample.cs
+
+DEBUGS = $(addsuffix .mdb, $(TARGETS))
+
+assembly=$(ASSEMBLY_NAME).dll
+
+CLEANFILES = $(TARGETS) $(DEBUGS) $(assembly)
+
+references=-r:../sources/$(assembly) -pkg:gtk-sharp-2.0
+
+all: $(TARGETS)
+
+$(assembly): ../sources/$(assembly)
+ cp ../sources/$(ASSEMBLY_NAME).dll $(srcdir)
+
+basic.exe: $(assembly) $(srcdir)/BasicSample.cs
+ $(CSC) /out:$@ $(references) $(srcdir)/BasicSample.cs
+
+advanced.exe: $(assembly) $(srcdir)/AdvancedSample.cs
+ $(CSC) /out:$@ $(references) $(srcdir)/AdvancedSample.cs
+
50 skel-create.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+assembly=$1
+srcdir=./sources
+
+FILE=$srcdir/$assembly.dll.config.in
+echo "Generating $FILE"
+echo "<configuration>" > $FILE
+echo " <dllmap dll=\"monoskel\" target=\"monoskel@LIB_PREFIX@.1@LIB_SUFFIX@\"/>" >> $FILE
+echo "</configuration>" >> $FILE
+
+FILE=$srcdir/$assembly.metadata
+echo "Generating $FILE"
+echo "<?xml version=\"1.0\"?>" > $FILE
+echo "<metadata>" >> $FILE
+echo "</metadata>" >> $FILE
+
+FILE=$srcdir/$assembly.pc.in
+echo "Generating $FILE"
+echo "prefix=@prefix@" >> $FILE
+echo "exec_prefix=${prefix}" >> $FILE
+echo "libdir=${exec_prefix}/lib" >> $FILE
+echo "" >> $FILE
+echo "Name: @ASSEMBLY_TITLE@" >> $FILE
+echo "Description: @ASSEMBLY_DESCRIPTION@" >> $FILE
+echo "Version: @VERSION@" >> $FILE
+echo "Requires: gtk-sharp-2.0" >> $FILE
+echo "Libs: -r:${prefix}/lib/mono/@ASSEMBLY_NAME@/@ASSEMBLY_NAME@.dll" >> $FILE
+
+echo "Generating strong name key"
+sn -q -k $srcdir/$assembly.snk
+
+FILE=$srcdir/$assembly-sources.xml
+echo "Generating $FILE"
+echo "<?xml version=\"1.0\"?>" > $FILE
+echo "<gapi-parser-input>" >> $FILE
+echo " <api filename=\"$assembly-api.raw\">" >> $FILE
+echo " <library name=\"monoskel-1.0\">" >> $FILE
+echo " <namespace name=\"MonoSkel\">" >> $FILE
+echo " <dir>/use/include/monoskel</dir>" >> $FILE
+echo " </namespace>" >> $FILE
+echo " </library>" >> $FILE
+echo " </api>" >> $FILE
+echo "</gapi-parser-input>" >> $FILE
+
+# change package name in configure.in
+#sed -i -e "s,monoskel-sharp,$assembly," configure.in
+sed -i -e "s,AM_INIT_AUTOMAKE(.*\,,AM_INIT_AUTOMAKE($assembly\,," configure.in
+
+
11 sources/AssemblyInfo.cs.in
@@ -0,0 +1,11 @@
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle("@ASSEMBLY_TITLE@")]
+[assembly: AssemblyDescription("@ASSEMBLY_DESCRIPTION@")]
+[assembly: AssemblyCompany("@ASSEMBLY_COMPANY@")]
+[assembly: AssemblyCopyright("@ASSEMBLY_COPYRIGHT@")]
+[assembly: AssemblyVersion("@ASSEMBLY_VERSION@")]
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("@ASSEMBLY_NAME@.snk")]
58 sources/Makefile.am
@@ -0,0 +1,58 @@
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(ASSEMBLY_NAME).pc
+
+RAW_API=$(ASSEMBLY_NAME)-api.raw
+API=$(ASSEMBLY_NAME)-api.xml
+METADATA=$(ASSEMBLY_NAME).metadata
+
+sources =
+#sources = Class.cs
+
+build_sources = AssemblyInfo.cs $(sources)
+
+customs =
+#customs = App.custom Widget.custom Project.custom WidgetClass.custom
+
+CLEANFILES = $(ASSEMBLY_NAME).dll generated-stamp generated/*.cs $(API)
+
+DISTCLEANFILES= AssemblyInfo.cs $(ASSEMBLY_NAME).pc $(ASSEMBLY_NAME).dll.config
+
+noinst_DATA = $(ASSEMBLY_NAME).dll
+
+EXTRA_DIST = $(RAW_API) $(sources) $(customs) $(METADATA) \
+ AssemblyInfo.cs.in \
+ $(ASSEMBLY_NAME).snk \
+ $(ASSEMBLY_NAME).dll.config.in \
+ $(ASSEMBLY_NAME).pc.in \
+ $(ASSEMBLY_NAME)-sources.xml
+
+all: generated-stamp $(ASSEMBLY)
+
+api:
+ PERLLIB=$(GTKSHARP_PREFIX)/share/perl5 \
+ PATH=$(GTKSHARP_PREFIX)/bin:$$PATH \
+ $(GAPI_PARSER) $(ASSEMBLY_NAME)-sources.xml
+
+$(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA)
+ cp $(srcdir)/$(RAW_API) $(API)
+ chmod u+w $(API)
+ $(GAPI_FIXUP) --api=$(srcdir)/$(API) --metadata=$(srcdir)/$(METADATA)
+
+generated-stamp: $(API)
+ $(GAPI_CODEGEN) --generate $(srcdir)/$(API) $(GTK_SHARP_CFLAGS) \
+ --outdir=generated --customdir=$(srcdir) \
+ --assembly-name=$(ASSEMBLY_NAME) && touch generated-stamp
+
+$(ASSEMBLY_NAME).dll: $(build_sources) generated-stamp
+ $(CSC) -nowarn:169 -unsafe -target:library $(GTK_SHARP_LIBS) \
+ $(build_sources) generated/*.cs -out:$(ASSEMBLY_NAME).dll
+
+install-data-local:
+ echo "$(GACUTIL) /i $(ASSEMBLY_NAME).dll /f $(GACUTIL_FLAGS)"; \
+ $(GACUTIL) /i $(ASSEMBLY_NAME).dll /f $(GACUTIL_FLAGS) || exit 1;
+
+uninstall-local:
+ echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \
+ $(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1;
+
Please sign in to comment.
Something went wrong with that request. Please try again.