#!/bin/sh
# 1) install mingw64
# 2) install gsl in ../w64 (with -O3)
# 3) install libirt in ../win32 (with -DHAVE_INLINE -DGSL_RANGE_CHECK_OFF -O3)
# 4) get the file irt_wrapper.c from the R package rirt
# 5) compile with EXCEL_STDCALL and wrap in a dll
i686-w64-mingw32-gcc -c -DHAVE_INLINE -DGSL_RANGE_CHECK_OFF -O3 -DEXCEL_STDCALL -Wl,--enable-stdcall-fixup \
    -L/home/germains/local/cross/win32/lib -I/home/germains/local/cross/win32/include irt_wrapper.c 
i686-w64-mingw32-dllwrap --def export.def -Wl,--enable-stdcall-fixup -o eirt.dll irt_wrapper.o \
    -lirt -lgsl -lgslcblas -L/home/germains/local/cross/win32/lib
