Thursday, March 17, 2005

Yes, The ethereal works in my iBook

Yes, I finally had successfully made the ethereal work now. The Mac OS X in my iBook came with no X11 to me, and now I had the GUI ethereal inside. There are usually two ways to achieve it. The first one is to get the binary file, it means installing the binary file in the Fink package. The second one is to get the source code and compile it and usually comes with lots of troubles and problems to be solved by self.

To deal with X11 in Mac OS X, the fink package is a nice and convenient solution to it. But the flaw is what it gives is more than what you want and lacking of the experience of understanding and interacting with lower layers in Unix-like environment. To get the source code and to compile it is the way the geeks likes to go ahead. But it is fulled with lots of stones waiting to be moved away, such as lacking of some library when configuring another library.

I am so happy to finish it in this two weeks. In the meantime, I almost wanted to give up compiling the GUI ethereal code sometimes. Over here, I post the problems happened to me and my solutions to them.

First of all, download the ethereal source code from the official website, and then to compile it. If without X11 environment, it would complain a lot. My experience is to follow the complaint, and then the solution will be solved, but usually more complaints and problems occur. I think that's OK. Nothing worthy to worry, because starting from scratch always needs more efforts.

pkg-config must be install, because most configure files check the needed packages through it. Such as,

pkg-config --libs gtk+-2.0
pkg-config --clfags gtk+-2.0

pkg-config --list-all

will show the packages installed and pkg-config usually checks the directory /usr/local/lib/pkgconfig, and this directory path is depended during the installing option. Or set PKG_CONFIG_PATH also works.

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/X11R6/lib/pkgconfig"

Gtk+2.4
____GLib-2.6.3
________GNU gettext library
____atk
____pango
____fontconfig
________freetype2 library
________expat library
________ft2build.h
____TIFF library (libtiff)
____JPEG library (libjpeg)
____PNG library (libpng)
____xrender (libXrender)
____libX11 (<--I'm not sure if need it or not)
________libXrender
________xproto
________xextensions
________xtrans
________xau

XFree86-4.4.0-src-[1..7].tgz or the same as X11R6.8.2-src.tar.gz is installed.

The libraries hierarchy is simply like above. After installing the libraries, I had some problem like below.

$ otool -L `which gtk-demo.old`
usr/local/bin/gtk-demo.old:
...
/usr/local/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.1.0)
...

$ otool -L `which xlogo`
usr/X11R6/bin/xlogo:
...
/usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0, current version 6.2.0)
...

$ gtk-demo.old
_X11TransOpen: Unable to find transport for local

Gtk-WARNING **: cannot open display


Recompiling Xrender xft pango Xcursor xfixes by linking to /usr/X11R6/lib/libX11.6.dylib

Finally, it appears.

ethereal

otool -L is the ldd program in Darwin.

find . -newer older ! -newer newer,
I used to find some files created between older and newer.

Sunday, March 13, 2005

ethereal part 2

checking Pango flags... -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -L/usr/local/lib -lpangoxft-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv
configure: error:
*** Can't link to Pango. Pango is required to build
*** GTK+. For more information see http://www.pango.org

Writing a pango.modules file to use when running examples before installing Pango.
dyld: /Users/apple/Desktop/Source/gtk/pango-1.8.1/pango/.libs/pango-querymodules version mismatch for library: /usr/X11R6//lib/libfreetype.6.dylib (compatibility version of user: 10.0.0 greater than library's version: 6.3.0)
make[2]: *** [pango.modules] Error 133
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

$otool -L /usr/X11R6/lib/libfreetype.6.dylib
/usr/X11R6/lib/libfreetype.6.dylib:
/usr/X11R6/lib/libfreetype.6.dylib (compatibility version 6.3.0, current version 6.3.0)
...

$ otool -L ./objs/.libs/libfreetype.dylib
./objs/.libs/libfreetype.dylib:
/usr/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.7.0)
...

http://forums.macosxhints.com/archive/index.php/t-27078.html

checking for GTK+ - version >= 2.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding GTK+ or finding the wrong
*** version of GTK+. If it is not finding GTK+, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH

