lsを読まずにプログラマを名乗るな! #1

はじめに

技術書を読んで学んだことをこのブログにアウトプットしていきたいと思います。

タイトルにもありますが、まずはこの本を読んでいきます。

lsを読まずにプログラマを名乗るな!

lsを読まずにプログラマを名乗るな!

特に期限は決めず読み進めたいと思います。

検証環境

サンプルコードなどは次の環境で試します。

  • Debin 6.0.9@VPS

バージョンが古いですが、おそらく問題ないでしょう。

検証環境の構築

まず、lsが含まれるGNU coreutilsを入手してbootstrapを実行します。

$ git clone git://git.sv.gnu.org/coreutils
$ cd coreutils
$ ./bootstrap
./bootstrap: Error: 'autoconf' not found
./bootstrap: Error: 'automake' not found
./bootstrap: Error: 'autopoint' not found
./bootstrap: Error: 'bison' not found
./bootstrap: Error: 'gperf' not found
./bootstrap: Error: 'makeinfo' not found

早速エラーが出てますね。。。必要なパッケージをaptでインストールします。

$ sudo apt-get install autoconf automake bison gperf autopoint texinfo

もう一度bootstrapを実行します。

$ ./bootstrap 
./bootstrap: Error: 'automake' version == 1.11.1 is too old
./bootstrap:        'automake' version >= 1.11.2 is required

ダメですね。。。最新のautomekeを取ってきてインストールします。

$ mkdir -p ~/local/src
$ ce ~/local/src
$ wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
$ ./configure --prefix=$HOME/local
$ make
$ make install

PATHに$HOME/local/binを追加します。

$ automake --version
automake (GNU automake) 1.14
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.

これでautomakeのupdateは完了です。

$./bootstrap
・・・省略・・・
./bootstrap: done.  Now you can run './configure'.

無事にbootstrapの実行が終わりました。良かった良かった。

configure && make でlsのバイナリができるところまで確認したので、今日はこの辺にしておきます。

しおり

  • 10ページまで読んだ
  • TODO
    • GNU GLOBALのインストール