This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Only use proxy constant subroutines for 5.9.x.
[perl5.git] / ext / Socket / Makefile.PL
CommitLineData
42793c05 1use ExtUtils::MakeMaker;
1cb0fb50 2use ExtUtils::Constant 0.11 'WriteConstants';
d6a66728 3use Config;
4ad3186e 4WriteMakefile(
d6a66728 5 NAME => 'Socket',
c07a80fd 6 VERSION_FROM => 'Socket.pm',
d6a66728
JH
7 ($Config{libs} =~ /(-lsocks\S*)/ ? (LIBS => [ "$1" ] ) : ()),
8 MAN3PODS => {}, # Pods will be built by installman.
9 XSPROTOARG => '-noprototypes', # XXX remove later?
ece2ffd9 10 realclean => {FILES=> 'const-c.inc const-xs.inc'},
4ad3186e 11);
7198d2fd
JH
12my @names = (qw(AF_802 AF_AAL AF_APPLETALK AF_CCITT AF_CHAOS AF_CTF
13 AF_DATAKIT AF_DECnet AF_DLI AF_ECMA AF_GOSIP AF_HYLINK
14 AF_IMPLINK AF_INET AF_INET6 AF_ISO AF_KEY
15 AF_LAST AF_LAT AF_LINK AF_MAX AF_NBS AF_NIT AF_NS
16 AF_OSI AF_OSINET AF_PUP AF_ROUTE AF_SNA
17 AF_UNIX AF_UNSPEC AF_USER AF_WAN AF_X25
29f89f33 18 IOV_MAX
7198d2fd
JH
19 MSG_BCAST MSG_BTAG MSG_CTLFLAGS MSG_CTLIGNORE MSG_DONTWAIT
20 MSG_EOF MSG_EOR MSG_ERRQUEUE MSG_ETAG MSG_FIN
21 MSG_MAXIOVLEN MSG_MCAST MSG_NOSIGNAL MSG_RST MSG_SYN
22 MSG_TRUNC MSG_URG MSG_WAITALL MSG_WIRE
23 PF_802 PF_AAL PF_APPLETALK PF_CCITT PF_CHAOS PF_CTF
24 PF_DATAKIT PF_DECnet PF_DLI PF_ECMA PF_GOSIP PF_HYLINK
25 PF_IMPLINK PF_INET PF_INET6 PF_ISO PF_KEY
26 PF_LAST PF_LAT PF_LINK PF_MAX PF_NBS PF_NIT PF_NS
27 PF_OSI PF_OSINET PF_PUP PF_ROUTE PF_SNA
28 PF_UNIX PF_UNSPEC PF_USER PF_WAN PF_X25
29 SCM_CONNECT SCM_CREDENTIALS SCM_CREDS SCM_TIMESTAMP
30 SOCK_DGRAM SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM
31 SOL_SOCKET SOMAXCONN
32 SO_ACCEPTCONN SO_ATTACH_FILTER SO_BACKLOG SO_BROADCAST
33 SO_CHAMELEON SO_DEBUG SO_DETACH_FILTER SO_DGRAM_ERRIND
34 SO_DONTLINGER SO_DONTROUTE SO_ERROR SO_FAMILY
35 SO_KEEPALIVE SO_LINGER SO_OOBINLINE
36 SO_PASSCRED SO_PASSIFNAME SO_PEERCRED
37 SO_PROTOCOL SO_PROTOTYPE
38 SO_RCVBUF SO_RCVLOWAT SO_RCVTIMEO
39 SO_REUSEADDR SO_REUSEPORT
40 SO_SECURITY_AUTHENTICATION
41 SO_SECURITY_ENCRYPTION_NETWORK
42 SO_SECURITY_ENCRYPTION_TRANSPORT
43 SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO
44 SO_STATE SO_TYPE SO_USELOOPBACK SO_XOPEN SO_XSE
45 TCP_KEEPALIVE TCP_MAXRT TCP_MAXSEG TCP_NODELAY TCP_STDURG
46 UIO_MAXIOV
47 ),
29f89f33
GA
48 {name=>"IPPROTO_ICMP", type=>"IV", default=>["IV", 1]},
49 {name=>"IPPROTO_TCP", type=>"IV", default=>["IV", 6]},
50 {name=>"IPPROTO_UDP", type=>"IV", default=>["IV", 17]},
0552bf3a
NC
51 {name=>"SHUT_RD", type=>"IV", default=>["IV", "0"]},
52 {name=>"SHUT_WR", type=>"IV", default=>["IV", "1"]},
53 {name=>"SHUT_RDWR", type=>"IV", default=>["IV", "2"]},
54);
55
56push @names,
57 {name=>$_, type=>"IV",
58 macro=>["#if defined($_) || defined(HAS_$_) /* might be an enum */\n",
59 "#endif\n"]}
60foreach qw (MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS);
61
62push @names,
63{name => $_, type => "SV",
64 pre=>"struct in_addr ip_address; ip_address.s_addr = htonl($_);",
65 value => "sv_2mortal(newSVpvn((char *)&ip_address,sizeof ip_address ))",}
66 foreach qw(INADDR_ANY INADDR_LOOPBACK INADDR_NONE INADDR_BROADCAST);
67
68WriteConstants(
8ad94821 69 ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
0552bf3a
NC
70 NAME => 'Socket',
71 NAMES => \@names,
72);