switch to _DEFAULT_SOURCE for modern glibc compat
[project/procd.git] / CMakeLists.txt
index fc1ad3a..98395f5 100644 (file)
@@ -10,19 +10,47 @@ IF(APPLE)
   LINK_DIRECTORIES(/opt/local/lib)
 ENDIF()
 
-SET(SOURCES main.c ubus.c service.c instance.c utils.c md5.c hotplug-rule.c hotplug.c)
+SET(SOURCES procd.c signal.c watchdog.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
+       plug/coldplug.c plug/hotplug.c utils/utils.c)
 
-find_library(json NAMES json-c json)
-SET(LIBS ubox ubus ${json} blobmsg_json)
+SET(LIBS ubox ubus json-c blobmsg_json json_script)
 
 IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
 ENDIF()
 
-ADD_EXECUTABLE(procd ${SOURCES})
+IF(ZRAM_TMPFS)
+  ADD_DEFINITIONS(-DZRAM_TMPFS)
+  SET(SOURCES_ZRAM initd/zram.c)
+ENDIF()
 
-TARGET_LINK_LIBRARIES(procd ${LIBS})
+IF(BUILD_UPGRADED)
+  add_subdirectory(upgraded)
+ENDIF()
 
+ADD_EXECUTABLE(procd ${SOURCES})
+TARGET_LINK_LIBRARIES(procd ${LIBS})
 INSTALL(TARGETS procd
        RUNTIME DESTINATION sbin
 )
+
+
+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})
+INSTALL(TARGETS init
+       RUNTIME DESTINATION sbin
+)
+
+
+ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
+INSTALL(TARGETS udevtrigger
+       RUNTIME DESTINATION sbin
+)
+
+
+ADD_EXECUTABLE(askfirst utils/askfirst.c)
+INSTALL(TARGETS askfirst
+       RUNTIME DESTINATION sbin
+)