+# Module makefile for threads (using ExtUtils::MakeMaker)
+
+require 5.008;
+
+use strict;
+use warnings;
+
use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
+
+
+# Build options for different environments
+my @conditional_params;
+if (grep { $_ eq 'PERL_CORE=1' } @ARGV) {
+ # Core
+ push(@conditional_params, 'MAN3PODS' => {},
+ 'NORECURS' => 1);
+} else {
+ # CPAN
+ push(@conditional_params, 'CCFLAGS' => '-DHAS_PPPORT_H');
+}
+
WriteMakefile(
- 'NAME' => 'threads',
- 'VERSION_FROM' => 'threads.pm', # finds $VERSION
- 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
- ($] >= 5.005 ? ## Add these new keywords supported since 5.005
- (ABSTRACT_FROM => 'threads.pm', # retrieve abstract from module
- AUTHOR => 'Artur Bergman <artur@contiller.se>') : ()),
- 'MAN3PODS' => {}, # Pods will be built by installman
- 'LIBS' => [''], # e.g., '-lm'
- 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- # Insert -I. if you add *.h files later:
-# 'INC' => '', # e.g., '-I/usr/include/other'
- # Un-comment this if you add C files to link with later:
- # 'OBJECT' => '$(O_FILES)', # link all the C files too
+ 'NAME' => 'threads',
+ 'AUTHOR' => 'Artur Bergman <sky AT crucially DOT net>',
+ 'VERSION_FROM' => 'threads.pm',
+ 'ABSTRACT_FROM' => 'threads.pm',
+ 'PM' => {
+ 'threads.pm' => '$(INST_LIBDIR)/threads.pm',
+ },
+ 'PREREQ_PM' => {
+ 'threads::shared' => 0,
+ 'XSLoader' => 0,
+ },
+ 'INSTALLDIRS' => 'perl',
+
+ ((ExtUtils::MakeMaker->VERSION() lt '6.25') ?
+ ('PL_FILES' => { }) : ()),
+ ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
+ ('LICENSE' => 'perl') : ()),
+
+ @conditional_params
);
+
+# Add additional target(s) to Makefile for use by module maintainer
+sub MY::postamble
+{
+ return <<'_EXTRAS_';
+ppport:
+ @( cd /tmp; perl -e 'use Devel::PPPort; Devel::PPPort::WriteFile("ppport.h");' )
+ @if ! cmp -s ppport.h /tmp/ppport.h; then \
+ diff ppport.h /tmp/ppport.h ; \
+ echo; \
+ perl /tmp/ppport.h; \
+ fi
+_EXTRAS_
+}
+
+# EOF