• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/procd/CMakeLists.txt

  1 cmake_minimum_required(VERSION 2.6)
  2 
  3 PROJECT(procd C)
  4 INCLUDE(GNUInstallDirs)
  5 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
  6 
  7 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  8 
  9 IF(APPLE)
 10   INCLUDE_DIRECTORIES(/opt/local/include)
 11   LINK_DIRECTORIES(/opt/local/lib)
 12 ENDIF()
 13 
 14 
 15 ADD_LIBRARY(setlbf SHARED service/setlbf.c)
 16 INSTALL(TARGETS setlbf
 17         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
 18 )
 19 
 20 
 21 SET(SOURCES procd.c signal.c state.c inittab.c rcS.c ubus.c system.c sysupgrade.c
 22         service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
 23         utils/utils.c)
 24 IF(NOT DISABLE_INIT)
 25   SET(SOURCES ${SOURCES} watchdog.c plug/coldplug.c plug/hotplug.c)
 26 ENDIF()
 27 
 28 FIND_LIBRARY(ubox NAMES ubox)
 29 FIND_LIBRARY(ubus NAMES ubus)
 30 FIND_LIBRARY(blobmsg_json NAMES blobmsg_json)
 31 FIND_LIBRARY(json_script NAMES json_script)
 32 FIND_LIBRARY(json NAMES json-c json)
 33 
 34 SET(LIBS ${ubox} ${ubus} ${json} ${blobmsg_json} ${json_script})
 35 
 36 IF(DEBUG)
 37   ADD_DEFINITIONS(-DUDEV_DEBUG -g3)
 38 ENDIF()
 39 
 40 IF(EARLY_PATH)
 41   ADD_DEFINITIONS(-DEARLY_PATH="${EARLY_PATH}")
 42 ENDIF()
 43 
 44 IF(ZRAM_TMPFS)
 45   ADD_DEFINITIONS(-DZRAM_TMPFS)
 46   SET(SOURCES_ZRAM initd/zram.c)
 47 ENDIF()
 48 
 49 add_subdirectory(upgraded)
 50 
 51 ADD_EXECUTABLE(procd ${SOURCES})
 52 TARGET_LINK_LIBRARIES(procd ${LIBS})
 53 INSTALL(TARGETS procd
 54         RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 55 )
 56 
 57 FIND_PATH(ubox_include_dir libubox/uloop.h)
 58 INCLUDE_DIRECTORIES(${ubox_include_dir})
 59 
 60 IF(DISABLE_INIT)
 61 ADD_DEFINITIONS(-DDISABLE_INIT)
 62 ELSE()
 63 ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c sysupgrade.c watchdog.c
 64         utils/utils.c ${SOURCES_ZRAM})
 65 TARGET_LINK_LIBRARIES(init ${LIBS})
 66 INSTALL(TARGETS init
 67         RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 68 )
 69 
 70 ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
 71 INSTALL(TARGETS udevtrigger
 72         RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 73 )
 74 ENDIF()
 75 
 76 
 77 ADD_EXECUTABLE(askfirst utils/askfirst.c)
 78 INSTALL(TARGETS askfirst
 79         RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 80 )
 81 
 82 ADD_CUSTOM_COMMAND(
 83         OUTPUT syscall-names.h
 84         COMMAND ./make_syscall_h.sh ${CMAKE_C_COMPILER} > ./syscall-names.h
 85         DEPENDS ./make_syscall_h.sh
 86 )
 87 ADD_CUSTOM_TARGET(syscall-names-h DEPENDS syscall-names.h)
 88 
 89 ADD_CUSTOM_COMMAND(
 90         OUTPUT capabilities-names.h
 91         COMMAND ./make_capabilities_h.sh ${CMAKE_C_COMPILER} > ./capabilities-names.h
 92         DEPENDS ./make_capabilities_h.sh
 93 )
 94 ADD_CUSTOM_TARGET(capabilities-names-h DEPENDS capabilities-names.h)
 95 
 96 IF(SECCOMP_SUPPORT)
 97 ADD_DEFINITIONS(-DSECCOMP_SUPPORT)
 98 ADD_LIBRARY(preload-seccomp SHARED jail/preload.c jail/seccomp.c)
 99 TARGET_LINK_LIBRARIES(preload-seccomp dl ${ubox} ${blobmsg_json})
100 INSTALL(TARGETS preload-seccomp
101         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
102 )
103 ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
104 endif()
105 
106 IF(JAIL_SUPPORT)
107 ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/fs.c jail/capabilities.c)
108 TARGET_LINK_LIBRARIES(ujail ${ubox} ${ubus} ${blobmsg_json})
109 INSTALL(TARGETS ujail
110         RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
111 )
112 ADD_DEPENDENCIES(ujail capabilities-names-h)
113 endif()
114 
115 IF(UTRACE_SUPPORT)
116 ADD_EXECUTABLE(utrace trace/trace.c)
117 TARGET_LINK_LIBRARIES(utrace ${ubox} ${json} ${blobmsg_json})
118 INSTALL(TARGETS utrace
119         RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
120 )
121 ADD_DEPENDENCIES(utrace syscall-names-h)
122 
123 ADD_LIBRARY(preload-trace SHARED trace/preload.c)
124 TARGET_LINK_LIBRARIES(preload-trace dl)
125 INSTALL(TARGETS preload-trace
126         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
127 )
128 endif()

This page was automatically generated by LXR 0.3.1.  •  OpenWrt