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