Compiling 2.2S4 on Mac OS X Server? illegal cast error in ident.c

From: Todd Daniel Woodward <tdwoodward@dont-contact.us>
Date: Tue, 07 Sep 1999 11:18:37 -0500

Back in April, Mike Laster was so kind to modify Squid 2.1P2
to work with Mac OS X Server <ftp.next.peak.org/pub/apple/macosx/server/Applications/Network/Proxy/CLI/squid>,
and it works better and much much faster than 1.1.20. (I
can't find any contact info for Mr. Laster however.)

Here's his diff:

Only in squid-2.1.PATCH2-rhapsody/auth_modules: dummy
diff -cr squid-2.1.PATCH2/cfgaux/config.guess
squid-2.1.PATCH2-rhapsody/cfgaux/config.guess
*** squid-2.1.PATCH2/cfgaux/config.guess Mon Aug 3
18:24:47 1998
--- squid-2.1.PATCH2-rhapsody/cfgaux/config.guess Sat
Apr 17 12:36:55 1999
***************
*** 555,560 ****
--- 555,563 ----
      news*:NEWS-OS:[56].*:*)
        echo mips-sony-newsos${UNAME_RELEASE}
        exit 0 ;;
+ *:Rhapsody:*:*)
+ echo `arch`-apple-rhapsody${UNAME_RELEASE}
+ exit 0;;
  esac
  
  #echo '(No uname command or uname output not recognized.)'
1>&2
diff -cr squid-2.1.PATCH2/cfgaux/config.sub
squid-2.1.PATCH2-rhapsody/cfgaux/config.sub
*** squid-2.1.PATCH2/cfgaux/config.sub Wed Apr 8 01:11:33
1998
--- squid-2.1.PATCH2-rhapsody/cfgaux/config.sub Sat Apr 17
12:38:08 1999
***************
*** 753,758 ****
--- 753,761 ----
        -xenix)
                os=-xenix
                ;;
+ -rhapsody*)
+ os=-rhapsody
+ ;;
        -none)
                ;;
        *)
diff -cr squid-2.1.PATCH2/include/config.h.in
squid-2.1.PATCH2-rhapsody/include/config.h.in
*** squid-2.1.PATCH2/include/config.h.in Mon Aug 3
17:00:08 1998
--- squid-2.1.PATCH2-rhapsody/include/config.h.in Sat
Apr 17 13:02:23 1999
***************
*** 94,99 ****
--- 94,102 ----
  #elif defined(__CYGWIN32__) || defined(WIN32) ||
defined(WINNT) || defined(__WIN32__) || defined(__WIN32)
  #define _SQUID_MSWIN_
  
+ #elif defined(__APPLE__)
+ #define _SQUID_APPLE_
+
  #endif
  
  #if !defined(CACHE_HTTP_PORT)
diff -cr squid-2.1.PATCH2/src/ftp.c
squid-2.1.PATCH2-rhapsody/src/ftp.c
*** squid-2.1.PATCH2/src/ftp.c Mon Nov 16 12:22:46 1998
--- squid-2.1.PATCH2-rhapsody/src/ftp.c Sat Apr 17 13:05:52
1999
***************
*** 1787,1793 ****
--- 1787,1797 ----
      comm_close(ftpState->data.fd);
      debug(9, 3) ("ftpAcceptDataConnection: Connected data
socket on FD %d\n", fd);
      ftpState->data.fd = fd;
+ #ifdef _SQUID_APPLE_
+ ftpState->data.port = ntohs((u_short)peer.sin_port);
+ #else
      ftpState->data.port = ntohs(peer.sin_port);
+ #endif
      ftpState->data.host = xstrdup(inet_ntoa(peer.sin_addr));
      commSetTimeout(ftpState->data.fd, Config.Timeout.read,
ftpTimeout,
        ftpState);
diff -cr squid-2.1.PATCH2/src/squid.h
squid-2.1.PATCH2-rhapsody/src/squid.h
*** squid-2.1.PATCH2/src/squid.h Fri Oct 30 14:48:16
1998
--- squid-2.1.PATCH2-rhapsody/src/squid.h Sat Apr 17
13:33:59 1999
***************
*** 51,56 ****
--- 51,63 ----
  #define CHANGE_FD_SETSIZE 0
  #endif
  
+ /* Trying to redefine CHANGE_FD_SETSIZE causes a slew of
warnings on
+ Mac OS X Server */
+ #if defined(_SQUID_APPLE_)
+ #undef CHANGE_FD_SETSIZE
+ #define CHANGE_FD_SETSIZE 0
+ #endif
+
  /* Cannot increase FD_SETSIZE on FreeBSD before 2.2.0,
causes select(2)
   * to return EINVAL. */
  /* Marian Durkovic <marian@svf.stuba.sk> */
***************
*** 64,72 ****
--- 71,81 ----
  #endif
  
  /* Increase FD_SETSIZE if SQUID_MAXFD is bigger */
+ #ifndef _SQUID_APPLE_
  #if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE
  #define FD_SETSIZE SQUID_MAXFD
  #endif
+ #endif
  
  #if PURIFY
  /* disable assert() under purify */
***************
*** 346,352 ****
--- 355,365 ----
  #include "globals.h"
  
  #include "util.h"
+ /* Mac OS X Server already has radix.h as a standard
header, so this causes
+ conflicts */
+ #ifndef _SQUID_APPLE_
  #include "radix.h"
+ #endif
  
  #if !HAVE_TEMPNAM
  #include "tempnam.h"

I tried to implement most of these changes in 2.2S4, but
unfortunately I get the following error during make all:

cc -g -O2 -Wall -I. -I../include -I../include -c ident.c
ident.c:200: illegal cast, missing `)' after `peer'
make[1]: *** [ident.o] Error 1
make: *** [all] Error 1

Anyone have any insight into tweaking Squid 2.2S4 enough to
compile correctly under Mac OS X Server?

Thanks,

Todd Daniel Woodward
Technical Consultant
RadioDigest.com Inc.

http://radiodigest.com

     "Radio you can READ!"
Received on Tue Sep 07 1999 - 10:35:37 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:48:21 MST