source: src/Makefile.PL @ 6bb9a6

Revision 6bb9a6, 1.8 KB checked in by Tomash Brechko <tomash.brechko@…>, 3 years ago (diff)

On systems lacking getaddrinfo() implement it with gethostbyname().

Problem report and initial patch are by Yasuhiro Matsumoto.

  • Property mode set to 100644
Line 
1use 5.006;
2use strict;
3use warnings;
4use ExtUtils::MakeMaker;
5
6
7my $includes = '/usr/include';
8my @define;
9my @c = ('parse_keyword.c', 'compute_crc32.c', <*.c>);
10my %exclude;
11if ($^O eq 'MSWin32') {
12    ++$exclude{'socket_posix.c'};
13} else {
14    ++$exclude{'socket_win32.c'};
15    ++$exclude{'addrinfo_hostent.c'};
16
17    if (-f "$includes/poll.h") {
18        push @define, '-DHAVE_POLL_H';
19        ++$exclude{'poll_select.c'};
20    } elsif (-f "$includes/sys/poll.h") {
21        push @define, '-DHAVE_SYS_POLL_H';
22        ++$exclude{'poll_select.c'};
23    }
24}
25
26my @object = grep { not exists $exclude{$_} } @c;
27map { s/\.c$/\$(OBJ_EXT)/ } @object;
28
29
30# See lib/ExtUtils/MakeMaker.pm for details of how to influence
31# the contents of the Makefile that is written.
32WriteMakefile(
33    NAME              => 'Cache::Memcached::Fast::libclient',
34    VERSION_FROM      => '../lib/Cache/Memcached/Fast.pm',
35    AUTHOR            => 'Tomash Brechko <tomash.brechko@gmail.com>',
36    LIBS              => [''], # e.g., '-lm'
37    DEFINE            => "@define", # e.g., '-DHAVE_SOMETHING'
38    INC               => '-I.', # e.g., '-I. -I/usr/include/other'
39    OBJECT            => "@object",
40    # The following line prevents installation of libclient.a.
41    SKIP              => [qw(all static static_lib dynamic dynamic_lib)],
42    clean             => { FILES => 'compute_crc32.c compute_crc32.h'
43                               . ' parse_keyword.c parse_keyword.h' },
44);
45
46sub MY::top_targets {
47'
48all :: static
49
50pure_all :: static
51
52static :: libclient$(LIB_EXT)
53
54libclient$(LIB_EXT): $(OBJECT)
55    $(AR) cr libclient$(LIB_EXT) $(OBJECT)
56    $(RANLIB) libclient$(LIB_EXT)
57
58parse_keyword.c parse_keyword.h :: genparser.pl reply.kw
59    $(PERL) genparser.pl reply.kw parse_keyword.c parse_keyword.h
60
61compute_crc32.c compute_crc32.h :: gencrc32.pl
62    $(PERL) gencrc32.pl compute_crc32.c compute_crc32.h
63'
64}
Note: See TracBrowser for help on using the repository browser.