$ ls -l /usr/X11R6/lib/libfreetype.*
/usr/X11R6/lib/libfreetype.6.3.7.dylib
/usr/X11R6/lib/libfreetype.6.3.dylib
/usr/X11R6/lib/libfreetype.6.dylib -> libfreetype.6.3.dylib
/usr/X11R6/lib/libfreetype.a
/usr/X11R6/lib/libfreetype.dylib -> libfreetype.6.3.dylib
/usr/X11R6/lib/libfreetype.la

$ ls -l /usr/local/lib/libfreetype.*
/usr/local/lib/libfreetype.6.3.7.dylib
/usr/local/lib/libfreetype.6.dylib -> libfreetype.6.3.7.dylib
/usr/local/lib/libfreetype.a
/usr/local/lib/libfreetype.dylib -> libfreetype.6.3.7.dylib
/usr/local/lib/libfreetype.la

$ otool -L /usr/X11R6/lib/libfreetype.6.dylib
/usr/X11R6/lib/libfreetype.6.dylib:
/usr/X11R6/lib/libfreetype.6.dylib (compatibility version 6.3.0, current version 6.3.0)
...

$ otool -L /usr/local/lib/libfreetype.6.dylib
/usr/local/lib/libfreetype.6.dylib:
/usr/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.7.0)
...

# ln -sf /usr/local/lib/libfreetype.6.3.7.dylib /usr/X11R6/lib/libfreetype.6.dylib

$ ls -l /usr/X11R6/lib/libfreetype.*
/usr/X11R6/lib/libfreetype.6.3.7.dylib
/usr/X11R6/lib/libfreetype.6.3.dylib
/usr/X11R6/lib/libfreetype.6.dylib -> /usr/local/lib/libfreetype.6.3.7.dylib

/usr/X11R6/lib/libfreetype.a
/usr/X11R6/lib/libfreetype.dylib -> libfreetype.6.3.dylib
/usr/X11R6/lib/libfreetype.la

(ethereal:7236): Gtk-WARNING **: cannot open display:

Wednesday, March 02, 2005

The GUI ethereal implement on My iBook

Download ethereal-0.10.9 from the ethereal official website.
Configure it, then get the error messages like below,

Error Message:
checking for pkg-config... no
checking for GTK+ - version >= 2.0.0... no
*** A new enough version of pkg-config was not found.
*** See http://pkgconfig.sourceforge.net
checking for pkg-config... (cached) no
checking for GLIB - version >= 2.0.0... no
*** A new enough version of pkg-config was not found.
*** See http://www.freedesktop.org/software/pkgconfig/
configure: error: GLib2 distribution not found.


I come to download the thing, called pkg-config
Configure and make successfully.
(Remember to su to be root, and pkt-config is located at /usr/local/bin,
so maybe the path should be added into the environment vairable PATH)

/usr/local/bin/pkg-config

Go back to download GLib2, and GTK+ 2.4 by the way
Configure them, and also get the similar error messages

GLib Error output:
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html

Gtk+ Error Output:
checking for glib-2.0 >= 2.6.0 atk >= 1.0.1 pango >= 1.8.0... Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found

