diff --git a/makefile b/makefile index e05674ae7ab..945d4ba73be 100644 --- a/makefile +++ b/makefile @@ -302,6 +302,10 @@ endif endif PARAMS += --USE_QT=$(USE_QT) +ifdef DONT_USE_NETWORK +PARAMS += --DONT_USE_NETWORK='$(DONT_USE_NETWORK)' +endif + ifdef NO_OPENGL PARAMS += --NO_OPENGL='$(NO_OPENGL)' endif diff --git a/scripts/genie.lua b/scripts/genie.lua index 11fa2fed3a5..6c69cdc8b20 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -189,7 +189,12 @@ newoption { { "0", "Disabled" }, { "1", "Enabled" }, } -} +} + +newoption { + trigger = "DONT_USE_NETWORK", + description = "Disable network access", +} local os_version = str_to_version(_OPTIONS["os_version"]) diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 1c8935c8fec..194558e38e2 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -265,27 +265,33 @@ if not _OPTIONS["MACOSX_USE_LIBSDL"] then end -BASE_TARGETOS = "unix" -SDLOS_TARGETOS = "unix" +BASE_TARGETOS = "unix" +SDLOS_TARGETOS = "unix" SYNC_IMPLEMENTATION = "tc" -if _OPTIONS["targetos"]=="openbsd" then +SDL_NETWORK = "" +if _OPTIONS["targetos"]=="linux" then + SDL_NETWORK = "taptun" +elseif _OPTIONS["targetos"]=="openbsd" then SYNC_IMPLEMENTATION = "ntc" elseif _OPTIONS["targetos"]=="netbsd" then SYNC_IMPLEMENTATION = "ntc" + SDL_NETWORK = "pcap" elseif _OPTIONS["targetos"]=="haiku" then SYNC_IMPLEMENTATION = "ntc" elseif _OPTIONS["targetos"]=="emscripten" then SYNC_IMPLEMENTATION = "mini" elseif _OPTIONS["targetos"]=="windows" then - BASE_TARGETOS = "win32" - SDLOS_TARGETOS = "win32" + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" SYNC_IMPLEMENTATION = "windows" + SDL_NETWORK = "pcap" elseif _OPTIONS["targetos"]=="macosx" then - SDLOS_TARGETOS = "macosx" + SDLOS_TARGETOS = "macosx" SYNC_IMPLEMENTATION = "ntc" + SDL_NETWORK = "pcap" elseif _OPTIONS["targetos"]=="os2" then - BASE_TARGETOS = "os2" - SDLOS_TARGETOS = "os2" + BASE_TARGETOS = "os2" + SDLOS_TARGETOS = "os2" SYNC_IMPLEMENTATION = "os2" end diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index d97adede39f..2c7cd075f08 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -2,6 +2,12 @@ forcedincludes { MAME_DIR .. "src/osd/sdl/sdlprefix.h" } +if SDL_NETWORK~="" and not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "SDLMAME_NET_" .. string.upper(SDL_NETWORK), + } +end + if _OPTIONS["NO_OPENGL"]=="1" then defines { "USE_OPENGL=0", @@ -119,7 +125,6 @@ if _OPTIONS["targetos"]=="windows" then "UNICODE", "_UNICODE", "USE_QTDEBUG=" .. USE_QT, - "SDLMAME_NET_PCAP", "main=utf8_main", } configuration { "mingw*" } @@ -138,7 +143,6 @@ if _OPTIONS["targetos"]=="windows" then elseif _OPTIONS["targetos"]=="linux" then defines { "USE_QTDEBUG=" .. USE_QT, - "SDLMAME_NET_TAPTUN", } buildoptions { '$(shell pkg-config --cflags QtGui)', @@ -148,7 +152,6 @@ elseif _OPTIONS["targetos"]=="macosx" then "SDLMAME_MACOSX", "SDLMAME_DARWIN", "USE_QTDEBUG=0", - "SDLMAME_NET_PCAP", } elseif _OPTIONS["targetos"]=="freebsd" then buildoptions { diff --git a/scripts/src/osd/windows_cfg.lua b/scripts/src/osd/windows_cfg.lua index de62afff65e..824d616aac7 100644 --- a/scripts/src/osd/windows_cfg.lua +++ b/scripts/src/osd/windows_cfg.lua @@ -7,7 +7,12 @@ defines { "USE_OPENGL=1", "USE_DISPATCH_GL=1", "DIRECTINPUT_VERSION=0x0800", - "SDLMAME_NET_PCAP", "main=utf8_main", "_WIN32_WINNT=0x0501", } + +if not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "SDLMAME_NET_PCAP", + } +end