せっかくのログを見てなかったオレ

GNU Autoconf/Automake/Libtool

GNU Autoconf/Automake/Libtool


config.logを読め、ということですな...


...と思ったらconfig.logの内容がえらく中途半端になってるんだけど...なんでだ。
それに生成されるlibtoolが古いような気がする。


↓imlibのconfigureで生成されるlibtool

[libra55 ~/src/imlib-1.9.15]$ head libtool
#! /usr/local/bin/bash

# libtoolT - Provide generalized library-building support services.
# Generated automatically by  (GNU imlib 1.9.15)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:

↓libjpegのconfigureで生成されるlibtool

[libra55 ~/src/jpeg-6b]$ head libtool
#! /bin/sh

# libtool - Provide generalized library-building support services.
# Generated automatically by ltconfig - GNU libtool 1.2
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
#
# Copyright (C) 1996-1998 Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify


そもそもシェルが違う。(^_^;)


でもってltconfigってファイルがlibjpegにあって、imlibにはない。なんだこのスクリプト。configureから呼び出されてるけど。


ltmain.shの内容がまったく違うので、念のためimlibのltmain.shをコピーしてきてみてconfigureしてみると結果は同じ。config.logの内容も同じ。


原因はltconfigというスクリプトにあると見た!

JPEGのライブラリだけナゼ?

http://freshmeat.net/projects/libjpeg/

↑ここから取ってきたtarballを解凍してビルドしてるんだけど...


なぜsharedがサポートされていないと言い張るのか。まだワカラン。


Makefile.amもconfigure.inも同梱されてないから直接configureスクリプトを見てます。クラクラします。っていうかイライラします。


(#゚Д゚)y-~~

libjpegをビルドしようと思ったらコケた

libjpegをビルドしようとしたら「shared libraryはサポートされてません」と怒られる。

[libra55 ~/src/jpeg-6b]$ ./configure --prefix=$HOME --enable-static --enable-shared
checking for gcc... gcc
checking whether the C compiler (gcc  -L/home/libra55/lib -L/usr/local/lib) work
s... yes
checking whether the C compiler (gcc  -L/home/libra55/lib -L/usr/local/lib) is a
 cross-compiler... no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E

      (中略)

checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes


なんでだ。libtoolがsharedをサポートしてないと出る。
imlibのconfigureの方ではちゃんと

checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for f77 option to produce PIC... -fPIC
checking if f77 PIC flag -fPIC works... yes
checking if f77 supports -c -o file.o... yes
checking whether the f77 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... freebsd6.1 ld.so
checking how to hardcode library paths into programs... immediate

shared libraryがサポートされていると出る。
libtoolのバージョンが違うのかと思ってlibjpeg内、imlib内のlibtoolを見比べていたが違いがない。何が処理結果の違いになっているのかチンプンカンプン。

ライブラリが見つからない

imlibをビルドしようとしてconfigureするとライブラリを見つけてくれなくて、「これじゃビルドできねーよ!」と怒られる。なぜだろう。もちろんライブラリは揃っているのだが。

[libra55 ~/src/imlib-1.9.15]$ ./configure --prefix=$HOME --enable-static --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no

    (中略)

checking whether shmctl IPC_RMID allowes subsequent attaches... no
checking X11/extensions/XShm.h... no
checking for jpeg_destroy_decompress in -ljpeg... no
configure: error: *** JPEG library not found ***


どこのパスを探しに行ってるんだ...?ライブラリの検索パスはどの環境変数見てるんだ?あれこれexportしてみたけど、何も変わらず。


仕方ないからautomake/autoconfを勉強してみることに。昔、Unixの仕事してるときにちょっといじった記憶はあるのだが...もうすっかり忘れた。


GNU Autoconf/Automake/Libtool

GNU Autoconf/Automake/Libtool

↑この本を購入。

内臓までいじってやる

おもしろそうなので買っちまいました。

Binary Hacks ―ハッカー秘伝のテクニック100選

Binary Hacks ―ハッカー秘伝のテクニック100選


以前から気にはなってたんだけど。


まだ目次に目を通して、パラパラと中身を見ただけど、この本おもしれぇ…