cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.4k stars 291 forks source link

Basilisk II fails to build with TUN/TAP support on CentOS 7 #153

Closed dcoshea closed 6 years ago

dcoshea commented 6 years ago

With 1c9b21f on CentOS 7, configure reports:

checking whether TUN/TAP is supported... no

config.log shows:

configure:15995: checking whether TUN/TAP is supported
configure:16025: gcc -c -g -O2  conftest.c >&5
In file included from conftest.c:94:0:
/usr/include/linux/if.h:211:19: error: field 'ifru_addr' has incomplete type
   struct sockaddr ifru_addr;
                   ^
/usr/include/linux/if.h:212:19: error: field 'ifru_dstaddr' has incomplete type
   struct sockaddr ifru_dstaddr;
                   ^
/usr/include/linux/if.h:213:19: error: field 'ifru_broadaddr' has incomplete type
   struct sockaddr ifru_broadaddr;
                   ^
/usr/include/linux/if.h:214:19: error: field 'ifru_netmask' has incomplete type
   struct sockaddr ifru_netmask;
                   ^
/usr/include/linux/if.h:215:20: error: field 'ifru_hwaddr' has incomplete type
   struct  sockaddr ifru_hwaddr;

It appears that sys/socket.h must be included for struct sockaddr.

dcoshea commented 6 years ago

Pull Request #64 includes a fix for this issue in BasiliskII/src/Unix/configure.ac amongst other changes. I plan to file a PR which includes a fix for this issue by itself and also uses HAVE_SYS_SOCKET_H since presumably that is preferable to blindly #including it.