cygwin な gosh + c-wrapper から mingw な SDL を使う

というわけで、sdl-config を使わずにCFLAGSとかLIBSを設定すればうまくいくかもしれないと思ってやってみた。

--- breakout_orig.scm   2009-02-20 15:43:06.406250000 +0900
+++ breakout.scm        2009-02-20 15:41:53.218750000 +0900
@@ -38,8 +38,8 @@
 (use srfi-27)

 (c-load '("SDL.h" "SDL_mixer.h" "stdio.h" "stdlib.h" "sdl_helper.c")
-        :cppflags-cmd "sdl-config --cflags"
-        :libs-cmd "sdl-config --libs; echo '-lSDL_mixer'"
+        :cppflags "-I/usr/include/mingw/SDL"
+        :libs "-L/usr/lib/mingw -lmingw32 -lSDLmain -lSDL -lSDL_mixer"
         :import (list (lambda (header sym)
                         (#/\/SDL\/.*\.h$/ header))
                       'NULL

breakout.scm をこんな感じに直して cwcompile

gauche-package compile --verbose --cflags=  --cppflags= -I/usr/include/mingw/SDL  --ldflags=   --libs= -L/usr/lib/mingw -lmingw32 -lSDLmain -lSDL -lSDL_mixer  sdllib sdllib.stub
'/usr/local/lib/gauche/0.8.14/i686-pc-cygwin/gauche-config' --fixup-extension 'sdllib'
gcc -std=gnu99 -c  -I/usr/include/mingw/SDL  -I/usr/local/lib/gauche/0.8.14/include    -o 'sdllib_head.o' 'sdllib_head.c'
'/usr/local/lib/gauche/0.8.14/i686-pc-cygwin/gosh' genstub sdllib.stub
gcc -std=gnu99 -c  -I/usr/include/mingw/SDL  -I/usr/local/lib/gauche/0.8.14/include    -o 'sdllib.o' 'sdllib.c'
gcc -std=gnu99 -c  -I/usr/include/mingw/SDL  -I/usr/local/lib/gauche/0.8.14/include    -o 'sdllib_tail.o' 'sdllib_tail.c'
gcc -std=gnu99    -L/usr/local/lib/gauche/0.8.14/i686-pc-cygwin  -Wl,--export-all-symbols -Wl,--enable-auto-import -shared -o sdllib.dll 'sdllib_head.o' 'sdllib.o' 'sdllib_tail.o' -lgauche -lm  -lpthread  -L/usr/lib/mingw -lmingw32 -lSDLmain -lSDL -lSDL_mixer
sdllib.o:sdllib.c:(.text+0x1a8): undefined reference to `__imp__Scm_MakeU8VectorFromArrayShared'
collect2: ld returned 1 exit status
*** ERROR: command execution failed: gcc -std=gnu99    -L/usr/local/lib/gauche/0.8.14/i686-pc-cygwin  -Wl,--export-all-symbols -Wl,--enable-auto-import -shared -o sdllib.dll 'sdllib_head.o' 'sdllib.o' 'sdllib_tail.o' -lgauche -lm  -lpthread  -L/usr/lib/mingw -lmingw32 -lSDLmain -lSDL -lSDL_mixer
Stack Trace:
_______________________________________
  0  args

  1  (usage)
        At line 101 of "(input string port)"

_imp__Scm_MakeU8VectorFromArrayShared があればうまくいきそうな。