“UbuntuHelp:MonoFromSource”的版本间的差异
来自Ubuntu中文
小 (新页面: {{From|https://help.ubuntu.com/community/MonoFromSource}} {{Languages|UbuntuHelp:MonoFromSource}} === Compiling Mono From Source === Due to the current lag between Mono releases and Ubun...) |
小 |
||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:MonoFromSource}} | {{Languages|UbuntuHelp:MonoFromSource}} | ||
=== Compiling Mono From Source === | === Compiling Mono From Source === | ||
− | |||
Due to the current lag between Mono releases and Ubuntu/Debian packages being available, this page will help you to compile the latest release of Mono from source. | Due to the current lag between Mono releases and Ubuntu/Debian packages being available, this page will help you to compile the latest release of Mono from source. | ||
− | |||
These instructions are for use with Ubuntu 5.04 (Hoary Hedgehog), Ubuntu 5.10 forwards already has a more recent version of Mono in the repositories. | These instructions are for use with Ubuntu 5.04 (Hoary Hedgehog), Ubuntu 5.10 forwards already has a more recent version of Mono in the repositories. | ||
− | |||
=== Pre-Requisites === | === Pre-Requisites === | ||
− | |||
Since we're going to be compiling code, we need to satisfy some requirements before we begin. We also need to satisfy some dependencies for Mono. | Since we're going to be compiling code, we need to satisfy some requirements before we begin. We also need to satisfy some dependencies for Mono. | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~$ sudo apt-get install build-essential pkg-config libglib2.0-dev bison libcairo1-dev | bash:~$ sudo apt-get install build-essential pkg-config libglib2.0-dev bison libcairo1-dev | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Now we're going to need somewhere to work: | Now we're going to need somewhere to work: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~$ mkdir src | bash:~$ mkdir src | ||
bash:~$ cd src | bash:~$ cd src | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
==== libgdiplus ==== | ==== libgdiplus ==== | ||
− | |||
'''''Optional''' - Although the following are not required, they do provide more functionality to libgdiplus.'' | '''''Optional''' - Although the following are not required, they do provide more functionality to libgdiplus.'' | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ sudo apt-get install libungif4-dev libjpeg62-dev libtiff4-dev | bash:~/src/$ sudo apt-get install libungif4-dev libjpeg62-dev libtiff4-dev | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Let's grab the tarball: | Let's grab the tarball: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ wget http://www.go-mono.com/sources/libgdiplus-1.1/libgdiplus-1.1.9.tar.gz | bash:~/src/$ wget http://www.go-mono.com/sources/libgdiplus-1.1/libgdiplus-1.1.9.tar.gz | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
...and extract it: | ...and extract it: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ tar xzf libgdiplus-1.1.9.tar.gz | bash:~/src/$ tar xzf libgdiplus-1.1.9.tar.gz | ||
bash:~/src/$ cd libgdiplus-1.1.9 | bash:~/src/$ cd libgdiplus-1.1.9 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Now we can compile and install it: | Now we can compile and install it: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/libgdiplus-1.1.9/$ ./configure --prefix=/usr/local | bash:~/src/libgdiplus-1.1.9/$ ./configure --prefix=/usr/local | ||
第50行: | 第34行: | ||
bash:~/src/libgdiplus-1.1.9/$ sudo make install | bash:~/src/libgdiplus-1.1.9/$ sudo make install | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Now we have to make sure the installed libraries are visible - there are several ways to do this, this is just one. | Now we have to make sure the installed libraries are visible - there are several ways to do this, this is just one. | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/libgdiplus-1.1.9/$ sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf" | bash:~/src/libgdiplus-1.1.9/$ sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf" | ||
bash:~/src/libgdiplus-1.1.9/$ sudo /sbin/ldconfig | bash:~/src/libgdiplus-1.1.9/$ sudo /sbin/ldconfig | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Now we can leave this folder... | Now we can leave this folder... | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:-~/src/libgdiplus-1.1.9/$ cd .. | bash:-~/src/libgdiplus-1.1.9/$ cd .. | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
...and move onto the next step. | ...and move onto the next step. | ||
− | |||
=== Mono === | === Mono === | ||
− | |||
Compiling Mono itself is pleasantly straightforward: | Compiling Mono itself is pleasantly straightforward: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ wget http://www.go-mono.com/sources/mono-1.1/mono-1.1.9.tar.gz | bash:~/src/$ wget http://www.go-mono.com/sources/mono-1.1/mono-1.1.9.tar.gz | ||
第79行: | 第55行: | ||
bash:~/src/$ cd .. | bash:~/src/$ cd .. | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
You can check the install as follows: | You can check the install as follows: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ mono -V | bash:~/src/$ mono -V | ||
第90行: | 第64行: | ||
Globalization: normal | Globalization: normal | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== Gtk# === | === Gtk# === | ||
− | |||
There are two variants of Gtk# - 1.x and 2.x. Different applications may require one or the other, and due to the nature of Mono there is no harm in having both. | There are two variants of Gtk# - 1.x and 2.x. Different applications may require one or the other, and due to the nature of Mono there is no harm in having both. | ||
− | |||
Both depend on various GNOME/GTK+ development libraries, which can be satisified as follows: | Both depend on various GNOME/GTK+ development libraries, which can be satisified as follows: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ sudo apt-get install libgnome-desktop-dev libgtkhtml3.2-dev | bash:~/src/$ sudo apt-get install libgnome-desktop-dev libgtkhtml3.2-dev | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
There are also optional dependencies, which - if you require them - can be satisified with: | There are also optional dependencies, which - if you require them - can be satisified with: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ sudo apt-get install libgnomedb2-dev librsvg2-dev libvte-dev | bash:~/src/$ sudo apt-get install libgnomedb2-dev librsvg2-dev libvte-dev | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
As with Mono itself once you've satisfied the dependencies, compilation is straight forward. | As with Mono itself once you've satisfied the dependencies, compilation is straight forward. | ||
− | |||
==== 1.x ==== | ==== 1.x ==== | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ wget http://go-mono.com/sources/gtk-sharp/gtk-sharp-1.0.10.tar.gz | bash:~/src/$ wget http://go-mono.com/sources/gtk-sharp/gtk-sharp-1.0.10.tar.gz | ||
第120行: | 第85行: | ||
bash:~/src/$ cd .. | bash:~/src/$ cd .. | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
You can test your install with the following: | You can test your install with the following: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ sudo ldconfig | bash:~/src/$ sudo ldconfig | ||
bash:~/src/$ mono gtk-sharp-1.0.10/sample/GtkDemo/GtkDemo.exe | bash:~/src/$ mono gtk-sharp-1.0.10/sample/GtkDemo/GtkDemo.exe | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
==== 2.x ==== | ==== 2.x ==== | ||
− | |||
Gtk# 2.x has an additional dependency: | Gtk# 2.x has an additional dependency: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ sudo apt-get install libpanel-applet2-dev | bash:~/src/$ sudo apt-get install libpanel-applet2-dev | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ wget http://go-mono.com/sources/gtk-sharp-2.0/gtk-sharp-2.3.91.tar.gz | bash:~/src/$ wget http://go-mono.com/sources/gtk-sharp-2.0/gtk-sharp-2.3.91.tar.gz | ||
第145行: | 第104行: | ||
bash:~/src/$ cd .. | bash:~/src/$ cd .. | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
You can test your install with the following: | You can test your install with the following: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~/src/$ sudo ldconfig | bash:~/src/$ sudo ldconfig | ||
bash:~/src/$ mono gtk-sharp-2.3.91/sample/GtkDemo/GtkDemo.exe | bash:~/src/$ mono gtk-sharp-2.3.91/sample/GtkDemo/GtkDemo.exe | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== Conclusion === | === Conclusion === | ||
− | |||
You've now got a fully functioning Mono/Gtk# environment, and you can move onto compiling/developing your own applications! | You've now got a fully functioning Mono/Gtk# environment, and you can move onto compiling/developing your own applications! | ||
− | |||
[[category:CategoryDocumentation]] [[category:CategoryCleanup]] | [[category:CategoryDocumentation]] [[category:CategoryCleanup]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年11月30日 (五) 20:19的版本
点击翻译: |
English |
请不要直接编辑翻译本页,本页将定期与来源同步。 |
目录
Compiling Mono From Source
Due to the current lag between Mono releases and Ubuntu/Debian packages being available, this page will help you to compile the latest release of Mono from source. These instructions are for use with Ubuntu 5.04 (Hoary Hedgehog), Ubuntu 5.10 forwards already has a more recent version of Mono in the repositories.
Pre-Requisites
Since we're going to be compiling code, we need to satisfy some requirements before we begin. We also need to satisfy some dependencies for Mono.
bash:~$ sudo apt-get install build-essential pkg-config libglib2.0-dev bison libcairo1-dev
Now we're going to need somewhere to work:
bash:~$ mkdir src bash:~$ cd src
libgdiplus
Optional - Although the following are not required, they do provide more functionality to libgdiplus.
bash:~/src/$ sudo apt-get install libungif4-dev libjpeg62-dev libtiff4-dev
Let's grab the tarball:
bash:~/src/$ wget http://www.go-mono.com/sources/libgdiplus-1.1/libgdiplus-1.1.9.tar.gz
...and extract it:
bash:~/src/$ tar xzf libgdiplus-1.1.9.tar.gz bash:~/src/$ cd libgdiplus-1.1.9
Now we can compile and install it:
bash:~/src/libgdiplus-1.1.9/$ ./configure --prefix=/usr/local bash:~/src/libgdiplus-1.1.9/$ make bash:~/src/libgdiplus-1.1.9/$ sudo make install
Now we have to make sure the installed libraries are visible - there are several ways to do this, this is just one.
bash:~/src/libgdiplus-1.1.9/$ sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf" bash:~/src/libgdiplus-1.1.9/$ sudo /sbin/ldconfig
Now we can leave this folder...
bash:-~/src/libgdiplus-1.1.9/$ cd ..
...and move onto the next step.
Mono
Compiling Mono itself is pleasantly straightforward:
bash:~/src/$ wget http://www.go-mono.com/sources/mono-1.1/mono-1.1.9.tar.gz bash:~/src/$ tar xzf mono-1.1.9.tar.gz bash:~/src/$ cd mono-1.1.9 bash:~/src/mono-1.1.9/$ ./configure --prefix=/usr/local --with-preview=yes bash:~/src/mono-1.1.9/$ make bash:~/src/mono-1.1.9/$ sudo make install bash:~/src/$ cd ..
You can check the install as follows:
bash:~/src/$ mono -V Mono JIT compiler version 1.1.9, (C) 2002-2005 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV : normal Globalization: normal
Gtk#
There are two variants of Gtk# - 1.x and 2.x. Different applications may require one or the other, and due to the nature of Mono there is no harm in having both. Both depend on various GNOME/GTK+ development libraries, which can be satisified as follows:
bash:~/src/$ sudo apt-get install libgnome-desktop-dev libgtkhtml3.2-dev
There are also optional dependencies, which - if you require them - can be satisified with:
bash:~/src/$ sudo apt-get install libgnomedb2-dev librsvg2-dev libvte-dev
As with Mono itself once you've satisfied the dependencies, compilation is straight forward.
1.x
bash:~/src/$ wget http://go-mono.com/sources/gtk-sharp/gtk-sharp-1.0.10.tar.gz bash:~/src/$ tar xzf gtk-sharp-1.0.10.tar.gz bash:~/src/$ cd gtk-sharp-1.0.10 bash:~/src/gtk-sharp-1.0.10/$ ./configure --prefix=/usr/local bash:~/src/gtk-sharp-1.0.10/$ make bash:~/src/gtk-sharp-1.0.10/$ sudo make install bash:~/src/$ cd ..
You can test your install with the following:
bash:~/src/$ sudo ldconfig bash:~/src/$ mono gtk-sharp-1.0.10/sample/GtkDemo/GtkDemo.exe
2.x
Gtk# 2.x has an additional dependency:
bash:~/src/$ sudo apt-get install libpanel-applet2-dev
bash:~/src/$ wget http://go-mono.com/sources/gtk-sharp-2.0/gtk-sharp-2.3.91.tar.gz bash:~/src/$ tar xzf gtk-sharp-2.3.91.tar.gz bash:~/src/$ cd gtk-sharp-2.3.91 bash:~/src/gtk-sharp-2.3.91/$ ./configure --prefix=/usr/local bash:~/src/gtk-sharp-2.3.91/$ make bash:~/src/gtk-sharp-2.3.91/$ sudo make install bash:~/src/$ cd ..
You can test your install with the following:
bash:~/src/$ sudo ldconfig bash:~/src/$ mono gtk-sharp-2.3.91/sample/GtkDemo/GtkDemo.exe
Conclusion
You've now got a fully functioning Mono/Gtk# environment, and you can move onto compiling/developing your own applications!