Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active October 13, 2015 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjunichi/72309fbc21bf0390ef93 to your computer and use it in GitHub Desktop.
Save kjunichi/72309fbc21bf0390ef93 to your computer and use it in GitHub Desktop.

Cygwinでh2oが動いた日

なぜcygwin

Windows環境でもHTTP2関連をいじるにはnghttp2のツールも動かせた方がよいだろう。

ということで、cygwin環境一択で作業を進めた

最大の難関

mruby-onig-regexpのビルド

mruby-onig-regexpが無条件でOSがWindowsだとMSVCを選択してしまう。 さらにOnigumoもcygwin環境でもLib.exeをarの代わりに使用する。しかもLib.exeのオプションが 誤っている。

Onigumoではlibonig.libが作られるが、mruby-onig-regexpではlibonig.aを期待している。

対応方法

  • /usr/include/sysに/usr/include/endian.hのシンボリックリンクを作成
  • mruby-onig-regexpのmrbgem.rakeファイルの修正
  • OSがWindowsだと無条件にVC++なので、これを無効化
  • 作成されたlibonig.libをコピーしてlibonig.aを作成
  • libtool.m4の修正
  • lib.exeではなく、cygwinのarを使うように修正

これらの具体的な対応内容はhttps://gist.github.com/kjunichi/81d876fe0c7307ba3978参照。

まとめ

  • h2o本体はcygwinでフツーにビルド出来た
  • libuvはcygwinをサポートしていないスレッド周りで問題があるらしい。(joyent/libuv#845)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment