Split DOS utility install between legacy and new binaries
Keep the previous DOS utility binary as netold.exe and use it as the default source for legacy command names. Install the new net.exe only for tools that are not available in the legacy binary, currently SLIST, FLAG and FLAGDIR. Add CMake selection logic so maintainers can opt into installing the new binary for all command names with MARS_NWE_INSTALL_NEW_DOSUTILS, while the default install remains conservative for older NETX/DOSX-style setups. Update the staged net.exe to the current Client32-enabled build and add netold.exe as the preserved legacy binary.
This commit is contained in:
119
CMakeLists.txt
119
CMakeLists.txt
@@ -1,17 +1,24 @@
|
||||
# DOS utilities for mars-nwe.
|
||||
#
|
||||
# Default mode: install a prebuilt net.exe from this source tree. This keeps the
|
||||
# normal mars-nwe build independent from Open Watcom.
|
||||
# Default install mode uses a split:
|
||||
# - legacy command names are installed from netold.exe
|
||||
# - new command names that netold.exe does not contain are installed from net.exe
|
||||
#
|
||||
# Maintainer mode: configure with -DMARS_NWE_BUILD_DOSUTILS=ON to rebuild
|
||||
# net.exe with Open Watcom v2 on Linux.
|
||||
# Maintainer mode can rebuild the new net.exe with Open Watcom. The freshly
|
||||
# built binary is only installed when MARS_NWE_INSTALL_NEW_DOSUTILS is ON, or
|
||||
# for the new-only command names in the default split install.
|
||||
|
||||
set(MARS_DOSUTILS_NET_EXE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/net.exe"
|
||||
CACHE FILEPATH "Prebuilt DOS net.exe used for installation when MARS_NWE_BUILD_DOSUTILS is OFF"
|
||||
set(MARS_DOSUTILS_LEGACY_NET_EXE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/netold.exe"
|
||||
CACHE FILEPATH "Legacy/pre-Client32 DOS net.exe used by default for legacy command names"
|
||||
)
|
||||
|
||||
set(MARS_DOSUTILS_PUBLIC_TOOLS
|
||||
set(MARS_DOSUTILS_NEW_NET_EXE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/net.exe"
|
||||
CACHE FILEPATH "New/experimental DOS net.exe used for new-only tools or when MARS_NWE_INSTALL_NEW_DOSUTILS is ON"
|
||||
)
|
||||
|
||||
set(MARS_DOSUTILS_LEGACY_TOOLS
|
||||
net
|
||||
login
|
||||
profile
|
||||
@@ -23,15 +30,17 @@ set(MARS_DOSUTILS_PUBLIC_TOOLS
|
||||
map
|
||||
mapdel
|
||||
logout
|
||||
slist
|
||||
flag
|
||||
flagdir
|
||||
capture
|
||||
endcap
|
||||
)
|
||||
|
||||
# Do not install slist.exe yet: func_slist() is empty and SLIST is disabled in net.c.
|
||||
# Do not install tests/debug by default either; they are developer-only helpers.
|
||||
# Tools not present in netold.exe. These are installed from the new binary
|
||||
# even in the default split mode.
|
||||
set(MARS_DOSUTILS_NEW_ONLY_TOOLS
|
||||
slist
|
||||
flag
|
||||
flagdir
|
||||
)
|
||||
|
||||
if(MARS_NWE_BUILD_DOSUTILS)
|
||||
find_package(OpenWatcom REQUIRED)
|
||||
@@ -119,37 +128,69 @@ if(MARS_NWE_BUILD_DOSUTILS)
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/net.exe"
|
||||
)
|
||||
|
||||
set(MARS_DOSUTILS_NET_EXE "${CMAKE_CURRENT_BINARY_DIR}/net.exe")
|
||||
set(MARS_DOSUTILS_BUILT_NET_EXE "${CMAKE_CURRENT_BINARY_DIR}/net.exe")
|
||||
else()
|
||||
if(NOT EXISTS "${MARS_DOSUTILS_NET_EXE}")
|
||||
message(FATAL_ERROR
|
||||
"Prebuilt DOS utility missing: ${MARS_DOSUTILS_NET_EXE}. "
|
||||
"Either commit net.exe into dosutils or configure with "
|
||||
"-DMARS_NWE_BUILD_DOSUTILS=ON and Open Watcom installed."
|
||||
)
|
||||
endif()
|
||||
set(MARS_DOSUTILS_BUILT_NET_EXE "")
|
||||
endif()
|
||||
|
||||
foreach(tool IN LISTS MARS_DOSUTILS_PUBLIC_TOOLS)
|
||||
if(tool STREQUAL "net")
|
||||
install(FILES "${MARS_DOSUTILS_NET_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/public")
|
||||
else()
|
||||
install(FILES "${MARS_DOSUTILS_NET_EXE}"
|
||||
if(MARS_NWE_BUILD_DOSUTILS)
|
||||
set(MARS_DOSUTILS_SELECTED_NEW_EXE "${MARS_DOSUTILS_BUILT_NET_EXE}")
|
||||
else()
|
||||
set(MARS_DOSUTILS_SELECTED_NEW_EXE "${MARS_DOSUTILS_NEW_NET_EXE}")
|
||||
endif()
|
||||
|
||||
if(MARS_NWE_INSTALL_NEW_DOSUTILS)
|
||||
set(MARS_DOSUTILS_SELECTED_LEGACY_EXE "${MARS_DOSUTILS_SELECTED_NEW_EXE}")
|
||||
else()
|
||||
set(MARS_DOSUTILS_SELECTED_LEGACY_EXE "${MARS_DOSUTILS_LEGACY_NET_EXE}")
|
||||
endif()
|
||||
|
||||
if(MARS_NWE_INSTALL_DOSUTILS)
|
||||
if(NOT EXISTS "${MARS_DOSUTILS_SELECTED_LEGACY_EXE}")
|
||||
message(FATAL_ERROR
|
||||
"Selected legacy/default DOS utility missing: ${MARS_DOSUTILS_SELECTED_LEGACY_EXE}. "
|
||||
"Commit dosutils/netold.exe, enable MARS_NWE_INSTALL_NEW_DOSUTILS, "
|
||||
"or enable MARS_NWE_BUILD_DOSUTILS."
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${MARS_DOSUTILS_SELECTED_NEW_EXE}")
|
||||
message(FATAL_ERROR
|
||||
"Selected new DOS utility missing: ${MARS_DOSUTILS_SELECTED_NEW_EXE}. "
|
||||
"Commit dosutils/net.exe or enable MARS_NWE_BUILD_DOSUTILS."
|
||||
)
|
||||
endif()
|
||||
|
||||
message(STATUS "DOS legacy/default utility binary: ${MARS_DOSUTILS_SELECTED_LEGACY_EXE}")
|
||||
message(STATUS "DOS new-only utility binary: ${MARS_DOSUTILS_SELECTED_NEW_EXE}")
|
||||
|
||||
foreach(tool IN LISTS MARS_DOSUTILS_LEGACY_TOOLS)
|
||||
if(tool STREQUAL "net")
|
||||
install(FILES "${MARS_DOSUTILS_SELECTED_LEGACY_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/public"
|
||||
RENAME net.exe)
|
||||
else()
|
||||
install(FILES "${MARS_DOSUTILS_SELECTED_LEGACY_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/public"
|
||||
RENAME "${tool}.exe")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(tool IN LISTS MARS_DOSUTILS_NEW_ONLY_TOOLS)
|
||||
install(FILES "${MARS_DOSUTILS_SELECTED_NEW_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/public"
|
||||
RENAME "${tool}.exe")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
install(FILES "${MARS_DOSUTILS_NET_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/login"
|
||||
RENAME login.exe)
|
||||
install(FILES "${MARS_DOSUTILS_SELECTED_LEGACY_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/login"
|
||||
RENAME login.exe)
|
||||
|
||||
install(FILES "${MARS_DOSUTILS_NET_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/login"
|
||||
RENAME map.exe)
|
||||
|
||||
install(FILES "${MARS_DOSUTILS_NET_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/login"
|
||||
RENAME slist.exe)
|
||||
install(FILES "${MARS_DOSUTILS_SELECTED_LEGACY_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/login"
|
||||
RENAME map.exe)
|
||||
|
||||
install(FILES "${MARS_DOSUTILS_SELECTED_LEGACY_EXE}"
|
||||
DESTINATION "${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS/login"
|
||||
RENAME slist.exe)
|
||||
endif()
|
||||
|
||||
BIN
netold.exe
Executable file
BIN
netold.exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user