From eff68304154017ba699a190a59025f75eb96eed7 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sat, 14 May 2005 08:10:49 +0000 Subject: [PATCH] detect slirp at configure time, aka fix build when ether_dummy.cpp is used --- BasiliskII/src/Unix/Makefile.in | 8 +------- BasiliskII/src/Unix/configure.ac | 14 ++++++++++++++ BasiliskII/src/Unix/ether_unix.cpp | 4 ++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/BasiliskII/src/Unix/Makefile.in b/BasiliskII/src/Unix/Makefile.in index 3fe2d7e0..08cca530 100644 --- a/BasiliskII/src/Unix/Makefile.in +++ b/BasiliskII/src/Unix/Makefile.in @@ -32,13 +32,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s INSTALL_DATA = @INSTALL_DATA@ SLIRP_CFLAGS = @SLIRP_CFLAGS@ -SLIRP_SRCS = \ - ../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ - ../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ - ../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ - ../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ - ../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ - ../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c +SLIRP_SRCS = @SLIRP_SRCS@ SLIRP_OBJS = $(SLIRP_SRCS:../slirp/%.c=obj/%.o) ## Files diff --git a/BasiliskII/src/Unix/configure.ac b/BasiliskII/src/Unix/configure.ac index e0fd2e40..35a4f06c 100644 --- a/BasiliskII/src/Unix/configure.ac +++ b/BasiliskII/src/Unix/configure.ac @@ -485,6 +485,20 @@ cygwin*) EXTRASYSSRCS="../Windows/BasiliskII.rc" ;; esac + +dnl Is the slirp library supported? +if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then + AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) + SLIRP_SRCS="\ + ../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ + ../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ + ../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ + ../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ + ../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ + ../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c" +fi +AC_SUBST(SLIRP_SRCS) + dnl SDL overrides if [[ "x$WANT_SDL" = "xyes" ]]; then AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) diff --git a/BasiliskII/src/Unix/ether_unix.cpp b/BasiliskII/src/Unix/ether_unix.cpp index 0c3a94af..f86f9fce 100644 --- a/BasiliskII/src/Unix/ether_unix.cpp +++ b/BasiliskII/src/Unix/ether_unix.cpp @@ -47,9 +47,9 @@ #include #endif -// XXX: slirp works on 64-bit platforms, sometimes -#define HAVE_SLIRP 1 +#ifdef HAVE_SLIRP #include "libslirp.h" +#endif #include "cpu_emulation.h" #include "main.h"