SlideShare a Scribd company logo
由source到執行檔 開放原始碼自由軟體 標準編譯流程 以 Pidgin 為例 依瑪貓 / 楊士青 <imacat@mail.imacat.idv.tw> 2011-01-19 , 2011-6-15 修
「由 source 到執行檔」簡報由 依瑪貓╱楊士青 製作, 以 創用CC Attribution-ShareAlike 3.0 Unported 授權條款 釋出。
標準流程步驟 sudo apt-get install build-essential intltool  libavahi-client-dev libavahi-glib-dev libdbus- glib-1-dev libgstfarsight0.10-dev libgstreamer- plugins-base0.10-dev libgtkspell-dev libidn11- dev libmeanwhile-dev libnss3-dev libperl-dev  libsasl2-dev libstartup-notification0-dev  libxss-dev network-manager-dev tk-dev
./configure --enable-cyrus-sasl --with-system- ssl-certs=/etc/ssl/certs
make
sudo make install
編譯: 將source轉成執行檔,方便系統執行。
標準流程步驟 tar xjf pidgin-2.8.0.tar.bz2
cd pidgin-2.8.0
./configure
make
make check
sudo make install
但是,在編譯之前…
安裝開發用的套件
安裝開發用的套件 sudo apt-get install build-essential  intltool libavahi-client-dev  libavahi-glib-dev libdbus-glib-1-dev  libgstfarsight0.10-dev libgstreamer- plugins-base0.10-dev libgtkspell-dev  libidn11-dev libmeanwhile-dev  libnss3-dev libperl-dev libsasl2-dev  libstartup-notification0-dev libxss- dev network-manager-dev tk-dev
build-essential 基本需要的編譯程式 gcc, g++, make
*-dev 開發用的套件
舉例: libxss XScreenSaver營幕保護程式的函式庫 Pidgin引用,來偵測使用者idle的時間
libxss1 執行用的函式庫 /usr/lib/libXss.so.1.0.0
執行時期連結, 引用到的程式,執行時需要, 所以要執行程式,要一起拉進來。
sudo apt-get install pidgin 會一起拉進 libxss1
libxss-dev 編譯用的定義檔 /usr/include/X11/extensions/scrnsaver.h static函式庫 /usr/lib/libXss.a
編譯時引用、連結,執行時不會用, 所以只有在編譯時才需要拉進來。 執行時不需要。
apt-get install pidgin 時, 因為安裝的是已編譯好的執行檔, 所以只需要 libxss1 , 不需要 libxss-dev ,
剩下的就很簡單了
標準流程 tar xjf pidgin-2.8.0.tar.bz2
cd pidgin-2.8.0
./configure
make
make check
sudo make install
./configure 檢查系統設定,作出因應處理。
configure 是 GNU 規定的標準工具, 是 autoconf 製作出來的 shell script 。 GNU的專案,規定要用autoconf。
因為方便好用,所以非GNU的專案, 也常見使用GNU autoconf。
使用GNU autoconf  configure 的非GNU專案: Apache BIND MySQL PostgreSQL Samba …
./configure --enable-cyrus-sasl \ --with-system-ssl-certs=/etc/ssl/certs --enable-cyrus-sasl :  使用 cyrus-sasl 功能 --with-system-ssl-certs :  指定 SSL 憑證目錄( /etc/ssl/certs )
./configure –-help 查看有哪些可用的選項
即使不是使用 GNU autoconf 的專案, 也常常使用類似名稱、類似功能的程式, 檢查系統設定,作出因應處理。
Perl 使用 Configure : ./Configure
OpenSSL使用 config : ./config
一點點深入瞭解GNU autoconf
GNU autoconf由簡易的範本, 來建立強大的 configure 程式。
configure 的範本檔為 configure.ac 。
除了 configure 以外, autoconf也用範本,製作其他檔案。
autoconf的一般範本檔為 .in 檔尾。 例如: config.h.in  =>  config.h Makefile.in  =>  Makefile
make 編譯,將原始碼轉成執行檔程式。
make 根據 Makefile 的編譯規則編譯。
前面提到, Makefile 由GNU autoconf, 從 Makefile.in 範本製作而成。
Makefile 中有很多特殊編譯功能。
GNU標準的 Makefile 功能

More Related Content

PDF
Apache安装配置mod security
PPTX
SQL Server 資料庫版本控管
PDF
Honey's Data Dinner#7 webpack 包達人(入門)
PPTX
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
PPTX
ASP.NET Core 6.0 全新功能探索
PDF
webpack 入門
PDF
CP 值很高的 Gulp
PPTX
前端框架發展
Apache安装配置mod security
SQL Server 資料庫版本控管
Honey's Data Dinner#7 webpack 包達人(入門)
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
ASP.NET Core 6.0 全新功能探索
webpack 入門
CP 值很高的 Gulp
前端框架發展

What's hot (20)

