This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Subject: optimize matching -g still enables -DDEBUGING
[metaconfig.git] / U / modified / d_htonl.U
CommitLineData
9b04e79a 1?RCS: $Id: d_htonl.U 1 2006-08-24 12:32:52Z rmanfredi $
959f3c4c 2?RCS:
9b04e79a 3?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
41322e17 4?RCS:
959f3c4c
JH
5?RCS: You may redistribute only under the terms of the Artistic Licence,
6?RCS: as specified in the README file that comes with the distribution.
7?RCS: You may reuse parts of this distribution only within the terms of
8?RCS: that same Artistic Licence; a copy of which may be found at the root
9b04e79a 9?RCS: of the source tree for dist 4.0.
959f3c4c
JH
10?RCS:
11?RCS: $Log: d_htonl.U,v $
12?RCS: Revision 3.0.1.2 1994/08/29 16:09:25 ram
13?RCS: patch32: now properly handles htonl() and friends when macros (ADO)
14?RCS:
15?RCS: Revision 3.0.1.1 1994/05/06 14:45:00 ram
16?RCS: patch23: now also check for htonl() macro (ADO)
17?RCS:
18?RCS: Revision 3.0 1993/08/18 12:06:22 ram
19?RCS: Baseline for dist 3.0 netwide release.
20?RCS:
21?MAKE:d_htonl: Inlibc Setvar i_niin i_sysin i_arpainet cat rm contains \
22 cppstdin cppflags cppminus
23?MAKE: -pick add $@ %<
24?S:d_htonl:
25?S: This variable conditionally defines HAS_HTONL if htonl() and its
26?S: friends are available to do network order byte swapping.
27?S:.
28?C:HAS_HTONL (HTONL):
29?C: This symbol, if defined, indicates that the htonl() routine (and
30?C: friends htons() ntohl() ntohs()) are available to do network
31?C: order byte swapping.
32?C:.
33?C:HAS_HTONS (HTONS):
34?C: This symbol, if defined, indicates that the htons() routine (and
35?C: friends htonl() ntohl() ntohs()) are available to do network
36?C: order byte swapping.
37?C:.
38?C:HAS_NTOHL (NTOHL):
39?C: This symbol, if defined, indicates that the ntohl() routine (and
40?C: friends htonl() htons() ntohs()) are available to do network
41?C: order byte swapping.
42?C:.
43?C:HAS_NTOHS (NTOHS):
44?C: This symbol, if defined, indicates that the ntohs() routine (and
45?C: friends htonl() htons() ntohl()) are available to do network
46?C: order byte swapping.
47?C:.
48?H:#$d_htonl HAS_HTONL /**/
49?H:#$d_htonl HAS_HTONS /**/
50?H:#$d_htonl HAS_NTOHL /**/
51?H:#$d_htonl HAS_NTOHS /**/
52?H:.
9b04e79a 53?F:!htonl.c
959f3c4c
JH
54?LINT:set d_htonl
55: see if htonl --and friends-- exists
56val=''
57set htonl val
58eval $inlibc
59
60: Maybe they are macros.
61case "$val" in
62$undef)
63 $cat >htonl.c <<EOM
64#include <stdio.h>
65#include <sys/types.h>
66#$i_niin I_NETINET_IN
67#$i_sysin I_SYS_IN
68#$i_arpainet I_ARPA_INET
69#ifdef I_NETINET_IN
70#include <netinet/in.h>
71#endif
72#ifdef I_SYS_IN
73#include <sys/in.h>
74#endif
75#ifdef I_ARPA_INET
76#include <arpa/inet.h>
77#endif
78#ifdef htonl
79printf("Defined as a macro.");
80#endif
81EOM
82 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
83 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
84 val="$define"
85 echo "But it seems to be defined as a macro." >&4
86 fi
87 $rm -f htonl.?
88 ;;
89esac
90set d_htonl
91eval $setvar
92