From 84123f544524d6ffd118b91cd7e053d0a6d8bbe4 Mon Sep 17 00:00:00 2001 From: makamaka Date: Sat, 4 Sep 2010 20:02:46 +0900 Subject: [PATCH] fallback PP configuration with c99 unspport compiler --- perl/Makefile.PL | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/perl/Makefile.PL b/perl/Makefile.PL index b786485..783e658 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -11,19 +11,31 @@ license 'perl'; tests 't/*.t'; recursive_author_tests('xt'); -my $use_xs = want_xs(); -if ( $] >= 5.008005 and $use_xs ) { - can_cc or die "This module requires a C compiler"; - use_ppport 3.19; - requires_c99(); # msgpack C library requires C99. - cc_src_paths('xs-src'); - if ($ENV{DEBUG}) { - cc_append_to_ccflags '-g'; +if ( $] >= 5.008005 and want_xs() ) { + can_cc or die "This module requires a C compiler. Please retry with --pp"; + + my $has_c99 = c99_available(); # msgpack C library requires C99. + + if ( $has_c99 ) { + use_ppport 3.19; + cc_src_paths('xs-src'); + if ($ENV{DEBUG}) { + cc_append_to_ccflags '-g'; + } + } + else { + print <