“UbuntuHelp:Forum/software/OpenSource/SourceCode”的版本间的差异
来自Ubuntu中文
小 (新页面: {{From|https://help.ubuntu.com/community/forum/software/OpenSource/SourceCode}} {{Languages|UbuntuHelp:forum/software/OpenSource/SourceCode}} A computer runs bits of ones and zeros to get...) |
小 |
||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:forum/software/OpenSource/SourceCode}} | {{Languages|UbuntuHelp:forum/software/OpenSource/SourceCode}} | ||
A computer runs bits of ones and zeros to get things done. Humans do not speak this language so programming languages were developed. | A computer runs bits of ones and zeros to get things done. Humans do not speak this language so programming languages were developed. | ||
− | |||
A programmer has an idea and writes the code with a text editor. The code is compiled (by a compiler) or interpreted (by an interpreter) into binary (ones and zeros that the copmuter can understand). | A programmer has an idea and writes the code with a text editor. The code is compiled (by a compiler) or interpreted (by an interpreter) into binary (ones and zeros that the copmuter can understand). | ||
− | |||
Anyone with a compatible computer, a compiler and the source code can build that program. | Anyone with a compatible computer, a compiler and the source code can build that program. | ||
− | |||
Source code for most linux applications are available in tarball form, which is an archive of files. The archive is compressed using GZIP compression. Often you will see source code in this .tar.gz format. | Source code for most linux applications are available in tarball form, which is an archive of files. The archive is compressed using GZIP compression. Often you will see source code in this .tar.gz format. | ||
− | |||
Usually, the source code uses standard tools to be built. Typically, to build an application from source, be sure you have | Usually, the source code uses standard tools to be built. Typically, to build an application from source, be sure you have | ||
1- a compiler installed (gcc is the Gnu C Compiler - install the "build-essential" package to install the compiler tools you will need) | 1- a compiler installed (gcc is the Gnu C Compiler - install the "build-essential" package to install the compiler tools you will need) | ||
第15行: | 第11行: | ||
sudo apt-get build-dep program | sudo apt-get build-dep program | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
These dependancies may not be new enough for the program, in which case you will have to track them down (and install their dependancies) yourself. | These dependancies may not be new enough for the program, in which case you will have to track them down (and install their dependancies) yourself. | ||
− | |||
From the command like, unpack the source tarball archive: | From the command like, unpack the source tarball archive: | ||
<pre><nowiki> | <pre><nowiki> | ||
tar xvzf program.tar.gz | tar xvzf program.tar.gz | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
enter the directory: | enter the directory: | ||
<pre><nowiki> | <pre><nowiki> | ||
cd program | cd program | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Automatically configure the source: | Automatically configure the source: | ||
<pre><nowiki> | <pre><nowiki> | ||
./configure | ./configure | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Build it: | Build it: | ||
<pre><nowiki> | <pre><nowiki> | ||
make | make | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
install it: | install it: | ||
<pre><nowiki> | <pre><nowiki> |
2007年11月30日 (五) 17:21的版本
点击翻译: |
English |
A computer runs bits of ones and zeros to get things done. Humans do not speak this language so programming languages were developed. A programmer has an idea and writes the code with a text editor. The code is compiled (by a compiler) or interpreted (by an interpreter) into binary (ones and zeros that the copmuter can understand). Anyone with a compatible computer, a compiler and the source code can build that program. Source code for most linux applications are available in tarball form, which is an archive of files. The archive is compressed using GZIP compression. Often you will see source code in this .tar.gz format. Usually, the source code uses standard tools to be built. Typically, to build an application from source, be sure you have 1- a compiler installed (gcc is the Gnu C Compiler - install the "build-essential" package to install the compiler tools you will need) 2 - all the necessary dependancies (-dev packages, like libncurses-dev). If an older version of the program is in the repositories you can install its dependancies:
sudo apt-get build-dep program
These dependancies may not be new enough for the program, in which case you will have to track them down (and install their dependancies) yourself. From the command like, unpack the source tarball archive:
tar xvzf program.tar.gz
enter the directory:
cd program
Automatically configure the source:
./configure
Build it:
make
install it:
sudo checkinstall