$VERSION "a5" doesn't quite work.
[p5sagit/p5-mst-13.2.git] / ext / Socket / Makefile.PL
CommitLineData
42793c05 1use ExtUtils::MakeMaker;
0552bf3a 2use ExtUtils::Constant 0.07 'WriteConstants';
d6a66728 3use Config;
4ad3186e 4WriteMakefile(
d6a66728 5 NAME => 'Socket',
c07a80fd 6 VERSION_FROM => 'Socket.pm',
d6a66728 7 ($Config{libs} =~ /(-lsocks\S*)/ ? (LIBS => [ "$1" ] ) : ()),
8 MAN3PODS => {}, # Pods will be built by installman.
9 XSPROTOARG => '-noprototypes', # XXX remove later?
21071c79 10 realclean => {FILES=> 'constants.c constants.xs'},
4ad3186e 11);
0552bf3a 12my @names = (qw(AF_802 AF_APPLETALK AF_CCITT AF_CHAOS AF_DATAKIT AF_DECnet
13 AF_DLI AF_ECMA AF_GOSIP AF_HYLINK AF_IMPLINK AF_INET AF_LAT
14 AF_MAX AF_NBS AF_NIT AF_NS AF_OSI AF_OSINET AF_PUP AF_SNA
15 AF_UNIX AF_UNSPEC AF_X25 IOV_MAX IPPROTO_TCP MSG_BCAST
16 MSG_CTLFLAGS MSG_CTLIGNORE MSG_DONTWAIT MSG_EOF MSG_EOR
17 MSG_ERRQUEUE MSG_FIN MSG_MAXIOVLEN MSG_MCAST MSG_NOSIGNAL
18 MSG_RST MSG_SYN MSG_TRUNC MSG_WAITALL PF_802 PF_APPLETALK
19 PF_CCITT PF_CHAOS PF_DATAKIT PF_DECnet PF_DLI PF_ECMA PF_GOSIP
20 PF_HYLINK PF_IMPLINK PF_INET PF_LAT PF_MAX PF_NBS PF_NIT PF_NS
21 PF_OSI PF_OSINET PF_PUP PF_SNA PF_UNIX PF_UNSPEC PF_X25
22 SCM_CONNECT SCM_CREDENTIALS SCM_CREDS SCM_TIMESTAMP SOCK_DGRAM
23 SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM SOL_SOCKET
24 SOMAXCONN SO_ACCEPTCONN SO_BROADCAST SO_DEBUG SO_DONTLINGER
25 SO_DONTROUTE SO_ERROR SO_KEEPALIVE SO_LINGER SO_OOBINLINE
26 SO_RCVBUF SO_RCVLOWAT SO_RCVTIMEO SO_REUSEADDR SO_REUSEPORT
27 SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO SO_TYPE SO_USELOOPBACK
28 TCP_KEEPALIVE TCP_MAXRT TCP_MAXSEG TCP_NODELAY TCP_STDURG
29 UIO_MAXIOV MSG_URG),
30 {name=>"SHUT_RD", type=>"IV", default=>["IV", "0"]},
31 {name=>"SHUT_WR", type=>"IV", default=>["IV", "1"]},
32 {name=>"SHUT_RDWR", type=>"IV", default=>["IV", "2"]},
33);
34
35push @names,
36 {name=>$_, type=>"IV",
37 macro=>["#if defined($_) || defined(HAS_$_) /* might be an enum */\n",
38 "#endif\n"]}
39foreach qw (MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS);
40
41push @names,
42{name => $_, type => "SV",
43 pre=>"struct in_addr ip_address; ip_address.s_addr = htonl($_);",
44 value => "sv_2mortal(newSVpvn((char *)&ip_address,sizeof ip_address ))",}
45 foreach qw(INADDR_ANY INADDR_LOOPBACK INADDR_NONE INADDR_BROADCAST);
46
47WriteConstants(
48 NAME => 'Socket',
49 NAMES => \@names,
50);