?RCS: Copyright (c) 2016-2016, H.Merijn Brand
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 3.0.
?RCS:
?MAKE:d_gai_strerror: Compile cat rm_try run Oldconfig Setvar
?MAKE:	-pick add $@ %<
?S:d_gai_strerror:
?S:	This variable conditionally defines the HAS_GAI_STRERROR symbol
?S:	if the gai_strerror() routine is available and can be used to
?S:	translate error codes returned by getaddrinfo() into human
?S:	readable strings.
?S:.
?C:HAS_GAI_STRERROR:
?C:	This symbol, if defined, indicates that the gai_strerror routine
?C:	is available to translate error codes returned by getaddrinfo()
?C:	into human readable strings.
?C:.
?H:#$d_gai_strerror HAS_GAI_STRERROR	/**/
?H:.
?F:!try
?LINT: set d_gai_strerror
: look for gai_strerror
echo " "
$cat >try.c <<'EOCP'
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int main ()
{
    return (gai_strerror (0) ? 0 : 1);
    }
EOCP
set try
?X: if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then
val="$undef"
if eval $compile; then
    `$run ./try`
    case "$?" in
	0)  echo "A working gai_strerror() found." >&4
	    val="$define" ;;
	*)  echo "gai_strerror() found, but it doesn't work" >&4
	    ;;
	esac
else
    echo "gai_strerror() NOT found." >&4
    fi
set d_gai_strerror
eval $setvar
$rm_try

