trigger: rework timeout handling and command queueing
[project/procd.git] / CMakeLists.txt
index 3219240..b66fad1 100644 (file)
@@ -18,9 +18,12 @@ INSTALL(TARGETS setlbf
 )
 
 
 )
 
 
-SET(SOURCES procd.c signal.c watchdog.c state.c        inittab.c rcS.c ubus.c system.c
+SET(SOURCES procd.c signal.c state.c inittab.c rcS.c ubus.c system.c
        service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
        service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
-       plug/coldplug.c plug/hotplug.c utils/utils.c)
+       utils/utils.c)
+IF(NOT DISABLE_INIT)
+  SET(SOURCES ${SOURCES} watchdog.c plug/coldplug.c plug/hotplug.c)
+ENDIF()
 
 SET(LIBS ubox ubus json-c blobmsg_json json_script)
 
 
 SET(LIBS ubox ubus json-c blobmsg_json json_script)
 
@@ -47,7 +50,12 @@ INSTALL(TARGETS procd
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 
+FIND_PATH(ubox_include_dir libubox/uloop.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
 
 
+IF(DISABLE_INIT)
+ADD_DEFINITIONS(-DDISABLE_INIT)
+ELSE()
 ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c watchdog.c
        utils/utils.c ${SOURCES_ZRAM})
 TARGET_LINK_LIBRARIES(init ${LIBS})
 ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c watchdog.c
        utils/utils.c ${SOURCES_ZRAM})
 TARGET_LINK_LIBRARIES(init ${LIBS})
@@ -55,11 +63,11 @@ INSTALL(TARGETS init
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 
-
 ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
 INSTALL(TARGETS udevtrigger
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
 INSTALL(TARGETS udevtrigger
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
+ENDIF()
 
 
 ADD_EXECUTABLE(askfirst utils/askfirst.c)
 
 
 ADD_EXECUTABLE(askfirst utils/askfirst.c)