Permalink
Browse files

Updated Makefile.PL to use $Config{cc} to decided if XS modules shoul…

…d be built or not
  • Loading branch information...
1 parent bd8478e commit b57685a82b0bc92e4dbe48e083ba1c24f3bb3c96 @abw committed Feb 10, 2012
Showing with 20 additions and 15 deletions.
  1. +20 −15 Makefile.PL
View
@@ -6,8 +6,8 @@ use 5.006;
use ExtUtils::MakeMaker;
use Config;
-our $MAKE = $Config{'make'};
-our $TT_XS = 1;
+our $MAKE = $Config{ make };
+our $TT_XS = $Config{ cc };
our (%config, %ttconfig);
# read command line args putting TT_* into $ttconfig and
@@ -16,8 +16,10 @@ our (%config, %ttconfig);
while (@ARGV) {
my $arg = shift @ARGV;
- print "[$arg]\n";
- if ($arg =~ /^-*no_?xs$/i) {
+ if ($arg =~ /^-*use_?xs$/i) {
+ $TT_XS = 1;
+ }
+ elsif ($arg =~ /^-*no_?xs$/i) {
$TT_XS = 0;
}
else {
@@ -26,20 +28,23 @@ while (@ARGV) {
}
};
-if ($TT_XS) {
-print <<EOF;
-The XS module(s) will be included in the build.
-Use the --no_xs option to disable them.
-e.g. perl Makefile.PL --no_xs
-EOF
-}
-else {
-print <<EOF;
-The XS module(s) will not be included in the build.
+{
+ my $to_be = $TT_XS ? 'be' : 'not be';
+ my $option = $to_be ? '--no_xs' : '--use_xs';
+ my $action = $to_be ? 'disable' : 'enable';
+ print <<"EOF";
+Template Toolkit XS Modules
+---------------------------
+
+The XS module(s) will $to_be included in the build.
+Use the $option option to explicitly $action them.
+
+e.g.
+ perl Makefile.PL $option
+
EOF
}
-
my %opts = (
'NAME' => 'Template-TT2',
'VERSION_FROM' => 'lib/Template/TT2.pm',

0 comments on commit b57685a

Please sign in to comment.