summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hints/dec_osf.sh21
-rw-r--r--perl.h8
2 files changed, 18 insertions, 11 deletions
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.
diff --git a/perl.h b/perl.h
index 091d2d1f53..f0f3192d0d 100644
--- a/perl.h
+++ b/perl.h
@@ -1063,14 +1063,6 @@ EXTERN_C int usleep(unsigned int);
# 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