use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-WriteMakefile(
- 'NAME' => 'Devel::Size',
- 'VERSION_FROM' => 'Size.pm', # finds $VERSION
- 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
- 'LIBS' => [''], # e.g., '-lm'
- 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'INC' => '', # e.g., '-I/usr/include/other'
+use Config;
+
+my %options = (
+ NAME => 'Devel::Size',
+ LIBS => $Config{cc} eq 'gcc' || $Config{cc} eq 'cc' ? ['-lstdc++'] : '',
+ VERSION_FROM => 'lib/Devel/Size.pm',
+ CC => $Config{cc} eq 'cl' ? 'cl' : 'g++',
);
+
+WriteMakefile(%options);