This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Prepare Socket.pm for dual-life
[perl5.git] / cpan / Socket / Makefile.PL
CommitLineData
42793c05 1use ExtUtils::MakeMaker;
735631af 2use ExtUtils::Constant 0.23 'WriteConstants';
d6a66728 3use Config;
4ad3186e 4WriteMakefile(
d6a66728 5 NAME => 'Socket',
c07a80fd 6 VERSION_FROM => 'Socket.pm',
d6a66728 7 ($Config{libs} =~ /(-lsocks\S*)/ ? (LIBS => [ "$1" ] ) : ()),
d6a66728 8 XSPROTOARG => '-noprototypes', # XXX remove later?
ece2ffd9 9 realclean => {FILES=> 'const-c.inc const-xs.inc'},
4ad3186e 10);
7198d2fd
JH
11my @names = (qw(AF_802 AF_AAL AF_APPLETALK AF_CCITT AF_CHAOS AF_CTF
12 AF_DATAKIT AF_DECnet AF_DLI AF_ECMA AF_GOSIP AF_HYLINK
13 AF_IMPLINK AF_INET AF_INET6 AF_ISO AF_KEY
14 AF_LAST AF_LAT AF_LINK AF_MAX AF_NBS AF_NIT AF_NS
15 AF_OSI AF_OSINET AF_PUP AF_ROUTE AF_SNA
16 AF_UNIX AF_UNSPEC AF_USER AF_WAN AF_X25
eccda089
PLE
17 AI_CANONNAME AI_NUMERICHOST AI_NUMERICSERV AI_PASSIVE
18 EAI_ADDRFAMILY EAI_AGAIN EAI_BADFLAGS EAI_FAIL EAI_FAMILY
19 EAI_NODATA EAI_NONAME EAI_SERVICE EAI_SOCKTYPE
131c565a
SP
20 IOV_MAX IP_OPTIONS IP_HDRINCL IP_TOS IP_TTL IP_RECVOPTS
21 IP_RECVRETOPTS IP_RETOPTS
4f5bb87f
PLE
22 IPV6_ADD_MEMBERSHIP IPV6_DROP_MEMBERSHIP IPV6_MTU
23 IPV6_MTU_DISCOVER IPV6_MULTICAST_HOPS IPV6_MULTICAST_IF
24 IPV6_MULTICAST_LOOP IPV6_UNICAST_HOPS IPV6_V6ONLY
7198d2fd
JH
25 MSG_BCAST MSG_BTAG MSG_CTLFLAGS MSG_CTLIGNORE MSG_DONTWAIT
26 MSG_EOF MSG_EOR MSG_ERRQUEUE MSG_ETAG MSG_FIN
27 MSG_MAXIOVLEN MSG_MCAST MSG_NOSIGNAL MSG_RST MSG_SYN
28 MSG_TRUNC MSG_URG MSG_WAITALL MSG_WIRE
eccda089 29 NI_DGRAM NI_NAMEREQD NI_NUMERICHOST NI_NUMERICSERV
7198d2fd
JH
30 PF_802 PF_AAL PF_APPLETALK PF_CCITT PF_CHAOS PF_CTF
31 PF_DATAKIT PF_DECnet PF_DLI PF_ECMA PF_GOSIP PF_HYLINK
32 PF_IMPLINK PF_INET PF_INET6 PF_ISO PF_KEY
33 PF_LAST PF_LAT PF_LINK PF_MAX PF_NBS PF_NIT PF_NS
34 PF_OSI PF_OSINET PF_PUP PF_ROUTE PF_SNA
35 PF_UNIX PF_UNSPEC PF_USER PF_WAN PF_X25
36 SCM_CONNECT SCM_CREDENTIALS SCM_CREDS SCM_TIMESTAMP
37 SOCK_DGRAM SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM
38 SOL_SOCKET SOMAXCONN
39 SO_ACCEPTCONN SO_ATTACH_FILTER SO_BACKLOG SO_BROADCAST
40 SO_CHAMELEON SO_DEBUG SO_DETACH_FILTER SO_DGRAM_ERRIND
41 SO_DONTLINGER SO_DONTROUTE SO_ERROR SO_FAMILY
42 SO_KEEPALIVE SO_LINGER SO_OOBINLINE
43 SO_PASSCRED SO_PASSIFNAME SO_PEERCRED
44 SO_PROTOCOL SO_PROTOTYPE
45 SO_RCVBUF SO_RCVLOWAT SO_RCVTIMEO
46 SO_REUSEADDR SO_REUSEPORT
47 SO_SECURITY_AUTHENTICATION
48 SO_SECURITY_ENCRYPTION_NETWORK
49 SO_SECURITY_ENCRYPTION_TRANSPORT
50 SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO
51 SO_STATE SO_TYPE SO_USELOOPBACK SO_XOPEN SO_XSE
52 TCP_KEEPALIVE TCP_MAXRT TCP_MAXSEG TCP_NODELAY TCP_STDURG
f686127b
SF
53 TCP_CORK TCP_KEEPIDLE TCP_KEEPINTVL TCP_KEEPCNT
54 TCP_SYNCNT TCP_LINGER2 TCP_DEFER_ACCEPT TCP_WINDOW_CLAMP
55 TCP_INFO TCP_QUICKACK TCP_CONGESTION TCP_MD5SIG
7198d2fd
JH
56 UIO_MAXIOV
57 ),
131c565a
SP
58 {name=>"IPPROTO_IP", type=>"IV", default=>["IV", 0]},
59 {name=>"IPPROTO_IPV6", type=>"IV", default=>["IV", 41]},
60 {name=>"IPPROTO_RAW", type=>"IV", default=>["IV", 255]},
29f89f33
GA
61 {name=>"IPPROTO_ICMP", type=>"IV", default=>["IV", 1]},
62 {name=>"IPPROTO_TCP", type=>"IV", default=>["IV", 6]},
63 {name=>"IPPROTO_UDP", type=>"IV", default=>["IV", 17]},
0552bf3a
NC
64 {name=>"SHUT_RD", type=>"IV", default=>["IV", "0"]},
65 {name=>"SHUT_WR", type=>"IV", default=>["IV", "1"]},
66 {name=>"SHUT_RDWR", type=>"IV", default=>["IV", "2"]},
67);
68
69push @names,
70 {name=>$_, type=>"IV",
71 macro=>["#if defined($_) || defined(HAS_$_) /* might be an enum */\n",
72 "#endif\n"]}
73foreach qw (MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS);
74
44559db1 75push @names,
0552bf3a
NC
76{name => $_, type => "SV",
77 pre=>"struct in_addr ip_address; ip_address.s_addr = htonl($_);",
d3d34884 78 value => "newSVpvn_flags((char *)&ip_address,sizeof(ip_address), SVs_TEMP)",}
0552bf3a
NC
79 foreach qw(INADDR_ANY INADDR_LOOPBACK INADDR_NONE INADDR_BROADCAST);
80
6b0aeb77
PLE
81push @names,
82{name => $_, type => "SV",
83 macro=>["#ifdef ${_}_INIT\n",
84 "#endif\n"],
85 pre=>"struct in6_addr ip6_address = ${_}_INIT;",
86 value => "newSVpvn_flags((char *)&ip6_address,sizeof(ip6_address), SVs_TEMP)",}
87 foreach qw(IN6ADDR_ANY IN6ADDR_LOOPBACK);
88
0552bf3a 89WriteConstants(
7f39e0ae 90 PROXYSUBS => {autoload => 1},
0552bf3a
NC
91 NAME => 'Socket',
92 NAMES => \@names,
93);