From f62f716d325db54bb85abeeb80fa2b4466ff860b Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Wed, 8 Oct 2014 08:40:21 +0200 Subject: Tru64: the socket API defines must come early. There seems to be no way around needing to select the socket API early. --- hints/dec_osf.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'hints/dec_osf.sh') diff --git a/hints/dec_osf.sh b/hints/dec_osf.sh index 5a168061c3..1897d6b91b 100644 --- a/hints/dec_osf.sh +++ b/hints/dec_osf.sh @@ -528,7 +528,6 @@ gcc) ;; # -readonly_strings moves string constants into read-only section # which hopefully means that modifying them leads into segmentation # faults. - # for i in -trapuv -readonly_strings do case "$ccflags" in @@ -539,8 +538,24 @@ gcc) ;; ;; esac -# Would need -D_SOCKADDR_LEN for the Configure test. -d_sockaddr_sa_len='define' +# In Tru64 several slightly incompatible socket APIs are supported, +# which one applies is chosen with a set of defines: +# -D_SOCKADDR_LEN enables 4.4BSD and IPv6 interfaces +# -D_POSIX_PII_SOCKET enables socklen_t instead of size_t +for i in -D_SOCKADDR_LEN -D_POSIX_PII_SOCKET +do + case "$ccflags" in + *$i*) ;; + *) ccflags="$ccflags $i" ;; + esac +done +# For OSF/1 3.2, however, defining _SOCKADDR_LEN would be +# a bad idea since it breaks send() and recv(). +case "$ccflags" in +*DEC_OSF1_3_X*SOCKADDR_LEN*) + ccflags=`echo " $ccflags " | sed -e 's/ -D_SOCKADDR_LEN / /'` + ;; +esac # # Unset temporary variables no more needed. -- cgit v1.2.1