Solaris 8 and Sun Studio support

This commit is contained in:
Gerhard Rieger 2012-07-22 14:38:07 +02:00
parent 4b25958cb0
commit 364edd63df
5 changed files with 43 additions and 9 deletions

View file

@ -40,6 +40,9 @@ porting:
contain -Wall failed (esp.RedHat). Thanks to Paul Wouters for reporting
this problem and to Simon Matter for providing the patch
support for Solaris 8 and Sun Studio support (thanks to Sebastian
Kayser for providing the patches)
on some 64bit systems a compiler warning "cast from pointer to integer
of different size" was issued on some option definitions

View file

@ -1,5 +1,5 @@
# source: Makefile.in
# Copyright Gerhard Rieger 2001-2009
# Copyright Gerhard Rieger 2001-2012
# Published under the GNU General Public License V.2, see file COPYING
# note: @...@ forms are filled in by configure script
@ -23,6 +23,7 @@ VPATH = @srcdir@
CC = @CC@
CCOPTS = $(CCOPT) -Wall -Wno-parentheses
CCOPTS = $(CCOPT)
SYSDEFS = @SYSDEFS@
CPPFLAGS = -I. @CPPFLAGS@

View file

@ -42,7 +42,11 @@ AC_CHECK_PROG(AR, ar, ar, gar)
AC_LANG_COMPILER_REQUIRE()
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -D_GNU_SOURCE"
CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -Wno-parentheses"
ERRONWARN="-Werror -O0"
else
# Sun Studio?
ERRONWARN="-errwarn"
fi
export CFLAGS
@ -53,9 +57,15 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/param.h sys/ioctl.h sys/time.h syslog.h unistd.h)
AC_CHECK_HEADERS(pwd.h grp.h stdint.h sys/types.h sys/poll.h sys/socket.h sys/uio.h sys/stat.h netdb.h sys/un.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(netinet/in.h netinet/in_systm.h netinet/ip.h netinet/tcp.h)
AC_CHECK_HEADERS(netinet/in.h netinet/in_systm.h)
AC_CHECK_HEADERS(netinet/ip.h, [], [], [AC_INCLUDES_DEFAULT
#if HAVE_NETINET_IN_H && HAVE_NETINET_IN_SYSTM_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#endif]) # Solaris prerequisites for netinet/ip.h
AC_CHECK_HEADERS(netinet/tcp.h)
AC_CHECK_HEADERS(netinet6/in6.h) # found on OpenBSD, used for IPV6_*
AC_CHECK_HEADERS(net/if.h, [], [], [AC_INCLUDES_DEFAULT
AC_CHECK_HEADER(net/if.h, [], [], [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif]) # Mac OS X requires including sys/socket.h
@ -84,7 +94,7 @@ AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
dnl Check for hstrerror prototype
AC_MSG_CHECKING(for hstrerror prototype)
AC_CACHE_VAL(sc_cv_have_prototype_hstrerror,
[CFLAGS1="$CFLAGS"; CFLAGS="-Werror -O0 $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')";
[CFLAGS1="$CFLAGS"; CFLAGS="$ERRONWARN $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')";
AC_TRY_COMPILE([#include <netdb.h>],[hstrerror();],
[sc_cv_have_prototype_hstrerror=no],
[sc_cv_have_prototype_hstrerror=yes]);
@ -1312,7 +1322,7 @@ dnl output values: 1..short, 2..unsigned short, 3..int, 4..u-int,
dnl 5..long, 6..u-long; others not yet supported
define(AC_BASIC_TYPE,[
AC_CACHE_CHECK(for equivalent simple type of $2, $4,
[CFLAGS1="$CFLAGS"; CFLAGS="-Werror -O0 $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')"
[CFLAGS1="$CFLAGS"; CFLAGS="$ERRONWARN $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')"
AC_TRY_COMPILE([$1],[$2 u; short v; &u==&v;],
[$4="1 /* short */"],
[AC_TRY_COMPILE([$1],[$2 u; unsigned short v; &u==&v;],
@ -1344,7 +1354,7 @@ dnl arg4: output variable, values see AC_BASIC_TYPE
dnl arg5: cache variable (might be constructed automatically)
define(AC_TYPEOF_COMPONENT,[
AC_CACHE_CHECK(for basic type of $2.$3, $5,
[CFLAGS1="$CFLAGS"; CFLAGS="-Werror -O0 $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')"
[CFLAGS1="$CFLAGS"; CFLAGS="$ERRONWARN $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')"
AC_TRY_COMPILE([$1],[$2 u;short v; &u.$3==&v;],
[$5="1 /* short */"],
[AC_TRY_COMPILE([$1],[$2 u; unsigned short v; &u.$3==&v;],

View file

@ -1,5 +1,5 @@
/* source: sycls.c */
/* Copyright Gerhard Rieger 2001-2009 */
/* Copyright Gerhard Rieger 2001-2012 */
/* Published under the GNU General Public License V.2, see file COPYING */
/* explicit system call and C library trace function, for those who miss strace
@ -18,6 +18,7 @@
#include "error.h"
#include "filan.h"
#include "utils.h"
#include "sysutils.h"
#include "sycls.h"

21
test.sh
View file

@ -112,6 +112,11 @@ HP-UX|OSF1)
chmod a+x cat.sh
CAT=./cat.sh
;;
SunOS)
# /usr/bin/tr doesn't handle the a-z range syntax (needs [a-z]), use
# /usr/xpg4/bin/tr instead
alias tr=/usr/xpg4/bin/tr
;;
*)
CAT=cat
;;
@ -9258,6 +9263,9 @@ if ! eval $NUMCOND; then :;
elif [ "$ROOT" = root -a $(id -u) -ne 0 -a "$withroot" -eq 0 ]; then
$PRINTF "test $F_n $TEST... ${YELLOW}must be root${NORMAL}\n" $N
numCANT=$((numCANT+1))
elif [ "$PF" = "IP6" ] && ( ! feat=$(testaddrs ip6) || ! runsip6 >/dev/null ); then
$PRINTF "test $F_n $TEST... ${YELLOW}IP6 not available${NORMAL}\n" $N
numCANT=$((numCANT+1))
else
tf="$td/test$N.stdout"
te="$td/test$N.stderr"
@ -9378,6 +9386,10 @@ if ! eval $NUMCOND; then :;
elif ! feat=$(testaddrs $FEAT); then
$PRINTF "test $F_n $TEST... ${YELLOW}$(echo "$feat" |tr a-z A-Z) not available${NORMAL}\n" $N
numCANT=$((numCANT+1))
elif [ "$KEYW" = "TCP6" -o "$KEYW" = "UDP6" -o "$KEYW" = "SCTP6" ] && \
! runsip6 >/dev/null; then
$PRINTF "test $F_n $TEST... ${YELLOW}IP6 not available${NORMAL}\n" $N
numCANT=$((numCANT+1))
else
tf="$td/test$N.stdout"
te="$td/test$N.stderr"
@ -9473,6 +9485,9 @@ if ! eval $NUMCOND; then :;
elif [ "$ROOT" = root -a $(id -u) -ne 0 -a "$withroot" -eq 0 ]; then
$PRINTF "test $F_n $TEST... ${YELLOW}must be root${NORMAL}\n" $N
numCANT=$((numCANT+1))
elif [ "$PF" = "IP6" ] && ( ! feat=$(testaddrs ip6) || ! runsip6 ) >/dev/null; then
$PRINTF "test $F_n $TEST... ${YELLOW}IP6 not available${NORMAL}\n" $N
numCANT=$((numCANT+1))
else
tf="$td/test$N.stdout"
te="$td/test$N.stderr"
@ -9626,7 +9641,11 @@ NAME=SOCKET_CONNECT_TCP6
case "$TESTS" in
*%functions%*|*%generic%*|*%tcp6%*|*%socket%*|*%$NAME%*)
TEST="$NAME: socket connect with TCP/IPv6"
if ! eval $NUMCOND; then :; else
if ! eval $NUMCOND; then :;
elif ! testaddrs tcp ip6 >/dev/null || ! runsip6 >/dev/null; then
$PRINTF "test $F_n $TEST... ${YELLOW}TCP6 not available${NORMAL}\n" $N
numCANT=$((numCANT+1))
else
# start a TCP6-LISTEN process that echoes data, and send test data using
# SOCKET-CONNECT, selecting TCP/IPv6. The sent data should be returned.
tf="$td/test$N.stdout"