Ubuntu で OMake をソースからまんまビルドすると OMake の -P が動かないよ

http://bugzilla.metaprl.org/cgi-bin/show_bug.cgi?id=738

Ubuntu's new ld behaves a bit differently as known as ld-as-needed, and due to this, the build of OMake in Ubuntu succeeds but without persistent build capability (-P). I put a small patch to fix this issue.

OMake をこのところの Ubuntu で、ソースからビルドしようとした場合、 ld の挙動が変わったので libfam-dev が入れてあっても libfam を見つけることが出来ません。結果 OMake の魅力である -P が使えなくなります。

これを修正する OMake のパッチはこれね:

diff -r 005aed715cff -r efa03dc6f70d omake/omake.0.9.8.6-0.rc1/lib/configure/Configure.om
--- a/omake/omake.0.9.8.6-0.rc1/lib/configure/Configure.om	Tue Oct 02 15:05:29 2012 +0800
+++ b/omake/omake.0.9.8.6-0.rc1/lib/configure/Configure.om	Tue Oct 02 15:05:53 2012 +0800
@@ -266,7 +266,7 @@
 # \end{doc}
 #
 public.CheckCLib(libs, funs) =
-    CFLAGS += $(addprefix -l, $(libs))
+    LDFLAGS += $(addprefix -l, $(libs))
 
     return $(TryLinkC $"""
 #ifdef __cplusplus

実はこの ld の変化は OMake のビルドだけでなく OMake を使ったライブラリ存在チェックにも影響します。私は camlimages で気づいたのですが、 OMake の CheckCLib という関数での -l 呼び出しの位置がビミョーで Ubuntu の ld に渡っても利いてないことがあります。