Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 9710478f120351152e1762ecab422682bf4f3a03 @shana committed Jul 22, 2012
No changes.
No changes.
No changes.
@@ -0,0 +1 @@
+SUBDIRS=bindinate
0 NEWS
No changes.
0 README
No changes.
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+autoreconf -i --force --warnings=none
+./configure --enable-maintainer-mode $*
@@ -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")]
@@ -0,0 +1,3 @@
+bin_SCRIPTS = bindinate
+bindinatedir = $(libdir)/bindinator
+bindinate_DATA = gir2gapi.xslt preprocess.xslt configure.ac.template Makefile.am.template AssemblyInfo.cs.in autogen.sh metadata.template
@@ -0,0 +1,49 @@
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(ASSEMBLY_PC).pc
+
+RAW_API=$(ASSEMBLY_NAME)-api.raw
+API=$(ASSEMBLY_NAME)-api.xml
+METADATA=$(ASSEMBLY_NAME).metadata
+
+sources =
+
+build_sources = AssemblyInfo.cs $(sources)
+
+customs =
+
+CLEANFILES = $(ASSEMBLY_NAME).dll generated-stamp generated/*.cs $(API)
+
+DISTCLEANFILES= AssemblyInfo.cs $(ASSEMBLY_PC).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): $(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;
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+autoreconf -i --force --warnings=none
+./configure --enable-maintainer-mode $*
@@ -0,0 +1,150 @@
+#!/bin/sh
+usage()
+{
+cat <<EOF
+Usage: gir [package]
+ gir: gir filename to process (without extension)
+ package: name of pc file (if the gir data with the package name is wrong)
+EOF
+}
+
+sh_append()
+{
+ printf "%s=%s\n" "$1" "$2" >> $SH
+}
+
+echo "Processing $1"
+
+
+if [ ! -e @GIRDIR@/$1.gir ]; then
+ echo "@GIRDIR@/$1.gir not found, exiting"
+ exit 1
+fi
+
+OUTDIR=$1/
+
+if [ ! -d $OUTDIR ]; then
+ mkdir -p $OUTDIR
+fi
+
+PACKAGE=`@XSLTPROC@ --stringparam type package @prefix@/lib/bindinator/preprocess.xslt @GIRDIR@/$1.gir`
+ORIGINAL=$PACKAGE
+LIBS=`@XSLTPROC@ --stringparam type libs @prefix@/lib/bindinator/preprocess.xslt @GIRDIR@/$1.gir|sed 's/,/ /'`
+NS=`@XSLTPROC@ --stringparam type namespace @prefix@/lib/bindinator/preprocess.xslt @GIRDIR@/$1.gir`
+VERSION=`@XSLTPROC@ --stringparam type version @prefix@/lib/bindinator/preprocess.xslt @GIRDIR@/$1.gir`
+GAPI=`@XSLTPROC@ --stringparam type gapi @prefix@/lib/bindinator/preprocess.xslt @GIRDIR@/$1.gir`
+
+if [ ! $(@PKG_CONFIG@ --exists $PACKAGE) ]; then
+ if [ -z $2 ]; then
+ echo "$PACKAGE not found and no package name given on the command line"
+ exit 1
+ else
+ PACKAGE="$2"
+ fi
+fi
+
+MODVERSION=$(@PKG_CONFIG@ --modversion $PACKAGE)
+NAME=$(echo $NS|tr '[:upper:]' '[:lower:]')
+UNAME=$(echo $NS|tr '[:lower:]' '[:upper:]')
+LIB=$PACKAGE
+SOLIB=
+
+DLLMAP=$PACKAGE.dll.config
+CONFIGURE=configure.ac
+
+for lib in $LIBS; do
+ case "$lib" in
+ *$PACKAGE*)
+ SOLIB=$lib
+ ;;
+ *$ORIGINAL*)
+ SOLIB=$lib
+ ;;
+ esac
+done
+
+echo "PACKAGE: $PACKAGE"
+echo "LIBS: $LIBS"
+echo "LIB: $LIB"
+echo "SOLIB: $SOLIB"
+
+cat >$OUTDIR/$DLLMAP <<EOF
+<configuration>
+ <dllmap dll="$PACKAGE" target="$SOLIB"/>
+</configuration>
+EOF
+
+cat >$OUTDIR/$CONFIGURE <<EOF
+AC_INIT([$NAME-sharp], [$MODVERSION])
+AC_CONFIG_SRCDIR([README])
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
+AC_PROG_INSTALL
+
+dnl Package settings
+ASSEMBLY_COMPANY=""
+ASSEMBLY_COPYRIGHT="2012 Andreia Gaita"
+ASSEMBLY_DESCRIPTION="$1 bindings for Mono"
+ASSEMBLY_NAME="$NAME-sharp"
+ASSEMBLY_NAMESPACE="$NS"
+ASSEMBLY_PC="$NAME-sharp-$VERSION"
+ASSEMBLY_SHORTNAME="$NAME"
+ASSEMBLY_TITLE="$NS"
+ASSEMBLY_VERSION="$MODVERSION"
+EOF
+
+sed "s/#GAPI#/$GAPI/g" @prefix@/lib/bindinator/configure.ac.template >>$OUTDIR/$CONFIGURE
+
+PR=$NAME"_prefix"
+
+cat >>$OUTDIR/$CONFIGURE <<EOF
+dnl Check for $NS
+PKG_CHECK_MODULES($UNAME, $PACKAGE)
+AC_SUBST(WEBKIT_LIBS)
+$PR=`pkg-config --variable=prefix $PACKAGE`
+AC_SUBST($PR)
+
+AC_CONFIG_FILES([
+ Makefile
+ AssemblyInfo.cs
+])
+AC_CONFIG_COMMANDS([default],[[ echo timestamp > stamp-h ]],[[]])
+AC_OUTPUT
+
+echo ""
+echo "Configuration summary"
+echo "---------------------"
+echo ""
+echo " * Installation prefix: \$prefix"
+echo " * compiler: \$CSC"
+echo " * Documentation: $enable_monodoc (\$MONODOC)"
+echo ""
+EOF
+
+cp @prefix@/lib/bindinator/Makefile.am.template $OUTDIR/Makefile.am
+cp @prefix@/lib/bindinator/AssemblyInfo.cs.in $OUTDIR/.
+cp @prefix@/lib/bindinator/autogen.sh $OUTDIR/.
+chmod +x $OUTDIR/autogen.sh
+
+if [ ! -e $OUTDIR/$NAME-sharp.metadata ]; then
+ cp @prefix@/lib/bindinator/metadata.template $OUTDIR/$NAME-sharp.metadata
+fi
+
+if [ ! -e "$OUTDIR/NEWS" ]; then touch $OUTDIR/NEWS; fi
+if [ ! -e "$OUTDIR/README" ]; then touch $OUTDIR/README; fi
+if [ ! -e "$OUTDIR/AUTHORS" ]; then touch $OUTDIR/AUTHORS; fi
+if [ ! -e "$OUTDIR/ChangeLog" ]; then touch $OUTDIR/ChangeLog; fi
+if [ ! -e "$OUTDIR/COPYING" ]; then touch $OUTDIR/COPYING; fi
+
+if [ ! -e $OUTDIR/$NAME-sharp.snk ]; then
+ sn -k $OUTDIR/$NAME-sharp.snk
+fi
+
+#if test -e @GIRDIR@/$1.gir; then
+# echo "AAAAH"
+# @XSLTPROC@ @prefix@/lib/bindinator/gir2gapi.xslt -o "$1"/$1-api.raw @GIRDIR@/$1.gir
+#fi
+
+echo "Processing @GIRDIR@/$1.gir and outputting $OUTDIR/$NAME-sharp-api.raw"
+@XSLTPROC@ -o $OUTDIR/$NAME-sharp-api.raw @prefix@/lib/bindinator/gir2gapi.xslt @GIRDIR@/$1.gir
@@ -0,0 +1,112 @@
+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)
+AC_SUBST(ASSEMBLY_PC)
+
+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)
+
+if test "x$has_mono" = "xtrue"; then
+ AC_PATH_PROG(RUNTIME, mono, no)
+ AC_PATH_PROG(CSC, gmcs, 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
+
+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-#GAPI#.0)
+AC_SUBST(GTK_SHARP_CFLAGS)
+AC_SUBST(GTK_SHARP_LIBS)
+gtksharp_prefix=`pkg-config --variable=prefix gtk-sharp-#GAPI#.0`
+AC_SUBST(gtksharp_prefix)
+
+dnl Check for gapi
+AC_PATH_PROG(GAPI_PARSER, gapi#GAPI#-parser, no)
+if test "x$GAPI_PARSER" = "xno"; then
+ AC_MSG_CHECKING(for gapi#GAPI#-parser.exe)
+ GAPI_PARSER=`which gapi#GAPI#-parser.exe 2> /dev/null`
+ if test "x$GAPI_PARSER" = "xno" ; then
+ AC_MSG_ERROR(['gapi#GAPI#_parser'/'gapi#GAPI#-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, gapi#GAPI#-fixup, no)
+if test "x$GAPI_FIXUP" = "xno"; then
+ AC_MSG_CHECKING(for gapi#GAPI#-fixup.exe)
+ GAPI_FIXUP=`which gapi#GAPI#-fixup.exe 2> /dev/null`
+ if test "x$GAPI_FIXUP" = "xno" ; then
+ AC_MSG_ERROR(['gapi#GAPI#_fixup'/'gapi#GAPI#-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, gapi#GAPI#-codegen, no)
+if test "x$GAPI_CODEGEN" = "xno"; then
+ AC_MSG_CHECKING(for gapi#GAPI#_codegen.exe)
+ GAPI_CODEGEN=`which gapi#GAPI#_codegen.exe 2> /dev/null`
+ if test "x$GAPI_CODEGEN" = "xno" ; then
+ AC_MSG_ERROR(['gapi#GAPI#-codegen'/'gapi#GAPI#_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")
Oops, something went wrong.

0 comments on commit 9710478

Please sign in to comment.