X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=blobdiff_plain;f=CMakeLists.txt;h=8c285dcb8c8c1471628fb2fe0288ac256d924dd3;hp=7273df6bb0b82535b4194baea4a36e9f264c2d00;hb=f91788b809d9726126e9cf4384fedbbb0c5b8a73;hpb=991c32db310dba0cd99265d5360ecdbfd0fc3e89 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7273df6..8c285dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,11 @@ cmake_minimum_required(VERSION 2.6) PROJECT(uhttpd C) + +INCLUDE (CheckFunctionExists) + SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -ADD_DEFINITIONS(-Os -Wall -Werror -Wmissing-declarations --std=gnu99 -g3) +ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -Os -Wall -Werror -Wmissing-declarations --std=gnu99 -g3) OPTION(TLS_SUPPORT "TLS support" ON) OPTION(LUA_SUPPORT "Lua support" ON) @@ -24,6 +27,11 @@ IF(TLS_SUPPORT) ADD_DEFINITIONS(-DHAVE_TLS) ENDIF() +CHECK_FUNCTION_EXISTS(getspnam HAVE_SHADOW) +IF(HAVE_SHADOW) + ADD_DEFINITIONS(-DHAVE_SHADOW) +ENDIF() + ADD_EXECUTABLE(uhttpd ${SOURCES}) TARGET_LINK_LIBRARIES(uhttpd ubox dl ${LIBS}) @@ -60,8 +68,9 @@ ENDIF() IF(UBUS_SUPPORT) SET(PLUGINS ${PLUGINS} uhttpd_ubus) ADD_DEFINITIONS(-DHAVE_UBUS) - ADD_LIBRARY(uhttpd_ubus MODULE ubus.c ubus-session.c) - TARGET_LINK_LIBRARIES(uhttpd_ubus ubus ubox blobmsg_json json) + ADD_LIBRARY(uhttpd_ubus MODULE ubus.c) + FIND_LIBRARY(libjson NAMES json-c json) + TARGET_LINK_LIBRARIES(uhttpd_ubus ubus ubox blobmsg_json ${libjson}) ENDIF() IF(PLUGINS)