<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.maru.cc &#187; Linux</title>
	<atom:link href="http://blog.maru.cc/archives/category/programing/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.maru.cc</link>
	<description>くるくる回せ</description>
	<lastBuildDate>Sat, 23 Oct 2010 16:53:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>「GNU Autotools で Hello World !」をやってみた</title>
		<link>http://blog.maru.cc/archives/99/</link>
		<comments>http://blog.maru.cc/archives/99/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 04:58:55 +0000</pubDate>
		<dc:creator>maru_cc</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.maru.cc/archives/99</guid>
		<description><![CDATA[mirさんの記事の「GNU Autotools で Hello World !」をやってみました。
Autotoolsというのを使って、Makeファイルを作っちゃおうというものです。
そもそも、Linux上でCを書いた経 [...]]]></description>
			<content:encoded><![CDATA[<p>mirさんの記事の「<a href="http://mirz.jp/helloworld_autotools.html" class="blank">GNU Autotools で Hello World !</a>」をやってみました。<br />
Autotoolsというのを使って、Makeファイルを作っちゃおうというものです。<br />
そもそも、Linux上でCを書いた経験もないので、ほとんど記事のまんまですが。。</p>
<p>環境は、Windows上のVMwareにCentOS4.4の環境です。</p>
<p>ページを参考に、ファイルを作ってみます。</p>
<pre><code>
# ll
-rw-rw-r--  1 maruta maruta 45 11  3 16:58 Makefile.em
-rw-rw-r--  1 maruta maruta 70 11  3 16:59 configure.in
-rw-rw-r--  1 maruta maruta 75 11  3 16:58 hello.c
</code></pre>
<p>ここでよく見ると Makefile.emになってます。。 Makefile.amじゃないとダメなのですがタイポしてます。<br />
行った作業のままに書いてみます。</p>
<p>記事を参考に autoconfを実行</p>
<pre><code>
$ autoconf
-bash: autoconf: command not found
</code></pre>
<p>どうやら入っていないようです。。</p>
<pre><code>
$ yum list | grep autoconf
autoconf.noarch                          2.59-5                 base
autoconf213.noarch                       2.13-9                 base
</code></pre>
<p>どちらを入れればいいのかわからないのですが。。<br />
とりあえず実行。</p>
<pre><code>
# yum install autoconf
Setting up Install Process
Setting up repositories

update                    100% |=========================|  951 B    00:00     

base                      100% |=========================| 1.1 kB    00:00     

addons                    100% |=========================|  951 B    00:00 ETA
addons                    100% |=========================|  951 B    00:00     

extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files

primary.xml.gz            100% |=========================| 150 kB    00:12     

update    : ################################################## 483/483
Added 13 new packages, deleted 0 old in 2.04 seconds

primary.xml.gz            100% |=========================|  61 kB    00:00     

extras    : ################################################## 252/252
Added 9 new packages, deleted 0 old in 0.82 seconds
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for autoconf to pack into transaction set.

autoconf-2.59-5.noarch.rp 100% |=========================|  17 kB    00:00
---> Package autoconf.noarch 0:2.59-5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 autoconf                noarch     2.59-5           base              628 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 628 k
Is this ok [y/N]: y
Downloading Packages:

(1/1): autoconf-2.59-5.no  87% |=====================    | 552 kB    00:00 ETA
(1/1): autoconf-2.59-5.no 100% |=========================| 628 kB    00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction

  Installing: autoconf                     ######################### [1/1] 

Installed: autoconf.noarch 0:2.59-5
Complete!
</code></pre>
<p>ちゃんと入ったようなので続き。</p>
<pre><code>
$ autofonfconf
configure.in:2: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
</code></pre>
<p>なんか、大丈夫そうです。<br />
次に、aclocal</p>
<pre><code>
$ aclocal
-bash: aclocal: command not found
$ yum list  | grelp aclocal
</code></pre>
<p>同じく入っていないようです。。<br />
しかも、yumにもそれらしいパッケージはありません。</p>
<p>困ったときのGoogleさん。<br />
「aclocal インストール」でぐぐったらビンゴです。<br />
<a href="http://www.linux.or.jp/JF/JFdocs/LFS-BOOK/chapter06/automake.html" class="blnak">http://www.linux.or.jp/JF/JFdocs/LFS-BOOK/chapter06/automake.html</a><br />
どうやら、Automakeと一緒に入るようです。</p>
<pre><code>
# yum install automake
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for automake to pack into transaction set.

automake-1.9.2-3.noarch.r 100% |=========================|  23 kB    00:00
---> Package automake.noarch 0:1.9.2-3 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 automake                noarch     1.9.2-3          base              442 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 442 k
Is this ok [y/N]: y
Downloading Packages:

(1/1): automake-1.9.2-3.n 100% |=========================| 442 kB    00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction

  Installing: automake                     ######################### [1/1] 

Installed: automake.noarch 0:1.9.2-3
Complete!
</code></pre>
<p>確認してみると、ちゃんと入ってます。</p>
<pre><code>
$ which aclocal
/usr/bin/aclocal
</code></pre>
<p>aclocal、autoconfを実行。</p>
<p>次にautomakeを実行します。</p>
<pre><code>
$ automake
configure.in: required file `./install-sh' not found
configure.in: required file `./missing' not found
automake: no `Makefile.am' found for any configure output
</code></pre>
<p>なんか変です。。<a href="http://mirz.jp/helloworld_autotools.html" class="blank">記事の内容</a>とエラーのコメント数が違います。</p>
<p>まぁ環境の違いだろうーぐらいの軽い気持ちで先に進んでみます。</p>
<pre><code>
$ automake -c -a -c
configure.in: installing `./install-sh'
configure.in: installing `./missing'
automake: no `Makefile.am' found for any configure output
$ ls -CF
Makefile.em  aclocal.m4  autom4te.cache/  configure*  configure.in  hello.c  install-sh*  missing*
</code></pre>
<p>確実に変です。。<br />
COPYING、INSTALL、depcomp、install-sh、missingとかが出来るはずですが、出来ていません。</p>
<p>よくよく見比べてみると・・・・・・・・なんか、ファイル名が違う・・<br />
というわけで、リネームして再実行</p>
<pre><code>
$ mv Makefile.em Makefile.am
$ automake
Makefile.am: required file `./INSTALL' not found
Makefile.am: required file `./NEWS' not found
Makefile.am: required file `./README' not found
Makefile.am: required file `./AUTHORS' not found
Makefile.am: required file `./ChangeLog' not found
Makefile.am: required file `./COPYING' not found
Makefile.am: required file `./depcomp' not found
$ automake -a -c
Makefile.am: installing `./INSTALL'
Makefile.am: required file `./NEWS' not found
Makefile.am: required file `./README' not found
Makefile.am: required file `./AUTHORS' not found
Makefile.am: required file `./ChangeLog' not found
Makefile.am: installing `./COPYING'
Makefile.am: installing `./depcomp'
$ ls -CF
COPYING  Makefile.am  autom4te.cache/  configure.in  hello.c      missing*
INSTALL  aclocal.m4   configure*       depcomp*      install-sh*
</code></pre>
<p>おぉ、こんどはばっちりですね。</p>
<p>続き</p>
<pre><code>
$ touch NEWS README AUHAUTHORS ChangeLog
[maruta@vmmaruta works]$ automake
Makefile.am: required file `./README' not found
Makefile.am: required file `./AUTHORS' not found
</code></pre>
<p>ん？？　なんか変だ。。というわけで確認するとタイポが</p>
<pre><code>
$ ll
 252
-rw-r--r--  1 maruta maruta  17992 11  3 17:09 COPYING
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 ChangeLog
-rw-r--r--  1 maruta maruta   9273 11  3 17:09 INSTALL
-rw-rw-r--  1 maruta maruta     45 11  3 16:58 Makefile.am
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 NEWS
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 READMEAUTHORS
-rw-rw-r--  1 maruta maruta  38499 11  3 17:08 aclocal.m4
drwxr-xr-x  2 maruta maruta   4096 11  3 17:08 autom4te.cache
-rwxrwxr-x  1 maruta maruta 121589 11  3 17:08 configure
-rw-rw-r--  1 maruta maruta     70 11  3 16:59 configure.in
-rwxr-xr-x  1 maruta maruta  15205 11  3 17:09 depcomp
-rw-rw-r--  1 maruta maruta     75 11  3 16:58 hello.c
-rwxr-xr-x  1 maruta maruta   9206 11  3 17:09 install-sh
-rwxr-xr-x  1 maruta maruta  10587 11  3 17:09 missing
$ rm READMEAUTHORS
$ touch README ATUTHORS
$ automake
Makefile.am: required file `./AUTHORS' not found
$ mv ATUTHORS AUTHORS
$ automake
$ ll
 272
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 AUTHORS
-rw-r--r--  1 maruta maruta  17992 11  3 17:09 COPYING
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 ChangeLog
-rw-r--r--  1 maruta maruta   9273 11  3 17:09 INSTALL
-rw-rw-r--  1 maruta maruta     45 11  3 16:58 Makefile.am
-rw-rw-r--  1 maruta maruta  16586 11  3 17:10 Makefile.in
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 NEWS
-rw-rw-r--  1 maruta maruta      0 11  3 17:10 README
-rw-rw-r--  1 maruta maruta  38499 11  3 17:08 aclocal.m4
drwxr-xr-x  2 maruta maruta   4096 11  3 17:08 autom4te.cache
-rwxrwxr-x  1 maruta maruta 121589 11  3 17:08 configure
-rw-rw-r--  1 maruta maruta     70 11  3 16:59 configure.in
-rwxr-xr-x  1 maruta maruta  15205 11  3 17:09 depcomp
-rw-rw-r--  1 maruta maruta     75 11  3 16:58 hello.c
-rwxr-xr-x  1 maruta maruta   9206 11  3 17:09 install-sh
-rwxr-xr-x  1 maruta maruta  10587 11  3 17:09 missing
</code></pre>
<p>なんかミスしまくってますが、なんとか出来ました。</p>
<p>続いて configure！</p>
<pre><code>
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
</code></pre>
<p>無事通りました！</p>
<p>rootにsuしてから make install</p>
<pre><code>
# make install
if gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"hello\" -DVERSION=\"0.1\"  -I. -I.     -g -O2 -MT hello.o -MD -MP -MF ".deps/hello.Tpo" -c -o hello.o hello.c; \
then mv -f ".deps/hello.Tpo" ".deps/hello.Po"; else rm -f ".deps/hello.Tpo"; exit 1; fi
gcc  -g -O2   -o hello  hello.o
make[1]: Entering directory `/home/maruta/works'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
  /usr/bin/install -c 'hello' '/usr/local/bin/hello'
make[1]: `install-data-am'
make[1]: Leaving directory `/home/maruta/works'
</code></pre>
<p>ばっちりですね。</p>
<pre><code>
$ which hello
/usr/local/bin/hello
$ hello
Hello World!
</code></pre>
<p>ちゃんと入りました～</p>
<p>まぁ、記事見ながらそのまんまやったので、入って当たり前ですが。<br />
やっぱり自分の手を動かしながらやるとタイポも含めて、少しでも身にしみてくるような気がします。<br />
これを踏まえて、MySQLディレクトリの中とか見てみると、違った発見がありそうです。</p>
<p>今回、Linuxのインストール時に開発ツールを選択しなかったためと思われますが、automake、autoconfの2つが必要でした。<br />
また、<a href="/archives/92">MySQLのソースコンパイル時</a>に入れた、gcc、なども必要かもしれません。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maru.cc/archives/99/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rsyncインストール</title>
		<link>http://blog.maru.cc/archives/60/</link>
		<comments>http://blog.maru.cc/archives/60/#comments</comments>
		<pubDate>Fri, 17 Jun 2005 12:34:55 +0000</pubDate>
		<dc:creator>maru_cc</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.maru.cc/archives/60</guid>
		<description><![CDATA[バックアップにrsyncをcronで動かそうとしたらrsync動かない。
サーバは最小構成で作ったのでインストールしてないかった。
んで、インストール
cd /usr/local/src/
wget ftp://ftp. [...]]]></description>
			<content:encoded><![CDATA[<p>バックアップにrsyncをcronで動かそうとしたらrsync動かない。<br />
サーバは最小構成で作ったのでインストールしてないかった。</p>
<p>んで、インストール</p>
<p>cd /usr/local/src/<br />
wget ftp://ftp.infoscience.co.jp/pub/rsync/rsync-2.6.5.tar.gz<br />
tar xvfz rsync-2.6.5.tar.gz<br />
cd rsync-2.6.5/<br />
./configure<br />
make<br />
make install</p>
<p>どこに入ったのか見てみたら /usr/local/bin/rsync に入っていた<br />
現状、他のサーバで動かしているのは /usr/bin/rsync が多いから<br />
リンクを張っとく。</p>
<p>ln -fs /usr/local/bin/rsync /usr/bin/rsync</p>
<p>これでOK</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maru.cc/archives/60/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>バッチ監視 よく使うコマンドはこれ</title>
		<link>http://blog.maru.cc/archives/56/</link>
		<comments>http://blog.maru.cc/archives/56/#comments</comments>
		<pubDate>Thu, 26 May 2005 15:30:00 +0000</pubDate>
		<dc:creator>maru_cc</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.maru.cc/archives/56</guid>
		<description><![CDATA[日付をまたいだ時のバッチがある。
DB変更したからバッチも少しいじってある。
なんかあったらまずいから、こんな時間に家で監視。
サービスしているサーバはIP制限かけてるから
普通につなぎにいくと当然はじかれる。
ので、V [...]]]></description>
			<content:encoded><![CDATA[<p>日付をまたいだ時のバッチがある。<br />
DB変更したからバッチも少しいじってある。<br />
なんかあったらまずいから、こんな時間に家で監視。</p>
<p>サービスしているサーバはIP制限かけてるから<br />
普通につなぎにいくと当然はじかれる。<br />
ので、VPNで会社につないで会社のIPをしょってサーバにつなぎに行く。</p>
<p>バッチやアクセスのログをファイルに吐き出すようにしているので、<br />
良く使うコマンドはこの2つ<br />
tail -f filename<br />
watch &#8211;interval=1 command</p>
<p>tailはファイルに追加されるデータを随時表示してくれるし、<br />
wotchはコマンドを指定秒数でくりかえし実行してくれる。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maru.cc/archives/56/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNSサーバ</title>
		<link>http://blog.maru.cc/archives/51/</link>
		<comments>http://blog.maru.cc/archives/51/#comments</comments>
		<pubDate>Mon, 23 May 2005 23:48:21 +0000</pubDate>
		<dc:creator>maru_cc</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.maru.cc/archives/51</guid>
		<description><![CDATA[うちは、自前でサーバを動かしてる
自宅においてないけど自宅サーバかな。
ドメインもいくつか持っててDNSサーバも自前で立ててる。
立ててからサブドメインを切ったりしてるが
うまくスレーブサーバに反映されない。
なぜだーと [...]]]></description>
			<content:encoded><![CDATA[<p>うちは、自前でサーバを動かしてる<br />
自宅においてないけど自宅サーバかな。</p>
<p>ドメインもいくつか持っててDNSサーバも自前で立ててる。<br />
立ててからサブドメインを切ったりしてるが<br />
うまくスレーブサーバに反映されない。</p>
<p>なぜだーとか思いつつ半放置だったが<br />
単にシリアル番号を更新してないだけだった。<br />
アホだぁ</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maru.cc/archives/51/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

