build: Enable BSD support
This commit is contained in:
committed by
Gabriel Ferreira
parent
e1725c351b
commit
3c4019304a
@@ -126,6 +126,8 @@ function(write_lock)
|
||||
set(lock_filename .lock-ns3_darwin_build)
|
||||
elseif(WIN32)
|
||||
set(lock_filename .lock-ns3_win32_build)
|
||||
elseif(BSD)
|
||||
set(lock_filename .lock-ns3_bsd_build)
|
||||
else()
|
||||
message(FATAL_ERROR "Platform not supported")
|
||||
endif()
|
||||
|
||||
@@ -30,7 +30,11 @@ endif()
|
||||
|
||||
# Set Linux flag if on Linux
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(LINUX TRUE)
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
set(LINUX TRUE)
|
||||
else()
|
||||
set(BSD TRUE)
|
||||
endif()
|
||||
add_definitions(-D__LINUX__)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1159,7 +1159,11 @@ macro(process_options)
|
||||
set(PLATFORM_UNSUPPORTED_POST "features. Continuing without them.")
|
||||
# Remove from libs_to_build all incompatible libraries or the ones that
|
||||
# dependencies couldn't be installed
|
||||
if(APPLE OR WSLv1 OR WIN32)
|
||||
if(APPLE
|
||||
OR WSLv1
|
||||
OR WIN32
|
||||
OR BSD
|
||||
)
|
||||
set(ENABLE_TAP OFF)
|
||||
set(ENABLE_EMU OFF)
|
||||
set(ENABLE_FDNETDEV FALSE)
|
||||
|
||||
4
ns3
4
ns3
@@ -13,7 +13,9 @@ import sys
|
||||
ns3_path = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
|
||||
append_to_ns3_path = functools.partial(os.path.join, ns3_path)
|
||||
out_dir = os.sep.join([ns3_path, "build"])
|
||||
lock_file = os.sep.join([ns3_path, ".lock-ns3_%s_build" % sys.platform])
|
||||
platform = sys.platform
|
||||
platform = "bsd" if "bsd" in platform else platform
|
||||
lock_file = os.sep.join([ns3_path, ".lock-ns3_%s_build" % platform])
|
||||
|
||||
max_cpu_threads = max(1, os.cpu_count() - 1)
|
||||
print_buffer = ""
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <WS2tcpip.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
namespace ns3
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <WS2tcpip.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
namespace ns3
|
||||
|
||||
8
test.py
8
test.py
@@ -664,9 +664,12 @@ def sigint_hook(signal, frame):
|
||||
# little less hacky, we should add a command to ns3 to return this info
|
||||
# and use that result.
|
||||
#
|
||||
def read_ns3_config():
|
||||
lock_filename = ".lock-ns3_%s_build" % sys.platform
|
||||
platform = sys.platform
|
||||
platform = "bsd" if "bsd" in platform else platform
|
||||
lock_filename = ".lock-ns3_%s_build" % platform
|
||||
|
||||
|
||||
def read_ns3_config():
|
||||
try:
|
||||
# sys.platform reports linux2 for python2 and linux for python3
|
||||
with open(lock_filename, "rt", encoding="utf-8") as f:
|
||||
@@ -1260,7 +1263,6 @@ def run_tests():
|
||||
#
|
||||
# Get the information from the build status file.
|
||||
#
|
||||
lock_filename = ".lock-ns3_%s_build" % sys.platform
|
||||
if os.path.exists(lock_filename):
|
||||
ns3_runnable_programs = get_list_from_file(lock_filename, "ns3_runnable_programs")
|
||||
ns3_runnable_scripts = get_list_from_file(lock_filename, "ns3_runnable_scripts")
|
||||
|
||||
Reference in New Issue
Block a user