PPT
use Nagios on openSUSE 11.4
PDF
PPTX
项目开发实践No.1
PPTX
快快樂樂學 Angular 2 開發框架
PPTX
前端各階段工作
PPTX
02.python.开发最佳实践
PDF
Deployment with Capistrano
PPT
Hadoop平台搭建
PDF
Node.js從無到有 基本課程
PDF
Continuous Delivery - Opening
PDF
從軟體開發角度
談 Docker 的應用
PDF
AWS EC2 for beginner
PDF
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
PDF
Koa 正在等一個人
PPTX
AKS 與開發人員體驗 (Kubernetes 大講堂)
PDF
Npm 套件管理 & 常用開發工具介紹
PDF
容器與 Gitlab CI 應用
PDF
Continuous Delivery with Ansible x GitLab CI
PPTX
Frontend Devops at Cloudinsight
PDF
前端工程師一定要知道的 Docker 虛擬化容器技巧
use Nagios on openSUSE 11.4
项目开发实践No.1
快快樂樂學 Angular 2 開發框架
前端各階段工作
02.python.开发最佳实践
Deployment with Capistrano
Hadoop平台搭建
Node.js從無到有 基本課程
Continuous Delivery - Opening
從軟體開發角度
談 Docker 的應用
AWS EC2 for beginner
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
Koa 正在等一個人
AKS 與開發人員體驗 (Kubernetes 大講堂)
Npm 套件管理 & 常用開發工具介紹
容器與 Gitlab CI 應用
Continuous Delivery with Ansible x GitLab CI
Frontend Devops at Cloudinsight
前端工程師一定要知道的 Docker 虛擬化容器技巧
Ad

Viewers also liked (14)

PPT
Afib slides-focused-update-2012
PPTX
Tobacco budget update nov 2011a
PDF
The holy bible new international version - niv (pdf)
PDF
Biodinamika
PDF
Appendix r straw bale structures
PPT
Group2 final proj lesson1
PDF
Im db best actors - top 250 - a list by yves porters- copied by samir rafla
PDF
Egypt at the 2016 summer olympics
ODP
Object-Oriented Programming Design with Greenfoot 02
PPT
Naya presentation
PDF
Democraciasinpartidos
PDF
Ecg commentary from saudi arabia 2004 white
PPTX
Psd funding report final
PPTX
Presentation2
Afib slides-focused-update-2012
Tobacco budget update nov 2011a
The holy bible new international version - niv (pdf)
Biodinamika
Appendix r straw bale structures
Group2 final proj lesson1
Im db best actors - top 250 - a list by yves porters- copied by samir rafla
Egypt at the 2016 summer olympics
Object-Oriented Programming Design with Greenfoot 02
Naya presentation
Democraciasinpartidos
Ecg commentary from saudi arabia 2004 white
Psd funding report final
Presentation2
Ad

Similar to GNU Build System (20)

ODP
GNU Autoconf / Automake #1
PPTX
20121111 linux intro
ODP
GNU Autoconf / Automake #4
PDF
makefile20141121
PDF
How A Compiler Works: GNU Toolchain
PDF
from Source to Binary: How GNU Toolchain Works
PDF
Continuous Delivery with Ansible x GitLab CI (2e)
PPT
20030623 linuxbasic and-security
PDF
現代 IT 人一定要知道的 Ansible 自動化組態技巧
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
PPTX
Hcsm lect-20120913
PDF
Continuous Delivery Workshop with Ansible x GitLab CI
PDF
Automate with Ansible basic (3/e)
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (5th)
PPT
Linux常用命令与工具简介
ODP
FreeBSD 文件翻譯計劃
PDF
Ruby on Rails 開發環境建置 for Ubuntu
DOCX
系統程式 -- 第 1 章 系統軟體
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
PDF
Linux network monitoring hands-on pratice
GNU Autoconf / Automake #1
20121111 linux intro
GNU Autoconf / Automake #4
makefile20141121
How A Compiler Works: GNU Toolchain
from Source to Binary: How GNU Toolchain Works
Continuous Delivery with Ansible x GitLab CI (2e)
20030623 linuxbasic and-security
現代 IT 人一定要知道的 Ansible 自動化組態技巧
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Hcsm lect-20120913
Continuous Delivery Workshop with Ansible x GitLab CI
Automate with Ansible basic (3/e)
Continuous Delivery Workshop with Ansible x GitLab CI (5th)
Linux常用命令与工具简介
FreeBSD 文件翻譯計劃
Ruby on Rails 開發環境建置 for Ubuntu
系統程式 -- 第 1 章 系統軟體
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
Linux network monitoring hands-on pratice

More from imacat . (20)

ODP
A Room of WikiWomen's Own
ODP
Office寶可夢GO IV計算機
ODP
Crossing Office Applications
ODP
OpenOffice Application with Python
ODP
從doc、docx、odt到Google Docs
ODP
More Girls – Creating a Community of Diversity
ODP
Welcome to Apache OpenOffice 4
ODP
OpenOffice, Open Business
ODP
Multimedia Fun with OpenOffice Calc
ODP
Welcome to Apache OpenOffice 3.4 COSCUP 2012
ODP
Mosaic Fun with OpenOffice Calc
ODP
Solitaire with Greenfoot #3
ODP
Solitaire with Greenfoot #1
ODP
Solitaire with Greenfoot #4
ODP
Solitaire with Greenfoot #2
ODP
Solitaire with Greenfoot #2/4
ODP
Object-Oriented Programming Design with Greenfoot 01
ODP
Welcome to Apache OpenOffice 3.4
ODP
OpenOffice UNO Application on Android
ODP
OpenOffice.org Magic Sandbox
A Room of WikiWomen's Own
Office寶可夢GO IV計算機
Crossing Office Applications
OpenOffice Application with Python
從doc、docx、odt到Google Docs
More Girls – Creating a Community of Diversity
Welcome to Apache OpenOffice 4
OpenOffice, Open Business
Multimedia Fun with OpenOffice Calc
Welcome to Apache OpenOffice 3.4 COSCUP 2012
Mosaic Fun with OpenOffice Calc
Solitaire with Greenfoot #3
Solitaire with Greenfoot #1
Solitaire with Greenfoot #4
Solitaire with Greenfoot #2
Solitaire with Greenfoot #2/4
Object-Oriented Programming Design with Greenfoot 01
Welcome to Apache OpenOffice 3.4
OpenOffice UNO Application on Android
OpenOffice.org Magic Sandbox

GNU Build System