use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

WriteMakefile(
    'NAME'         => 'Win32::GUI::DIBitmap',
    'VERSION_FROM' => 'DIBitmap.pm', # finds $VERSION
    'XS'           => { 'DIBitmap.xs' => 'DIBitmap.cpp' },
    'LIBS'      => ['Msvcprt.lib'],   # e.g., '-lm'
    'DEFINE'    => '',     # e.g., '-DHAVE_SOMETHING'
    'INC'       => '',     # e.g., '-I/usr/include/other'
    'MYEXTLIB' => 'extlib/FreeImage.lib',
);

#
# Build FreeImage.lib
#

sub MY::postamble {
'
extlib/FreeImage.lib:
       cd extlib
       $(MAKE) all
       $(MAKE) clean_build
       cd ..

';
}

sub MY::xs_c {
    '
xs.cpp:
    $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && $(MV) xstmp.c $*.cpp
';
}

