Ticket #16604: socat-1.6.0.1-mac-CL.diff
File socat-1.6.0.1-mac-CL.diff, 8.9 KB (added by raimue (Rainer Müller), 16 years ago) |
---|
-
Makefile.in
diff -ru socat-1.6.0.1/Makefile.in socat-1.6.0.1mac/Makefile.in
old new 15 15 16 16 BINDEST = @bindir@ 17 17 18 datarootdir = @datarootdir@ 18 19 MANDEST = @mandir@ 19 20 20 21 srcdir = @srcdir@ … … 124 125 strip: progs 125 126 strip $(PROGS) 126 127 127 install: progs doc/socat.1128 install: progs $(srcdir)/doc/socat.1 128 129 mkdir -p $(DESTDIR)$(BINDEST) 129 130 $(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST) 130 131 $(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST) 131 132 $(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST) 132 133 mkdir -p $(DESTDIR)$(MANDEST)/man1 133 $(INSTALL) -m 644 doc/socat.1 $(DESTDIR)$(MANDEST)/man1/134 $(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/ 134 135 135 136 uninstall: 136 137 rm -f $(DESTDIR)$(BINDEST)/socat -
configure.in
diff -ru socat-1.6.0.1/configure.in socat-1.6.0.1mac/configure.in
old new 55 55 AC_CHECK_HEADERS(pty.h) 56 56 AC_CHECK_HEADERS(netinet/in.h netinet/in_systm.h netinet/ip.h netinet/tcp.h) 57 57 AC_CHECK_HEADERS(netinet6/in6.h) # found on OpenBSD, used for IPV6_* 58 AC_CHECK_HEADERS(arpa/nameser.h resolv.h) 59 AC_CHECK_HEADERS(termios.h net/if.h linux/if_tun.h) 58 AC_CHECK_HEADERS(net/if.h, [], [], [AC_INCLUDES_DEFAULT 59 #if HAVE_SYS_SOCKET_H 60 #include <sys/socket.h> 61 #endif]) # Mac OS X requires including sys/socket.h 62 AC_CHECK_HEADERS(arpa/nameser.h) 63 AC_HEADER_RESOLV() 64 AC_CHECK_HEADERS(termios.h linux/if_tun.h) 60 65 AC_CHECK_HEADERS(sys/utsname.h sys/select.h sys/file.h) 61 66 AC_CHECK_HEADERS(util.h libutil.h sys/stropts.h regex.h) 62 67 AC_CHECK_HEADERS(linux/fs.h linux/ext2_fs.h) 63 68 64 69 70 dnl Link libresolv if necessary (for Mac OS X) 71 AC_SEARCH_LIBS([res_9_init], [resolv]) 72 73 65 74 dnl Check for extra socket library (for Solaris) 66 75 AC_CHECK_FUNC(hstrerror, , AC_CHECK_LIB(resolv, hstrerror, [LIBS="$LIBS -lresolv"; AC_DEFINE(HAVE_HSTRERROR)])) 67 76 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) … … 185 194 if test "$WITH_IP6"; then 186 195 AC_CHECK_HEADERS([netinet/ip6.h], 187 196 [AC_DEFINE(HAVE_NETINET_IP6_H) AC_DEFINE(WITH_IP6)], 188 [AC_MSG_WARN([include file netinet/ip6.h not found, disabling IP6])]) 197 [AC_MSG_WARN([include file netinet/ip6.h not found, disabling IP6])], 198 [AC_INCLUDES_DEFAULT 199 #ifdef HAVE_NETINET_IN_H 200 # include <netinet/in.h> 201 #endif]) 189 202 fi 190 203 191 204 AC_MSG_CHECKING(whether to include raw IP support) … … 284 297 esac], 285 298 [AC_MSG_RESULT(yes); WITH_READLINE=1 ]) 286 299 287 # check if we find the components of GNU readline288 300 if test -n "$WITH_READLINE"; then 289 # first, we need to find the include file <readline.h> 290 AC_MSG_NOTICE(checking for components of readline) 291 #AC_CHECK_HEADERS(readline/readline.h readline/history.h) 292 AC_CACHE_VAL(sc_cv_have_readline_h, 293 [AC_TRY_COMPILE([#include <stdio.h> /* FreeBSD needs "FILE *" */ 294 #include <readline/readline.h> 295 #include <readline/history.h>],[;], 296 [sc_cv_have_readline_h=yes; READLINE_ROOT=""; ], 297 [sc_cv_have_readline_h=no 298 for D in "/sw" "/usr/local" "/opt/freeware" "/usr/sfw"; do 299 I="$D/include" 300 i="$I/readline/readline.h" 301 if test -r "$i"; then 302 #V_INCL="$V_INCL -I$I/" 303 CPPFLAGS="$CPPFLAGS -I$I" 304 AC_MSG_NOTICE(found $i) 305 sc_cv_have_readline_h=yes; READLINE_ROOT="$D" 306 break; 307 fi 308 done]) 309 ]) 310 if test "$sc_cv_have_readline_h" = "yes"; then 311 AC_DEFINE(HAVE_READLINE_READLINE_H) 312 AC_DEFINE(HAVE_READLINE_HISTORY_H) 313 fi 314 AC_MSG_NOTICE(checked for readline.h... $sc_cv_have_readline_h) 315 fi # end checking for readline.h 316 # 317 if test -n "$WITH_READLINE" -a "$sc_cv_have_readline_h" = yes; then 318 # next, we search for the readline library (libreadline.*) 319 AC_MSG_CHECKING(for libreadline) 320 AC_CACHE_VAL(sc_cv_have_libreadline, 321 [ LIBS0="$LIBS" 322 if test -n "$READLINE_ROOT"; then 323 L="$READLINE_ROOT/lib"; LIBS="$LIBS0 -L$L -lreadline" 324 else 325 LIBS="$LIBS0 -lreadline" 326 fi 327 AC_TRY_LINK([#include <stdio.h> /* FreeBSD needs FILE * */ 328 #include <readline/readline.h> 329 #include <readline/history.h>], 330 [readline(NULL)], 331 [sc_cv_have_libreadline='yes'], 332 [sc_cv_have_libreadline='no' 333 LIBS1="$LIBS" 334 LIBS="$LIBS -lcurses" 335 AC_TRY_LINK([#include <stdio.h> /* FreeBSD needs FILE * */ 336 #include <readline/readline.h> 337 #include <readline/history.h>], 338 [readline(NULL)], 339 [sc_cv_have_libreadline='yes'], 340 [sc_cv_have_libreadline='no' 341 LIBS="$LIBS1 -lncurses" # eg for SuSE52 342 AC_TRY_LINK([#include <stdio.h> /* FreeBSD needs FILE * */ 343 #include <readline/readline.h> 344 #include <readline/history.h>], 345 [readline(NULL)], 346 [sc_cv_have_libreadline='yes'], 347 [sc_cv_have_libreadline='no']) 348 ])] 349 ) 350 if test "$sc_cv_have_libreadline" != 'yes'; then 351 LIBS="$LIBS0" 352 fi 353 ] 354 #! missing libcurses dependency; missing freeware places 355 # # we test if libcurses is available and if it can be used without further libs 356 # AC_CHECK_LIB(ncurses, main, , AC_CHECK_LIB(curses, main)) # some Linux work with this 357 # # we test if readline can be used without further libs 358 # AC_CHECK_LIB(readline, readline) 359 # # we see if using_history() is already in $LIBS; if not, we try it with curses 360 # AC_CHECK_FUNC(using_history, , AC_CHECK_LIB(history, using_history,,, -lcurses)) 361 #fi 362 ) 363 if test "$sc_cv_have_libreadline" = 'yes'; then 364 AC_DEFINE(HAVE_LIBREADLINE) 365 fi 366 AC_MSG_RESULT($sc_cv_have_libreadline) 367 fi 368 # 369 if test -n "$WITH_READLINE"; then 370 if test "$sc_cv_have_readline_h" = "yes" -a "$sc_cv_have_libreadline" = "yes"; then 371 AC_DEFINE(WITH_READLINE) 372 else 373 AC_MSG_WARN([not all components of readline found, disabling it]); 301 CPPFLAGS_ORIG=$CPPFLAGS 302 CFLAGS_ORIG=$CFLAGS 303 LIBS_ORIG=$LIBS 304 sc_usable_readline_found= 305 306 for D in "" "/usr/local" "/opt/local" "/sw" "/opt/freeware" "/usr/sfw"; do 307 if test -n "$D" ; then 308 CPPFLAGS="$CPPFLAGS -I$D/include" 309 CFLAGS="$CFLAGS -L$D/lib" 310 DLOC="in location $D" 311 else 312 DLOC="in default location" 313 fi 314 AC_MSG_CHECKING(for usable readline $DLOC) 315 316 # Some systems require -lcurses, some require -lncurses. 317 # Mac OS X 10.4 (and others) ships with libedit masquerading as readline, 318 # but it doesn't work well with socat. It can be recognized by the absence 319 # of append_history. 320 321 for L in "" "-lcurses" "-lncurses"; do 322 LIBS="$LIBS_ORIG -lreadline $L" 323 AC_TRY_LINK( 324 [ #include <stdio.h> 325 #include <readline/readline.h> 326 #include <readline/history.h>], 327 [ readline(NULL); 328 append_history(0, NULL); ], 329 [ sc_usable_readline_found=1 330 break ]) 331 done 332 333 if test -n "$sc_usable_readline_found"; then 334 AC_MSG_RESULT(yes) 335 AC_DEFINE(HAVE_READLINE_READLINE_H,1) 336 AC_DEFINE(HAVE_READLINE_HISTORY_H,1) 337 AC_DEFINE(HAVE_LIBREADLINE,1) 338 AC_DEFINE(WITH_READLINE,1) 339 break 340 else 341 AC_MSG_RESULT(no) 342 CPPFLAGS=$CPPFLAGS_ORIG 343 CFLAGS=$CFLAGS_ORIG 344 LIBS=$LIBS_ORIG 345 fi 346 done 347 348 if test -z "$sc_usable_readline_found"; then 349 AC_MSG_WARN([no suitable version of readline found; perhaps you need to install a newer version]) 374 350 fi 375 351 fi 376 352 -
socat-1.6.0.
diff -ru socat-1.6.0.1/test.sh socat-1.6.0.1mac/test.sh
old new 83 83 OpenBSD)IFCONFIG=/sbin/ifconfig ;; 84 84 OSF1) IFCONFIG=/sbin/ifconfig ;; 85 85 SunOS) IFCONFIG=/sbin/ifconfig ;; 86 Darwin)IFCONFIG=/sbin/ifconfig ;; 86 87 #*) IFCONFIG=/sbin/ifconfig ;; 87 88 esac 88 89 … … 140 141 PRINTF="printf" 141 142 142 143 case "$TERM" in 143 vt100|vt320|linux|xterm|cons25|dtterm|aixterm|sun-color )144 vt100|vt320|linux|xterm|cons25|dtterm|aixterm|sun-color|xterm-color) 144 145 # there are different behaviours of printf (and echo) 145 146 # on some systems, echo behaves different than printf... 146 147 if [ $($PRINTF "\0101") = "A" ]; then … … 1594 1595 OpenBSD)l=$($IFCONFIG -a |fgrep 'inet 127.0.0.1 ');; 1595 1596 OSF1) l=$($IFCONFIG -a |grep ' inet ') ;; 1596 1597 SunOS) l=$($IFCONFIG -a |grep 'inet ') ;; 1598 Darwin)l=$($IFCONFIG lo0 |fgrep 'inet 127.0.0.1 ') ;; 1597 1599 # *) l=$($IFCONFIG -a |grep ' ::1[^:0-9A-Fa-f]') ;; 1598 1600 esac 1599 1601 [ -z "$l" ] && return 1 … … 1619 1621 NetBSD)l=$(/sbin/ifconfig -a |grep 'inet6 ::1 ');; 1620 1622 OSF1) l=$(/sbin/ifconfig -a |grep ' inet6 ') ;; 1621 1623 SunOS) l=$(/sbin/ifconfig -a |grep 'inet6 ') ;; 1624 Darwin)l=$(/sbin/ifconfig lo0 |grep 'inet6 ::1 ') ;; 1622 1625 *) l=$(/sbin/ifconfig -a |grep ' ::1[^:0-9A-Fa-f]') ;; 1623 1626 esac 1624 1627 [ -z "$l" ] && return 1 1625 1628 # existence of interface might not suffice, check for routeability: 1626 1629 case "$UNAME" in 1627 Darwin) ping -c 1 ::1; l="$?" ;;1630 Darwin) ping6 -c 1 ::1; l="$?" ;; 1628 1631 Linux) ping6 -c 1 ::1; l="$?" ;; 1629 1632 *) if [ -n "$l" ]; then l=0; else l=1; fi ;; 1630 1633 esac