This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / d_gai_strerror.U
1 ?RCS: Copyright (c) 2016-2016, H.Merijn Brand
2 ?RCS:
3 ?RCS: You may redistribute only under the terms of the Artistic License,
4 ?RCS: as specified in the README file that comes with the distribution.
5 ?RCS: You may reuse parts of this distribution only within the terms of
6 ?RCS: that same Artistic License; a copy of which may be found at the root
7 ?RCS: of the source tree for dist 3.0.
8 ?RCS:
9 ?MAKE:d_gai_strerror: Compile cat rm_try run Oldconfig Setvar
10 ?MAKE:  -pick add $@ %<
11 ?S:d_gai_strerror:
12 ?S:     This variable conditionally defines the HAS_GAI_STRERROR symbol
13 ?S:     if the gai_strerror() routine is available and can be used to
14 ?S:     translate error codes returned by getaddrinfo() into human
15 ?S:     readable strings.
16 ?S:.
17 ?C:HAS_GAI_STRERROR:
18 ?C:     This symbol, if defined, indicates that the gai_strerror routine
19 ?C:     is available to translate error codes returned by getaddrinfo()
20 ?C:     into human readable strings.
21 ?C:.
22 ?H:#$d_gai_strerror HAS_GAI_STRERROR    /**/
23 ?H:.
24 ?F:!try
25 ?LINT: set d_gai_strerror
26 : look for gai_strerror
27 echo " "
28 $cat >try.c <<'EOCP'
29 #include <sys/types.h>
30 #include <sys/socket.h>
31 #include <netdb.h>
32 int main ()
33 {
34     return (gai_strerror (0) ? 0 : 1);
35     }
36 EOCP
37 set try
38 ?X: if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then
39 val="$undef"
40 if eval $compile; then
41     `$run ./try`
42     case "$?" in
43         0)  echo "A working gai_strerror() found." >&4
44             val="$define" ;;
45         *)  echo "gai_strerror() found, but it doesn't work" >&4
46             ;;
47         esac
48 else
49     echo "gai_strerror() NOT found." >&4
50     fi
51 set d_gai_strerror
52 eval $setvar
53 $rm_try
54