Don't compile programs using fork() on MMU-less systems

Systems that lack a MMU cannot use fork() to create the child process.
The patch does not compile the affected programs on MMU-less systems.

Co-developed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
This commit is contained in:
Dario Binacchi
2023-05-08 18:30:50 +02:00
parent e44db7366b
commit 5ed3b4ded6
6 changed files with 77 additions and 9 deletions
+12 -3
View File
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.3)
project(can-utils LANGUAGES C)
include (CheckFunctionExists)
include (CheckSymbolExists)
include (GNUInstallDirs)
@@ -25,12 +26,13 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSCM_TXTIME=SO_TXTIME")
include_directories (.)
include_directories (./include)
check_function_exists(fork HAVE_FORK)
set(PROGRAMS_CANLIB
asc2log
canbusload
candump
cangen
canlogserver
canplayer
cansend
cansequence
@@ -39,6 +41,10 @@ set(PROGRAMS_CANLIB
slcanpty
)
if(HAVE_FORK)
list(APPEND PROGRAMS_CANLIB canlogserver)
endif()
set(PROGRAMS_J1939
j1939acd
j1939cat
@@ -49,7 +55,6 @@ set(PROGRAMS_J1939
set(PROGRAMS
${PROGRAMS_CANLIB}
bcmserver
canfdtest
cangw
cansniffer
@@ -57,13 +62,17 @@ set(PROGRAMS
isotpperf
isotprecv
isotpsend
isotpserver
isotpsniffer
isotptun
slcan_attach
slcand
)
if(HAVE_FORK)
list(APPEND PROGRAMS bcmserver)
list(APPEND PROGRAMS isotpserver)
endif()
add_executable(can-calc-bit-timing
calc-bit-timing/can-calc-bit-timing.c
)