2.5 Libtool Development / Libtool 的發展
Over time, Unix systems added support for shared libraries.
隨著時間的推移,Unix 系統加入了共享函式庫的支援。
Conventional libraries, or static libraries, are linked into a program image. This means that each program which uses a static library includes some or all of the library in the program binary on disk.
傳統的函式庫,或稱為靜態函式庫,會直接連結到程式檔之中。這表示,每個使用靜態函式庫的程式,會把所使用的函式庫的部份或全部複製到位於磁碟上的程式機械碼檔案之中。
Shared libraries, on the other hand, are a separate file. A program which uses a shared library does not include a copy of the library; it only includes the name of the library. Many programs can use a single shared library.
另一方面,共享函式庫則是分離的檔案。使用了共享函式庫的程式不需把函式庫的內容複製到程式內部;僅需在程式檔案內記錄函式庫的名字。數個程式可以使用一個共享函示庫。
Using a shared library reduces disk space requirements. Since the system can generally share a single executable instance of the shared library among many programs, it also reduces swap space requirements at run time. Another advantage is that it is possible to fix a bug by updating the single shared library file on disk, without requiring all the programs which use the library to be rebuilt.
使用共享函式庫可以減少磁碟空間的使用需求。此外,在執行時系統可以讓多個程式共用一份共享函式庫的執行實體,因此也可以減少執行時期所需的記憶體分頁暫存空間需求。另外一個好處是,修正函式庫的臭蟲只需更新一份共享函式庫的檔案,而不需重新建置所有有用到函式庫的程式。
The first Unix shared library implementation was in System V release 3 from AT&T. The idea was rapidly adopted by other Unix vendors, appearing in SunOS, HP-UX, AIX, and Digital Unix among others. Unfortunately, each implementation differed in the creation and use of shared libraries and in the specific features which were supported.
第一個 Unix 的共享函式庫實作是在 AT&T 的 System V release 3 之中。這個概念很快的被其他 Unix 廠商採用,在 SunOS, HP-UX, AIX, 與 Digital Unix 等等都可以見到。遺憾的是,每個實作在函式庫的建立、使用與所支援的功能上都有些許的不同。
Naturally, packages distributed as source code which included libraries wanted to be able to build their own shared libraries. Several different implementations were written in the Autoconf/Automake framework.
很自然的,含有函式庫的原始碼套件會需要建置他們自己的共享函式庫。在 Autoconf/Automake 程式設計框架下,有好幾個不同的實作被撰寫出來。
In 1996, Gordon Matzigkeit began work on a package known as Libtool. Libtool is a collection of shell scripts which handle the differences between shared library generation and use on different systems. It is closely tied to Automake, although it is possible to use it independently.
在 1996 年,Gordon Matzigkeit 開始製作一個稱為 Libtool 的套件。 Libtool 是一組 shell 指令稿,用來應付在不同系統上產生與使用共享函式庫的差異。 Libtool 是針對 Automake 而製作的,但也可以被獨立的使用。
Over time, Libtool has been enhanced to support more Unix variants and to provide an interface for standardizing shared library features.
隨著時間的推移,Libtool 現在可以支援比剛發表時更多的 Unix 衍伸系統,並且也提供了一個標準化的界面來操作共享函式庫。