# -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
;;
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.
# endif
#endif /* !HAS_BCMP */
-/* In Tru64 define _SOCKADDR_LEN to use 4.4BSD and IPv6 interfaces.
- * Define it before any network headers like netinet/in.h or sys/socket.h.
- * For OSF/1 3.2, however, defining _SOCKADDR_LEN would be
- * a bad idea since it breaks send() and recv(). */
-#if defined(__osf__) && defined(__alpha) && !defined(_SOCKADDR_LEN) && !defined(DEC_OSF1_3_X)
-# define _SOCKADDR_LEN
-#endif
-
#ifdef I_NETINET_IN
# include <netinet/in.h>
#endif