Humanity

Edit the world by your favorite way

Strawberry PerlにOpenGLモジュールをインストール


できた。なんかできた。
以下メモ(変なテンションのまま)

環境

Strawberry PerlとMSYSが必要。


Strawberry Perl

C:\strawberry

にインストールしてあるとして


Strawberry Perlのバージョン

C:\>perl -v

This is perl, v5.10.0 built for MSWin32-x86-multi-thread

Copyright 1987-2007, Larry Wall

.....


MSYSのperlのバージョンも(多分関係ないけど)v5.10.0だった。



手順

  • 環境変数「PERL5LIB」に「C:\strawberry\c\lib」を追加。
  • C:\> cpan
  • cpan> look OpenGL
  • MSYSを立ち上げてDOSプロンプトのほうのカレントディレクトリに移動(C:\strawberry\cpan\build\OpenGL-***とかいうフォルダ)
  • $ perl Makefile.PL # MSYSからでないとcl.exeでコンパイルしようとするので
  • C:\strawberry\cpan\build\OpenGL-***> dmake # DOSプロンプトから
  • C:\strawberry\cpan\build\OpenGL-***> dmake test # なんか現れる
  • C:\strawberry\cpan\build\OpenGL-***> dmake install

で終了。
Strawberry Perlすげー
(ついこの前もここを参考にしてWxっていうGUI用モジュール(?)をインストールできたし
PerlやるためにLinuxでやる必要なくね?っていういきおい)

それからC:\strawberry\c\libにがんがんライブラリをMSYSでコンパイルしてインストールすれば
なんでも入れられるんじゃないかとか思った。

そのた

一応dmakeした時の出力を貼ってみる

C:\strawberry\cpan\build\OpenGL-***>dmake
Skip blib\lib/OpenGL.pm (unchanged)
cp Config.pm blib\lib/OpenGL/Config.pm
Skip blib\lib/OpenGL.pod (unchanged)
gcc -c          -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_
IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2    -DVERSION=\"0.
57\"    -DXS_VERSION=\"0.57\"  "-IC:\strawberry\perl\lib\CORE"  -DHAVE_VER -DHAV
E_FREEGLUT -DHAVE_FREEGLUT32 -DHAVE_GL -DHAVE_GLU -DHAVE_GLU32 -DHAVE_GLUT -DHAV
E_GLUT32 -DHAVE_OPENGL32 OpenGL.c
gcc -c          -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_
IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2    -DVERSION=\"0.
57\"    -DXS_VERSION=\"0.57\"  "-IC:\strawberry\perl\lib\CORE"  -DHAVE_VER -DHAV
E_FREEGLUT -DHAVE_FREEGLUT32 -DHAVE_GL -DHAVE_GLU -DHAVE_GLU32 -DHAVE_GLUT -DHAV
E_GLUT32 -DHAVE_OPENGL32 gl_util.c
Running Mkbootstrap for OpenGL ()
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod 644 OpenGL.bs
C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"OpenGL\", 'DLBASE' => 'OpenGL', 'DL_FUNCS' => {  }
, 'FUNCLIST' => , 'IMPORTS' => {  }, 'DL_VARS' => );"
dlltool --def OpenGL.def --output-exp dll.exp
g++ -o blib\arch\auto\OpenGL\OpenGL.dll -Wl,--base-file -Wl,dll.base -mdll -s -L
"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" OpenGL.o gl_util.o -lopeng
l32 -lglu32 -LFreeGLUT -lfreeglut -Wl,--image-base,0x83c0000  C:\strawberry\perl
\lib\CORE\libperl510.a -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspoo
l -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32
  • lmpr -lwinmm -lversion -lodbc32 -lodbccp32 dll.exp
dlltool --def OpenGL.def --base-file dll.base --output-exp dll.exp g++ -o blib\arch\auto\OpenGL\OpenGL.dll -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" OpenGL.o gl_util.o -lopengl32 -lglu32 -LFreeGLUT -lfree glut -Wl,--image-base,0x83c0000 C:\strawberry\perl\lib\CORE\libperl510.a -lmsvc rt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshe ll32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodb c32 -lodbccp32 dll.exp C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arch\auto\ OpenGL\OpenGL.dll C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e cp OpenGL.bs blib\arch\au to\OpenGL\OpenGL.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod 644 blib\arch\auto\ OpenGL\OpenGL.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e cp FreeGLUT/freeglut.dll blib\script\freeglut.dll pl2bat.bat blib\script\freeglut.dll C:\strawberry\cpan\build\OpenGL-***>dmake test C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl OpenGL Test App (using hires timer) Using POGL v0.57 OpenGL installation: 2.0.6232 WinXP Release ATI Technologies Inc. Radeon X1550 Series x86/MMX/3DNow!/SSE2

さて

OpenGL勉強するか・・・(ぇ



追記:

PERL5LIBは@INCに入る環境変数か。じゃあ関係ないのかな
http://d.hatena.ne.jp/lapis25/20060605/1149537267

うわ ていうかMSYSの/etc/fstabに

c:/strawberry/perl	/perl

とか書いてあった 自分で追加したっけ?(よく覚えてない
だから上のPerlはどっちも同じもので実行した環境が違うだけだった