diff --git a/Makefile.am b/Makefile.am index 4e2f651522..f46c02b1f6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,11 @@ ACLOCAL_AMFLAGS = -I m4 +if MONO +SUBDIRS = src csharp +else SUBDIRS = src +endif EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index 6dca16331c..acf2cb5546 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,11 @@ AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h]) +if pkg-config --atleast-version=1.9 mono; then + with_mono=yes +fi +AM_CONDITIONAL(MONO, test x$with_mono = xyes) + # Checks for library functions. AC_FUNC_MEMCMP AC_FUNC_STRTOD @@ -31,4 +36,4 @@ AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol]) ACX_PTHREAD AC_CXX_STL_HASH -AC_OUTPUT( Makefile src/Makefile ) +AC_OUTPUT( Makefile src/Makefile csharp/Makefile ) diff --git a/csharp/Google.ProtocolBuffers.pub b/csharp/Google.ProtocolBuffers.pub new file mode 100644 index 0000000000..3c59ae0d6a Binary files /dev/null and b/csharp/Google.ProtocolBuffers.pub differ diff --git a/csharp/Makefile.am b/csharp/Makefile.am new file mode 100644 index 0000000000..d3b10be5a3 --- /dev/null +++ b/csharp/Makefile.am @@ -0,0 +1,54 @@ +pkgconfigdir = $(libdir)/pkgconfig + +pkgconfig_DATA = google-pb.pc + +noinst_SCRIPTS = Google.ProtocolBuffers.dll + +Google.ProtocolBuffers.dll_sources = \ + $(srcdir)/ProtocolBuffers/AbstractBuilder.cs \ + $(srcdir)/ProtocolBuffers/AbstractMessage.cs \ + $(srcdir)/ProtocolBuffers/Autogenerated.cs \ + $(srcdir)/ProtocolBuffers/ByteString.cs \ + $(srcdir)/ProtocolBuffers/CodedInputStream.cs \ + $(srcdir)/ProtocolBuffers/CodedOutputStream.cs \ + $(srcdir)/ProtocolBuffers/Collections/Dictionaries.cs \ + $(srcdir)/ProtocolBuffers/Collections/Lists.cs \ + $(srcdir)/ProtocolBuffers/Collections/ReadOnlyDictionary.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/EnumDescriptor.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/FieldDescriptor.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/FieldType.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/FileDescriptor.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/MappedType.cs \ + $(srcdir)/ProtocolBuffers/Descriptors/MessageDescriptor.cs \ + $(srcdir)/ProtocolBuffers/ExtensionInfo.cs \ + $(srcdir)/ProtocolBuffers/ExtensionRegistry.cs \ + $(srcdir)/ProtocolBuffers/FieldAccess/Delegates.cs \ + $(srcdir)/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs \ + $(srcdir)/ProtocolBuffers/FieldAccess/IFieldAccessor.cs \ + $(srcdir)/ProtocolBuffers/FieldSet.cs \ + $(srcdir)/ProtocolBuffers/GeneratedBuilder.cs \ + $(srcdir)/ProtocolBuffers/GeneratedExtension.cs \ + $(srcdir)/ProtocolBuffers/GeneratedMessage.cs \ + $(srcdir)/ProtocolBuffers/IBuilder.cs \ + $(srcdir)/ProtocolBuffers/IMessage.cs \ + $(srcdir)/ProtocolBuffers/InvalidProtocolBufferException.cs \ + $(srcdir)/ProtocolBuffers/Properties/AssemblyInfo.cs \ + $(srcdir)/ProtocolBuffers/TextFormat.cs \ + $(srcdir)/ProtocolBuffers/UninitializedMessageException.cs \ + $(srcdir)/ProtocolBuffers/UnknownField.cs \ + $(srcdir)/ProtocolBuffers/UnknownFieldSet.cs \ + $(srcdir)/ProtocolBuffers/WireFormat.cs + +Google.ProtocolBuffers.dll: $(Google.ProtocolBuffers.dll_sources) + cp $(srcdir)/ProtocolBuffers/Properties/Google.ProtocolBuffers.snk . + gmcs -codepage:utf8 -debug -target:library -out:Google.ProtocolBuffers.dll $(Google.ProtocolBuffers.dll_sources) + +install-data-local: Google.ProtocolBuffers.dll + gacutil -i Google.ProtocolBuffers.dll -package google + +EXTRA_DIST = $(Google.ProtocolBuffers.dll_sources) google-pb.pc.in + +google-pb.pc: Makefile.am google-pb.pc.in + sed "s,@PREFIX@,${prefix}," < $(srcdir)/google-pb.pc.in > google-pb.pc \ No newline at end of file diff --git a/csharp/ProtocolBuffers/Properties/AssemblyInfo.cs b/csharp/ProtocolBuffers/Properties/AssemblyInfo.cs index 4653dbe378..5ed598fef5 100644 --- a/csharp/ProtocolBuffers/Properties/AssemblyInfo.cs +++ b/csharp/ProtocolBuffers/Properties/AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2008")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] - +[assembly: AssemblyKeyFile ("Google.ProtocolBuffers.snk")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. diff --git a/csharp/ProtocolBuffers/Properties/Google.ProtocolBuffers.snk b/csharp/ProtocolBuffers/Properties/Google.ProtocolBuffers.snk new file mode 100644 index 0000000000..6bbfc90fee Binary files /dev/null and b/csharp/ProtocolBuffers/Properties/Google.ProtocolBuffers.snk differ diff --git a/csharp/google-pb.pc.in b/csharp/google-pb.pc.in new file mode 100644 index 0000000000..83758de3a3 --- /dev/null +++ b/csharp/google-pb.pc.in @@ -0,0 +1,7 @@ +assemblies_dir=@PREFIX@ +Libraries=${assemblies_dir}/gac/Google.ProtocolBuffers/1.0.0.0__17b3b1f090c3ea48/Google.ProtocolBuffers.dll + +Name: Google Protocol Buffers for C# +Description: Google Protocol Buffers for C# +Version: 1.0.0.0 +Libs: -r:${assemblies_dir}/gac/Google.ProtocolBuffers/1.0.0.0__17b3b1f090c3ea48/Google.ProtocolBuffers.dll