/usr/include/lcms.h:1370: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’

tksmashiw2008-09-12

前回の続き。
依存関係が解決出来たのでさっそく開発版GIMPのビルドに取りかかった。


$ []./configure --enable-debug --enable-profile --enable-ansi --prefix=/opt[]
[]...省略...[]
$ []make[]
[]...省略...[]
[]In file included from jpeg-load.c:35:[]
[]/usr/include/lcms.h:1370: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’[]
[]/usr/include/lcms.h:1396: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘WORD’[]
[]/usr/include/lcms.h:1407: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’[]
[]/usr/include/lcms.h:1416: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’[]
[]/usr/include/lcms.h:1467: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Fixed32’[]
[]/usr/include/lcms.h:1468: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’[]
[]In file included from ../../libgimpbase/gimpbase.h:27,[]
[] from ../../libgimp/gimp.h:27,[]
[] from jpeg-load.c:38:[]
[]../../libgimpbase/gimpcpuaccel.h:31: 警告: ISO C restricts enumerator values to range of ‘int’[]
[]make[3]: *** [jpeg-load.o] エラー 1[]
[]make[3]: ディレクトリ `/home/tks/gimp/gimp-2.5.3/plug-ins/file-jpeg' から出ます[]
[]make[2]: *** [all-recursive] エラー 1[]
[]make[2]: ディレクトリ `/home/tks/gimp/gimp-2.5.3/plug-ins' から出ます[]
[]make[1]: *** [all-recursive] エラー 1[]
[]make[1]: ディレクトリ `/home/tks/gimp/gimp-2.5.3' から出ます[]
[]make: *** [all] エラー 2[]
エラーが出たlcms.hを調べてみると、どうも「inline」が解釈されていないらしい。

$ []lv /usr/include/lcms.h[]

//1370行目
LCMS_INLINE int _cmsQuickFloor(double val)
//1396行目
LCMS_INLINE WORD _cmsClampWord(int in)
//1407行目
LCMS_INLINE void* _cmsMalloc(size_t size)
// 224行目
#define LCMS_INLINE static inline

ここで閃いてgccのマニュアルを「inline」で検索してみた。

       -ansi  全ての ANSI 標準の C プログラムをサポートします。

              こ のオプションは、GNU C が持つ ANSI C との非互換な機能を
              全て排除します。例えば、asm, inline, typeof などのキー ワ
              ー ドや、unix や vax などの現在使用しているシステムを規定
              する定義済みマクロなどが抑制されます。さらに、好ましく な
              く かつほとんど使用されない ANSI のトライグラフの機能を使
              用可能とし、さらに ‘$’ を識別子の一部として使用できないよ
              うにします。

specの記述を元につけた「-ansi」をはずせばビルドできそうだ。


$ []./configure --enable-debug --enable-profile --prefix=/opt[]
[]...省略...[]
$ []make[]
[]...省略...[]
$ []sudo paco -lD 'make install'[] []pacoでログをとりつつインストール[]
[]...省略...[]
ようやく開発版GIMPをインストールできた。
開発版GIMPを起動するには、環境変数PATHとLD_LIBRARY_PATHを/opt以下の物に変更する必要がある。
毎回指定するのは面倒なので以下のようなシェルスクリプトを書いて「~/bin/gimp-2.5」に実行可能属性をつけて保存しておく。

#!/bin/sh
PATH=/opt/bin LD_LIBRARY_PATH=/opt/lib /opt/bin/gimp-2.5 $@