From 35ea4ec567b60e3c51660becc5562c5eefcaa367 Mon Sep 17 00:00:00 2001 From: crazii Date: Wed, 29 Nov 2023 17:38:57 +0800 Subject: [PATCH] add configure option for sdlnet (IPHLPAPI.DLL dependency removed for win95), in case that the build env has its own sdlnet installed and detected. --- build-mingw-lowend9x | 2 +- configure.ac | 11 +++++++++-- vs/opencow/src/kernel32.cpp | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build-mingw-lowend9x b/build-mingw-lowend9x index 3a54cab81a6..7907a7aa90c 100644 --- a/build-mingw-lowend9x +++ b/build-mingw-lowend9x @@ -77,5 +77,5 @@ export LDFLAGS #LIBS echo "Compiling DOSBox-X" chmod +x configure # FIXME: I would like MinGW builds to enable the debugger, eventually -./configure --disable-libfluidsynth --disable-libslirp --enable-d3d9=no --enable-d3d-shaders=no --prefix=/usr --enable-xbrz=no --disable-printer --disable-largefile --enable-opencow "${@}" || exit 1 +./configure --disable-libfluidsynth --disable-libslirp --disable-d3d9 --disable-d3d-shaders --prefix=/usr --disable-xbrz --disable-printer --disable-largefile --enable-opencow --disable-sdlnet "${@}" || exit 1 make -j3 || exit 1 diff --git a/configure.ac b/configure.ac index cba32bcd06d..6c2b2a7ea8b 100644 --- a/configure.ac +++ b/configure.ac @@ -181,6 +181,9 @@ dnl This is how the build script can use libopencow for win9x unicode # AH_TEMPLATE(C_OPENCOW,[Define to 1 to enable opencow]) AC_ARG_ENABLE(opencow,AC_HELP_STRING([--enable-opencow],[Enable OpenCOW]),enable_opencow=yes) +dnl Disable SDLnet for win9x builds +AC_ARG_ENABLE(sdlnet,AC_HELP_STRING([--disable-sdlnet],[Disable SDLNet]),disable_sdl_net=yes) + dnl Let me know if you're targeting Emscripten AH_TEMPLATE(C_EMSCRIPTEN,[Define to 1 to target Emscripten]) AC_ARG_ENABLE(emscripten,AC_HELP_STRING([--enable-emscripten],[Enable Emscripten target]),enable_emscripten=$enableval,enable_emscripten=no) @@ -1039,7 +1042,9 @@ case "$host" in esac dnl enable SDL2 net if SDL2 if test -n "$SDL2_LIBS"; then - if test x$have_sdl2_net_lib = xyes -a x$have_sdl_net_h = xyes ; then + if test x$disable_sdl_net = xyes ; then + AC_MSG_WARN([SDL_net is disabled in parameters]) + elif test x$have_sdl2_net_lib = xyes -a x$have_sdl_net_h = xyes ; then LIBS="$LIBS -lSDL2_net" AC_DEFINE(C_SDL_NET,1) AC_DEFINE(C_MODEM,1) @@ -1055,7 +1060,9 @@ if test -n "$SDL2_LIBS"; then AC_MSG_WARN([Can't find SDL_net, internal modem and ipx disabled]) fi else - if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then + if test x$disable_sdl_net = xyes ; then + AC_MSG_WARN([SDL_net is disabled in parameters]) + elif test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then LIBS="$LIBS -lSDL_net" AC_DEFINE(C_SDL_NET,1) AC_DEFINE(C_MODEM,1) diff --git a/vs/opencow/src/kernel32.cpp b/vs/opencow/src/kernel32.cpp index 9e8de712cd4..3c064c941d4 100644 --- a/vs/opencow/src/kernel32.cpp +++ b/vs/opencow/src/kernel32.cpp @@ -832,7 +832,7 @@ OCOW_DEF(BOOL, GetFileAttributesExW,( lpData->nFileSizeHigh = st.st_size >> 32; #endif if(!(st.st_mode&_S_IWRITE)) lpData->dwFileAttributes |= FILE_ATTRIBUTE_READONLY; - if(!(st.st_mode&_S_IFDIR)) lpData->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; + if((st.st_mode&_S_IFDIR)) lpData->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; if(lpData->dwFileAttributes == 0 && (st.st_mode&_S_IFREG)) lpData->dwFileAttributes |= FILE_ATTRIBUTE_NORMAL; return TRUE;