configure: error: Library requirements (glib-2.0 >= 2.6.0 atk >= 1.0.1 pango >= 1.8.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.


...I almost lose my control.

To get the gettext library, then configure, make, and install.
After installing gettext library, the GLib library also can configure, make and install easily.


But for the gtk+, it is NOT a easy work, because it still needs atk and pango softwares.
I think my goal is to build the ethereal, which just need the GLib library enoughly.
So, I finally give up trying to install gtk+.
Back to the ethereal, it is very fine to configure, but I spend lots of time waiting for its compiling.//<--Just the tethereal command-line program can be produced, not GUI ethereal program.

<--------Goback to deal with Gtk+------------>

pango Error Message:
checking for fontconfig >= 1.0.1... Package fontconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `fontconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fontconfig' found
configure: WARNING: No fontconfig found, skipping tests for FreeType and Xft
configure: error: *** Didn't find any of FreeType, X11, or Win32.
*** Must have at least one backend to build Pango.

fontconfig Error Message:
checking for freetype-config... no
configure: error: You must have freetype installed; see http://www.freetype.org/

fontconfig Error Message #2:
checking expat.h usability... no
checking expat.h presence... no
checking for expat.h... no
checking xmlparse.h usability... no
checking xmlparse.h presence... no
checking for xmlparse.h... no
configure: error: Cannot find usable expat library. This could mean that your version is too old.


Find expat library to solve the above problem.

fontconfig error message #3:
Christine:~/Desktop/Source/gtk/fontconfig-2.2.99 apple$ make
make all-recursive
Making all in fontconfig
make[2]: Nothing to be done for `all'.
Making all in fc-case
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I.. -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -g -O2 -MT fc-case.o -MD -MP -MF ".deps/fc-case.Tpo" -c -o fc-case.o `test -f 'fc-case.c' || echo './'`fc-case.c; then mv -f ".deps/fc-case.Tpo" ".deps/fc-case.Po"; else rm -f ".deps/fc-case.Tpo"; exit 1; fi
In file included from ../src/fcint.h:39,
from fc-case.c:25:
../fontconfig/fcfreetype.h:27:22: ft2build.h: No such file or directory
../fontconfig/fcfreetype.h:28:10: #include expects "FILENAME" or
In file included from ../src/fcint.h:39,
from fc-case.c:25:
../fontconfig/fcfreetype.h:33: error: parse error before "FcFreeTypeCharIndex"
../fontconfig/fcfreetype.h:33: error: parse error before "face"
../fontconfig/fcfreetype.h:33: warning: type defaults to `int' in declaration of `FcFreeTypeCharIndex'
../fontconfig/fcfreetype.h:33: warning: function declaration isn't a prototype
../fontconfig/fcfreetype.h:33: warning: data definition has no type or storage class
../fontconfig/fcfreetype.h:36: error: parse error before "face"
../fontconfig/fcfreetype.h:36: warning: function declaration isn't a prototype
../fontconfig/fcfreetype.h:39: error: parse error before "face"
../fontconfig/fcfreetype.h:39: warning: function declaration isn't a prototype
../fontconfig/fcfreetype.h:42: error: parse error before "FT_Face"
../fontconfig/fcfreetype.h:42: warning: function declaration isn't a prototype
../fontconfig/fcfreetype.h:45: warning: type defaults to `int' in declaration of `FT_Face'
../fontconfig/fcfreetype.h:45: error: parse error before "f"
../fontconfig/fcfreetype.h:45: warning: function declaration isn't a prototype
In file included from fc-case.c:25:
../src/fcint.h:596: error: parse error before "encoding"
../src/fcint.h:596: warning: function declaration isn't a prototype
make[2]: *** [fc-case.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


The error above is about find no ft2build.h to lead to have no declaration of some types.

freetype2, well, It seems there are some problems of install after compiling successfully.
My experience is
build/unix/configure --prefix=`freetype-config --prefix`
then make install, it becomes ok.

GTK+ error message:
checking for TIFFReadScanline in -ltiff... no
checking for TIFFWriteScanline in -ltiff... no
checking for TIFFFlushData in -ltiff34... no
configure: WARNING: *** TIFF loader will not be built (TIFF library not found) ***
configure: error:
*** Checks for TIFF loader failed. You can build without it by passing
*** --without-libtiff to configure but some programs using GTK+ may
*** not work properly


To get libtiff. Everything of it works ok.

GTK+ error message AGAIN:
checking for jpeg_destroy_decompress in -ljpeg... no
configure: WARNING: *** JPEG loader will not be built (JPEG library not found) ***
configure: error:
*** Checks for JPEG loader failed. You can build without it by passing
*** --without-libjpeg to configure but some programs using GTK+ may
*** not work properly


Get libjpeg from http://www.ijg.org/files/jpegsrc.v6b.tar.gz (not from ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6.zip, it seemed an error in configure file), then configure, but there are still some BIG problems over here.
First, the default configure doesn't produce any dynamic libraries.
Some arguments must be added after configure, such as
./configure --enable-static --enable-shared --host=powerpc-apple-darwin7.8.0
but, after the configure setup above, there is a problem that libtool doesn't exist.
Check the README or INSTALL file to see the reason.
My soultion is copy the libtool from other directoy, such as gtk+/libtool.
Then make and make install successfully.

$ find . -iname "libjpeg.*"
./.libs/libjpeg.62.0.0.dylib
./.libs/libjpeg.62.dylib
./.libs/libjpeg.dylib
./.libs/libjpeg.la
./.libs/libjpeg.lai
./libjpeg.a
./libjpeg.doc
./libjpeg.la



checking for TIFFReadScanline in -ltiff... yes
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for jpeg_destroy_decompress in -ljpeg... yes
checking for jpeglib.h... yes
checking for jpeg_simple_progression in -ljpeg... yes
checking for libpng12... no
checking for png_read_info in -lpng... no
configure: WARNING: *** PNG loader will not be built (PNG library not found) ***
configure: WARNING: *** PNG loader will not be built (PNG header file not found) ***
configure: error:
*** Checks for PNG loader failed. You can build without it by passing
*** --without-libpng to configure but many programs using GTK+ will
*** not work properly. The PNG loader is also needed if you are compiling
*** from CVS.


To get libpng, then copy makefile.darwin from scripts/, then make and make install.

GTK+ error messg again:
configure: error: Xft Pango backend is required for x11 target


pkg-config to check all the pc files. (Add sepcific the path of pc to PCK_CONFIG_PATH if needed)
My soultion is modify the makefile, around line #40,
There is a description:
#am__append_2 = pangoxft.pc
Remember to enable this line. It will copy pangoxft.pc to /usr/X11R6/lib/pkgconfig/

checking for X... no
configure: error: X development libraries not found

checking for xrender >= 0.8.2... Package xrender was not found in the pkg-config search path.
Perhaps you should add the directory containing `xrender.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xrender' found
checking for xrender >= 0... Package xrender was not found in the pkg-config search path.
Perhaps you should add the directory containing `xrender.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xrender' found
checking for X... no
checking X11/extensions/Xrender.h usability... no
checking X11/extensions/Xrender.h presence... no
checking for X11/extensions/Xrender.h... no
configure: error: Xrender.h not found.


Get libXrender, then configue...get Error Message:
checking for x11... Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
checking for X... no
configure: error: X is required, but it was either disabled or not found.


Get libX11, then configure...get Error Message:
checking for xproto... Package xproto was not found in the pkg-config search path.
Perhaps you should add the directory containing `xproto.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xproto' found

configure: error: Library requirements (xproto) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.


Get xproto and configure successfully. Something strange is "make install" directly instead of make.

configure libX11, get Error Report:
checking for xextensions xtrans xau... Package xextensions was not found in the pkg-config search path.
Perhaps you should add the directory containing `xextensions.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xextensions' found

configure: error: Library requirements (xextensions xtrans xau) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.


Gett xextensions, and configure successfully.

checking for xextensions xtrans xau... Package xtrans was not found in the pkg-config search path.
Perhaps you should add the directory containing `xtrans.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xtrans' found

configure: error: Library requirements (xextensions xtrans xau) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.


I CANNOT find any resource of xtrans, so finally I get the sources from cvs.
Configure xtrans and make install (no make progress).

There is still error message, but I didn't record it. That is about no libXau.
So I get libXau to configure and make, then make install.

Finally, I can configure the libX11 successfully.

It's not ending, there is something waiting to be done.

---
In the meantime, I compile the Nmap-3.81 source code successfully,
but I don't install it into the proper directory.
I just use it in the local directory.
---

Tuesday, March 01, 2005

Think from Automatik

Automatik 是德文機器錶的意思, 德國做的產品都很有質感, 而且給人值得信賴的感覺

錶的價值不能夠單用金錢就可以橫量的, 特別是她代表著上一代所傳承下來的精神象徵, 比如在 Watchbus中的一篇文章:父親的錶

此外一顆名貴的錶也會因為她的主人超乎常人的精神, 而更彰顯出其更不平凡的價值所在, 同樣也是在Watchbus中的一篇文章:腕錶人物:Ernesto Che Guevara 切·格瓦拉

我曾經在民雄的一間錶店, 與店老闆聊了幾回, 也親眼見到 雙P龍頭 的 PP, 據他說那顆 PP 已經有 50 年歷史了, 到現在還是可以正常動作, 我看著那顆錶, 上面充滿了時間所留下痕跡, 就如同他所言, 這顆錶放在街上, 別人也不會知道這就是有名的 PP 呀!同樣地也是在老闆的熱忱下, 見識到 玫瑰金色的 PP 5053 新錶, 她就躺在頗典型的長條錶盒裡, 見到溫暖的玫瑰金色, 頓時覺得好感動...

我不是個專業的, 也不是愛錶成痴的錶迷, 但我願意購買一支出自名家的機械錶, 因為我相信她值得我這麼做, 我也相信我值得擁有她...