Topic: Compiling Chillispot 1.1.0 in FreeBSD 6.3

Hi Falks,

I have issue to compile Chillispot 1.1.0 in FreeBSD.

My operating system is:

niconet# uname -a
FreeBSD niconet.nico.pro.ec 6.3-RELEASE FreeBSD 6.3-RELEASE #1: Sun Feb  3 12:17:50 ECT 2008     root@niconet:/usr/src/sys/i386/compile/AmiloProV2030  i386

during ./configure here is no any error... but when I tried to make make check I've got following printout:

niconet# make check
Making check in src
if gcc -DHAVE_CONFIG_H -I. -I. -I..     -D_GNU_SOURCE -fno-builtin -DSBINDIR='"/usr/local/sbin"' -g -O2 -MT chilli.o -MD -MP -MF ".deps/chilli.Tpo" -c -o chilli.o chilli.c;  then mv -f ".deps/chilli.Tpo" ".deps/chilli.Po"; else rm -f ".deps/chilli.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I..     -D_GNU_SOURCE -fno-builtin -DSBINDIR='"/usr/local/sbin"' -g -O2 -MT tun.o -MD -MP -MF ".deps/tun.Tpo" -c -o tun.o tun.c;  then mv -f ".deps/tun.Tpo" ".deps/tun.Po"; else rm -f ".deps/tun.Tpo"; exit 1; fi
tun.c:369:29: missing binary operator before token "defined"
tun.c:427:2: #error "Unknown platform!"
tun.c:448:28: missing binary operator before token "defined"
tun.c:500:28: missing binary operator before token "defined"
tun.c:508:2: #error "Unknown platform!"
tun.c:588:28: missing binary operator before token "defined"
tun.c:649:2: #error "Unknown platform!"
tun.c:677:28: missing binary operator before token "defined"
tun.c:690:2: #error "Unknown platform!"
tun.c:725:28: missing binary operator before token "defined"
tun.c:824:2: #error "Unknown platform!"
*** Error code 1

Stop in /usr/home/nico/Downloads/hotspot/chillispot-1.1.0/src.
*** Error code 1

Stop in /usr/home/nico/Downloads/hotspot/chillispot-1.1.0.

Same I have when I am trying to make.

I do not really have time to go through code to find where is cause(s). So, I will be really appreciated for help to solve it out.

2 (edited by nemski 2009-02-27 08:39:11)

Re: Compiling Chillispot 1.1.0 in FreeBSD 6.3

Use this patch.

I discovered this when compiling in Solaris. I think it's just some versions of gcc that are picky about the || operands

--- chillispot-1.1.0/src/tun.c      Mon Sep 25 03:48:25 2006
+++ chillispot-1.1.0/src/tun.c   Tue Feb 24 09:00:03 2009
@@ -366,7 +366,7 @@
   this->addrs++;
   return 0;

-#elif defined (__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)

   int fd;
   struct ifaliasreq      areq;
@@ -445,7 +445,7 @@
 #if defined(__linux__)
   ifr.ifr_netmask.sa_family = AF_INET;

-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
   ((struct sockaddr_in *) &ifr.ifr_addr)->sin_len =
     sizeof (struct sockaddr_in);
   ((struct sockaddr_in *) &ifr.ifr_dstaddr)->sin_len =
@@ -497,7 +497,7 @@
     ((struct sockaddr_in *) &ifr.ifr_netmask)->sin_addr.s_addr =
       netmask->s_addr;

-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
     ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr =
       netmask->s_addr;

@@ -585,7 +585,7 @@
   close(fd);
   return 0;

-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)

 struct {
   struct rt_msghdr rt;
@@ -674,7 +674,7 @@
 #if defined(__linux__)
   struct ifreq ifr;

-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
   char devname[IFNAMSIZ+5]; /* "/dev/" + ifname */
   int devnum;
   struct ifaliasreq areq;
@@ -722,7 +722,7 @@
   ioctl((*tun)->fd, TUNSETNOCSUM, 1); /* Disable checksums */
   return 0;

-#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)

   /* Find suitable device */
   for (devnum = 0; devnum < 255; devnum++) { /* TODO 255 */

3 (edited by See5163 2015-10-08 07:48:52)

Re: Compiling Chillispot 1.1.0 in FreeBSD 6.3

Thanks for sharing.
______________________________________
Mcdonalds