From e6c4cd704fd5b0a2e124a56cddaea14d382f621c Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Tue, 1 Dec 2015 17:52:19 +1000 Subject: [PATCH] * add linking with 'ldap' library --- CMakeLists.txt | 4 ++++ src/CMakeLists.txt | 3 ++- src/ldapauth.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b5b887..711b047 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,15 @@ set(INSTALL_LIB "${CMAKE_INSTALL_PREFIX}/lib/openvpn") list(APPEND CMAKE_C_FLAGS "-Wall -Wextra -pedantic") +find_library(LIBLDAP NAMES "ldap") + message(STATUS "------------------------------------------") message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}") message(STATUS "") message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Library directory: ${INSTALL_LIB}") +message(STATUS "") +message(STATUS "ldap: ${LIBLDAP}") add_subdirectory (src) add_subdirectory (tests) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 861f3bc..fb7c7ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ -add_library("openvpn-auth-ldap" SHARED "config.c" "ldapauth.c" "main.c") +add_library("openvpn-auth-ldap" SHARED "config.c" "ldapauth.c" "plugin.c") +target_link_libraries("openvpn-auth-ldap" "ldap") install(TARGETS "openvpn-auth-ldap" LIBRARY DESTINATION "${INSTALL_LIB}") diff --git a/src/ldapauth.c b/src/ldapauth.c index 2eaaef2..7b785d1 100644 --- a/src/ldapauth.c +++ b/src/ldapauth.c @@ -4,6 +4,7 @@ #include #include +#define LDAP_DEPRECATED 1 #include #include "config.h" @@ -90,4 +91,4 @@ check_against_ldap(oal_config_t * const config, error_opts: config->error = strndup(err, bufsize); return 1; -} \ No newline at end of file +}