evas の次は ecore をビルドする。Ecore は EFL 内で使用頻度の高い処理をまとめた便宜関数を提供するライブラリである。*1
普通にビルドすると、リンク時によくある undefined reference が発生する。ecore_evas で発生し、不足しているのは X11 ということまではすんなりわかった。
とりあえず X11 をリンクすれば OK っぽいので、Makefile.am で指定するリンク時のオプションに -lX11 を追加する。
--- origsrc/ecore-0.9.9.042/src/lib/ecore_evas/Makefile.am 2008-01-24 08:43:35.000000000 +0900 +++ src/ecore-0.9.9.042/src/lib/ecore_evas/Makefile.am 2008-02-11 11:46:25.171875000 +0900 @@ -76,11 +76,12 @@ $(ECORE_WIN32_LIB) \ $(ECORE_SDL_LIB) \ $(top_builddir)/src/lib/ecore/libecore.la \ +-lX11 \ @EVAS_LIBS@ \ @XCB_LIBS@ \ @create_shared_lib@ -libecore_evas_la_LDFLAGS = -version-info @version_info@ +libecore_evas_la_LDFLAGS = -version-info @version_info@ @create_shared_lib@ libecore_evas_la_DEPENDENCIES = \ $(ECORE_X_LIB) \
ところがリビルドすると、別の警告が表示される。ビルドはできるが、pkg.log を見てみると、ecore_evas の DLL が生成されていない。
*** Warning: linker path does not have real file for library -lX11. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libX11 but no candidates were found. (...for file magic test) *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it.
cygwin ML に .la が存在しない場合の解決策として「libXrender.la がないから捏造してね」*2 というものがあるため、それを参考に libX11.la を捏造する。*3
これを /usr/X11R6/lib に置いて、先ほどの Makefile.am をそれを見に行かせるように修正する。(-lX11 → /usr/X11R6/lib/libX11.la に変更。)
--- origsrc/ecore-0.9.9.042/src/lib/ecore_evas/Makefile.am 2008-01-24 08:43:35.000000000 +0900 +++ src/ecore-0.9.9.042/src/lib/ecore_evas/Makefile.am 2008-02-11 11:46:25.171875000 +0900 @@ -76,11 +76,12 @@ $(ECORE_WIN32_LIB) \ $(ECORE_SDL_LIB) \ $(top_builddir)/src/lib/ecore/libecore.la \ +/usr/X11R6/lib/libX11.la \ @EVAS_LIBS@ \ @XCB_LIBS@ \ @create_shared_lib@ -libecore_evas_la_LDFLAGS = -version-info @version_info@ +libecore_evas_la_LDFLAGS = -version-info @version_info@ @create_shared_lib@ libecore_evas_la_DEPENDENCIES = \ $(ECORE_X_LIB) \
これで ecore のビルドが可能になる。
*1:convenience function を便宜関数と訳した。http://wiki.livedoor.jp/yushinhozumi/d/convenience%20function
*2:http://www.cygwin.com/ml/cygwin-xfree/2005-05/msg00208.html
*3:困るのは .la がない場合でも configure は pass するのに make でこけること。何のための configure なのか...。