This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix realclean target for Sys::Syslog
[perl5.git] / ext / Sys / Syslog / Makefile.PL
CommitLineData
8ce86de8 1use ExtUtils::MakeMaker;
8168e71f
SP
2eval 'use ExtUtils::MakeMaker::Coverage';
3require 5.006;
8ce86de8
GS
4
5WriteMakefile(
8168e71f
SP
6 NAME => 'Sys::Syslog',
7 VERSION_FROM => 'Syslog.pm',
8 ABSTRACT_FROM => 'Syslog.pm',
9 INSTALLDIRS => 'perl',
10 MAN3PODS => {}, # Pods will be built by installman.
11 XSPROTOARG => '-noprototypes',
12 PREREQ_PM => {
13 'Test::More' => 0,
14 'XSLoader' => 0,
15 },
16 dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
17 clean => { FILES => 'Sys-Syslog-*' },
3d6051c4 18 realclean => { FILES => 'const-c.inc const-xs.inc macros.all' },
8ce86de8 19);
cf2bd340 20
f66a7beb
JB
21my $_PATH_LOG;
22
23if (-S "/dev/log" && -w "/dev/log") {
8168e71f
SP
24 # Most unixes have a unix domain socket /dev/log.
25 $_PATH_LOG = "/dev/log";
f66a7beb 26} elsif (-c "/dev/conslog" && -w "/dev/conslog") {
8168e71f
SP
27 # SunOS 5.8 has a worldwritable /dev/conslog STREAMS log driver.
28 # The /dev/log STREAMS log driver on this platform has permissions
29 # and ownership `crw-r----- root sys'. /dev/conslog has more liberal
30 # permissions.
31 $_PATH_LOG = "/dev/conslog";
f66a7beb 32} else {
8168e71f 33 $_PATH_LOG = "";
f66a7beb 34}
cf2bd340 35
8168e71f
SP
36if(eval {require ExtUtils::Constant; 1}) {
37 my @names = (qw( LOG_ALERT LOG_AUTH LOG_AUTHPRIV LOG_CONS LOG_CRIT LOG_CRON
38 LOG_DAEMON LOG_DEBUG LOG_EMERG LOG_ERR LOG_FACMASK LOG_FTP
39 LOG_INFO LOG_KERN LOG_LFMT LOG_LOCAL0 LOG_LOCAL1 LOG_LOCAL2
40 LOG_LOCAL3 LOG_LOCAL4 LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 LOG_LPR
41 LOG_MAIL LOG_NDELAY LOG_NEWS LOG_NFACILITIES LOG_NOTICE
42 LOG_NOWAIT LOG_ODELAY LOG_PERROR LOG_PID LOG_PRIMASK LOG_SYSLOG
43 LOG_USER LOG_UUCP LOG_WARNING),
44 { name => "_PATH_LOG", type => "PV", default => [ "PV", qq("$_PATH_LOG") ] },
45 );
46
47 ExtUtils::Constant::WriteConstants(
48 NAME => 'Sys::Syslog',
49 NAMES => \@names,
50 );
51
52 open(MACROS, '>macros.all') or warn "can't write 'macros.all': $!\n";
53 print MACROS join $/, grep {!ref} @names;
54 close(MACROS);
55
56} else {
57 use File::Copy;
58 use File::Spec;
59 foreach my $file ('const-c.inc', 'const-xs.inc') {
60 my $fallback = File::Spec->catfile('fallback', $file);
61 copy ($fallback, $file) or die "Can't copy $fallback to $ $!";
62 }
63}