From: Felix Fietkau Date: Sun, 13 Jan 2013 09:17:31 +0000 (+0100) Subject: add check for shadow support, turn -Os back on X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=commitdiff_plain;h=b0ac713bef656102c722ab472753c17aa15fcf93 add check for shadow support, turn -Os back on --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d7712e4..c495bec 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(-O0 -Wall -Werror -Wmissing-declarations --std=gnu99 -g3) +ADD_DEFINITIONS(-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}) diff --git a/auth.c b/auth.c index 301e938..d6964f4 100644 --- a/auth.c +++ b/auth.c @@ -20,6 +20,9 @@ #define _GNU_SOURCE #define _XOPEN_SOURCE 700 #include +#ifdef HAVE_SHADOW +#include +#endif #include "uhttpd.h" static LIST_HEAD(auth_realms);