やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

gtkmm3のコンパイルができたっぽい

前回、makeの実行まではできたもののコンパイルには失敗した。 今回は吐き出されたファイル一式を解析して原因をさぐる。

shを追ってみた

テキストエディタで以下のようにファイルを見てみた。

  1. C:\MinGW\msys\1.0\home配下の00_all.shファイルを見る。
  2. 01_libsigc++.shファイルを見る。
  3. C:\MinGW\msys\1.0\home\libsigc++-2.2.11configureファイルを見る。2万行近いshだった。
  4. 見てられないのでconfig.logを見る。
  5. 最後の行がconfigure: exit 1だった。異常終了ってこと?
  6. 何のエラーかわからない。それっぽいログがないか探したが見つからず。

01_libsigc++.shファイルでは、以下の通りログがでるはず。

./configure -h 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-help.log
./configure ${CFGPARMS} 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-config.log
#make clean
make 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-make.log
make install 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-install.log

よくよく見てみると、前回の手順 9) で log ディレクトリを作成していたが、logsだったっぽい。 だからlogファイルができなかったのか。

http://www.giuspen.com/2014/02/build-gtkmm-3-6-0-windows-binaries-on-official-gtk-3-6-4-bundle/

4回目

ディレクトリ名をlogからlogsに変更して、もう一度やる。

00_all.shを実行する。前回にひきつづき、これで4回目…。

  1. C:\MinGW\msys\1.0\msys.batを実行
  2. cd C:/MinGW/msys/1.0/homeコマンドを打つ
  3. sh 00_all.shコマンドを打つ

logs

logsディレクトリ配下にログができていた。

01_libsigc++-config.log

checking for gm4... no
checking for m4... no
configure: error: in `/usr/home/libsigc++-2.2.11':
configure: error: The GNU M4 macro processor is required for building libsigc++.
See `config.log' for more details

下の5行。どうやらM4というマクロプロセッサ?が必要らしい。

M4の入手

choco install M4

chocorateyでインストールを試みるも失敗。

>choco install M4
Chocolatey v0.10.0
Installing the following packages:
M4
By installing you accept licenses for the packages.
M4 not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
 Version: ""
 Source(s): "https://chocolatey.org/api/v2/"

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\Documents and Settings\All Users\Application Data\c
hocolatey\logs\chocolatey.log).

Failures
 - M4 - M4 not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
 Version: ""
 Source(s): "https://chocolatey.org/api/v2/"

Wikipedia

M4は汎用テキストマクロプロセッサ。

GNU

M4

FTPサーバで配布されているが、拡張子から察するにUnix環境用。 Windowsバイナリがほしい。

google

  1. "m4 windows binary"で検索する
  2. こちらのサイトを見つける
  3. Binariesからm4-1.4.14-1-bin.zipファイルがダウンロードされる
  4. 解凍するとm4-1.4.14-1-binディレクトリができる
  5. binディレクトリ内にm4.exeがある
  6. 起動してみる
  7. 以下のエラーが出た 「regex2.dllが見つからなかったため、このアプリケーションを開始できませんでした。アプリケーションをインストールしなおすとこの問題は解決される場合があります。」

regex2.dll

  1. "regex2.dll download"でググる
  2. こちらのサイトを見つける
  3. Binariesからregex-2.7-bin.zipファイルがダウンロードされる
  4. 解凍するとregex-2.7-binディレクトリができる
  5. binディレクトリ内にregex2.dllがある

エラー除去できた

とりあえずm4.exeとおなじディレクトリに配置して起動してみると、エラーは出なくなっていた。

あとはこのままどこかに配置して環境変数のPathに通してやれば、00_all.shの「checking for m4... no」が「checking for m4... yes」になるかもしれない。

配置して環境変数のパスを通す

  1. C:/MinGW/msys/1.0/home配下にm4-1.4.14-1-binディレクトリを配置する
  2. C:/MinGW/msys/1.0/home/m4-1.4.14-1-bin/bin環境変数のPathに追加する

もしくは00_all.shが「checking whether make sets $(MAKE)...」で止まったときのように、環境変数の名前を"M4"にする必要があるかもしれない。

エラーメッセージは以下の通りで、$(M4)とは書いていない。

checking for gm4... no
checking for m4... no
configure: error: in `/usr/home/libsigc++-2.2.11':
configure: error: The GNU M4 macro processor is required for building libsigc++.
See `config.log' for more details

なので、とりあえず環境変数"Path"に追記しておく。

5回目

  1. C:\MinGW\msys\1.0\msys.batを実行
  2. cd C:/MinGW/msys/1.0/homeコマンドを打つ
  3. sh 00_all.shコマンドを打つ

コンソール

コンソールを見ていると、以下を発見。

checking for gm4... no
checking for m4... m4
checking for perl... perl
checking for dot... dot
checking for doxygen... doxygen
checking for xsltproc... xsltproc

前回は以下だった。

checking for gm4... no
checking for m4... no

たぶん"no"となっているのが、存在しないものなのだろう。

ためしにテキトーなタイミングでコンソールをコピペして"checking ... no"っぽいのを探してみたら、以下のようなものが見つかった。

checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... no
checking for gm4... no

これらが何なのかさっぱりわからない。本当にWindowsXPコンパイルできるの?

01_libsigc++-config.log

すこし時間を待って、C:\MinGW\msys\1.0\home\logsにある01_libsigc++-config.logをみてみる。

たぶん01_libsigc++-config.logが最初に終わる。

テキストエディタで見てみる。

前回は以下のようにエラーで終わっていた。

checking for gm4... no
checking for m4... no
configure: error: in `/usr/home/libsigc++-2.2.11':
configure: error: The GNU M4 macro processor is required for building libsigc++.
See `config.log' for more details

今回は以下のように続いている。

checking for gm4... no
checking for m4... m4
checking for perl... perl
checking for dot... dot
checking for doxygen... doxygen
checking for xsltproc... xsltproc
configure: WARNING: Perl is required for installing the documentation.
checking for pkg-config... /c/gtkmm/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking if C++ compiler supports the use of a particular specialization when calling operator() template methods.... yes
checking if C++ compiler supports the use of a particular specialization when calling operator() template methods omitting the template keyword.... yes
checking if C++ compiler allows usage of member function in initialization of static member field.... yes
checking whether C++ library symbols are declared in namespace std... yes
checking for non-standard Sun libCstd reverse_iterator... no
checking which C++ compiler warning flags to use... -Wall
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sigc++-2.0.pc
config.status: creating sigc++-2.0-uninstalled.pc
config.status: creating sigc++/Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating docs/Makefile
config.status: creating docs/reference/Doxyfile
config.status: creating MSVC_Net2005/sigc.rc
config.status: creating MSVC_Net2008/sigc.rc
config.status: creating MSVC_Net2010/sigc.rc
config.status: creating config.h
config.status: creating sigc++config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing MSVC_Net2005/sigc++config.h commands
config.status: executing MSVC_Net2008/sigc++config.h commands
config.status: executing MSVC_Net2010/sigc++config.h commands

"error"の文字はない。成功したのか? C:\MinGW\msys\1.0\gtkmm3\binをみてみると、libsigc-2.0-0.dllができていた。 え、成功なの?成功したっぽい。

他のライブラリも順次作成中っぽい。

次回

成功なら、次はこれをどうやって使うか。 MinGWにてgtkmm3のHelloWorldをコンパイルしたい。

その前に、MinGWでどうやってコンパイルするのか。 多分makeファイルを書かねばならない。 gccやg++コマンドを使うのだろうが、引数などもわからない。

次回はMinGWでHelloWorldか。