From de21d2c92c15387d64f16d4b20defb010caac299 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 14 Aug 2008 20:33:37 +0100 Subject: [PATCH] Patch from Miguel de Icaza: This introduces auto-detection of Mono to configure, and if found, builds and installs the runtime library, and provides a pkg-config file so developers can easily use it on Unix. --- Makefile.am | 4 ++ configure.ac | 7 ++- csharp/Google.ProtocolBuffers.pub | Bin 0 -> 160 bytes csharp/Makefile.am | 54 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 2 +- .../Properties/Google.ProtocolBuffers.snk | Bin 0 -> 596 bytes csharp/google-pb.pc.in | 7 +++ 7 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 csharp/Google.ProtocolBuffers.pub create mode 100644 csharp/Makefile.am create mode 100644 csharp/ProtocolBuffers/Properties/Google.ProtocolBuffers.snk create mode 100644 csharp/google-pb.pc.in 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 0000000000000000000000000000000000000000..3c59ae0d6a8e253eff941eef05ff32527b7bfabd GIT binary patch literal 160 zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONaL0000xMiFpKQ+YYV;QQ%B zeb)L^Vo-mb)cv2o2NFeoL0bcTrqaagT`YYm$YX%7XngblKpU}x@}~>awlTr{x7&)Q zY<6apsrys 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 0000000000000000000000000000000000000000..6bbfc90fee51527a961fb531a0aa4526c54d1efe GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONaL0000xMiFpKQ+YYV;QQ%Beb)L^Vo-mb)cv2o z2NFeoL0bcTrqaagT`YYm$YX%7XngblKpU}x@}~>awlTr{x7&)QY<6apsrysw;rN#3b?!@5j10q5}iQUREBe#*aX0a6n?i}=^qupweN1Y z8=5Vk>eF-n#fR^1N zzpX9`YR45aeftkhppA^Uaq|0azk*|jUG&99v;|dV(c2Og9#g!>Yiw@Wy5vw`RnxKt zDIi3S*CBCRaG4e&8#}i*ddFsP@_l`5E@tTg2t~s|O))%ZG$Y#m;8mjGhd_@U%W`Mn zHS#3weZBy5DYMkQFM9O^r&-iyRFDWKwmW1vTK(O9CxPS354vtL#GKZhH6D$1MopEw zD)Yq(bt)IJO#(D{tdEe=28m8>OytaA5;6ud&+>8m+;m=UMNp2j@x*@-580bCcb?Bq zi8{G}iI^L8zw+8P0m6M;_;1U2Su`hWPu}^U2V6rLzfO1Tn$YxF>V+49=f`TBejLK` is9bko#@s??YxF4E1SgEP;bAy0B|ujM@eHl6Ta