Commit 67509b20 authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Some more cleanups in linking

parent bb859c8e
......@@ -128,7 +128,7 @@ Description: Legacy XML dictionary files support.
Package: freediameter-radius-gateway
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version})
Suggests: freediameter-dictionary-rfc4072 (= ${binary:Version}), freediameter-dictionary-rfc4740 (= ${binary:Version})
Description: RADIUS/Diameter extensible gateway.
This freeDiameter extension implements a RADIUS to Diameter
......@@ -161,7 +161,7 @@ Description: RADIUS/Diameter extensible gateway.
Package: freediameter-accounting-server
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), libpq5
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libpq5
Suggests: freediameter-dictionary-rfc4072
Description: freeDiameter simple Accounting server.
This freeDiameter extension implements the Diameter Base
......@@ -181,7 +181,7 @@ Description: freeDiameter simple Accounting server.
Package: freediameter-eap-server
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), libmysqlclient16, freediameter-dictionary-rfc4072 (= ${binary:Version})
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libmysqlclient16, freediameter-dictionary-rfc4072 (= ${binary:Version})
Description: freeDiameter Diameter EAP server implementation.
This freeDiameter extension implements a Diameter EAP server.
It supports EAP-MD5 and EAP-TLS methods currently.
......@@ -196,7 +196,7 @@ Description: freeDiameter Diameter EAP server implementation.
Package: freediameter-sip-server
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), libmysqlclient16, freediameter-dictionary-rfc4740 (= ${binary:Version})
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libmysqlclient16, freediameter-dictionary-rfc4740 (= ${binary:Version})
Description: freeDiameter Diameter SIP server implementation.
This freeDiameter extension implements a prototype
Diameter SIP server.
......
......@@ -15,10 +15,14 @@ ENDIF (NOT DISABLE_SCTP)
# Find TODO items in the code easily ?
OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF)
# Create the absolute path for searching extensions
SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX})
MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO)
########################
# System checks
### System checks part
INCLUDE (CheckLibraryExists)
INCLUDE (CheckFunctionExists)
......@@ -27,8 +31,8 @@ INCLUDE (CheckSymbolExists)
INCLUDE (CheckCSourceCompiles)
INCLUDE (TestBigEndian)
# Check byte ordering
TEST_BIG_ENDIAN(HOST_BIG_ENDIAN)
### System checks -- mandatory support
# We need the getopt_long function
CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS)
......@@ -36,20 +40,30 @@ IF (NOT HAVE_LONG_OPTIONS)
MESSAGE(SEND_ERROR "The getopt_long function is not found, please add needed library in build system")
ENDIF (NOT HAVE_LONG_OPTIONS)
# getifaddrs ?
CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS)
IF (NOT HAVE_GETIFADDRS)
MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.")
ENDIF (NOT HAVE_GETIFADDRS)
### System checks -- for freeDiameter-host.h
# Check byte ordering
TEST_BIG_ENDIAN(HOST_BIG_ENDIAN)
# Check if ntohll is provided on the system
CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL)
# malloc.h ?
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
# getifaddrs ?
CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS)
IF (NOT HAVE_GETIFADDRS)
MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.")
ENDIF (NOT HAVE_GETIFADDRS)
### System checks -- for includes / link
# pthreads
INCLUDE(FindThreads)
SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
# clock_gettime
CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME)
......@@ -66,10 +80,7 @@ ELSE (HAVE_CLOCK_GETTIME)
ENDIF (HAVE_LIBPOSIX4)
ENDIF (HAVE_LIBRT)
ENDIF (HAVE_CLOCK_GETTIME)
# LFDPROTO_LIBS = libraries required by the libfdproto.
SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
SET(CLOCK_GETTIME_LIBS ${CLOCK_GETTIME_LIBS} PARENT_SCOPE)
# dlopen and dlclose: CMAKE_DL_LIBS
......@@ -94,16 +105,21 @@ IF(NOT DISABLE_SCTP)
ELSE (NOT DISABLE_SCTP)
MESSAGE(STATUS "Disabled SCTP support.")
ENDIF(NOT DISABLE_SCTP)
SET(SCTP_INCLUDE_DIR ${SCTP_INCLUDE_DIR} PARENT_SCOPE)
SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE)
# Require GNU TLS for building the library
FIND_PACKAGE(GnuTLS REQUIRED)
SET(GNUTLS_INCLUDE_DIR ${GNUTLS_INCLUDE_DIR} PARENT_SCOPE)
SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES} PARENT_SCOPE)
find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h)
If ( NOT GCRYPT_INCLUDE_DIR )
MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent")
Endif ( NOT GCRYPT_INCLUDE_DIR )
MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR)
SET(GCRYPT_INCLUDE_DIR ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
# Also we need libgcrypt to... display its version :(
find_library(GCRYPT_LIBRARY
......@@ -112,15 +128,23 @@ find_library(GCRYPT_LIBRARY
If ( NOT GCRYPT_LIBRARY )
MESSAGE(SEND_ERROR "Unable to find libgcrypt, please install libgcrypt or equivalent")
Endif ( NOT GCRYPT_LIBRARY )
SET(GCRYPT_LIBRARY ${GCRYPT_LIBRARY} PARENT_SCOPE)
# LFDCORE_LIBS = libraries required by the libfdcore
SET(LFDCORE_LIBS ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} PARENT_SCOPE)
SET(LFDCORE_INCLUDES ${SCTP_INCLUDE_DIR} ${GNUTLS_INCLUDE_DIR} ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
##########################
# Create the absolute path for searching extensions
SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX})
# LFDPROTO_LIBS = libraries required by the libfdproto.
SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
# Dependencies: the libraries required by any code linking to libfdproto.
SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
# LFDCORE_LIBS = libraries required by the libfdcore (in addition to libfdproto and its dependencies)
SET(LFDCORE_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} PARENT_SCOPE)
# And includes paths
SET(LFDCORE_INCLUDES ${SCTP_INCLUDE_DIR} ${GNUTLS_INCLUDE_DIR} ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
# And dependencies
SET(LFDCORE_LINK_INTERFACES "" PARENT_SCOPE) # We don't force any other library, the programs will link with what they needs
# (such as libgnutls if they use GNUTLS_DEBUG() macro)
##########################
......
......@@ -58,7 +58,8 @@ ADD_LIBRARY(libfdcore SHARED ${FDCORE_SRC} ${FDCORE_GEN_SRC})
SET_TARGET_PROPERTIES(libfdcore PROPERTIES
OUTPUT_NAME "fdcore"
SOVERSION ${FD_PROJECT_VERSION_API}
VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV})
VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV}
LINK_INTERFACE_LIBRARIES "${LFDCORE_LINK_INTERFACES}")
# The library itself needs other libraries
LINK_DIRECTORIES(${CURRENT_BINARY_DIR}/../libfdproto)
......
......@@ -25,7 +25,8 @@ ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC})
SET_TARGET_PROPERTIES(libfdproto PROPERTIES
OUTPUT_NAME "fdproto"
SOVERSION ${FD_PROJECT_VERSION_API}
VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV})
VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV}
LINK_INTERFACE_LIBRARIES "${LFDPROTO_LINK_INTERFACES}")
# The library itself needs other libraries
TARGET_LINK_LIBRARIES(libfdproto ${LFDPROTO_LIBS})
......
......@@ -89,7 +89,7 @@ ENDIF(BUILD_APP_ACCT OR ALL_EXTENSIONS)
# Compile each test
FOREACH( TEST ${TEST_LIST} )
ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h ${${TEST}_ADDITIONAL})
TARGET_LINK_LIBRARIES(${TEST} libfdproto libfdcore ${${TEST}_ADDITIONAL_LIB})
TARGET_LINK_LIBRARIES(${TEST} libfdproto libfdcore ${${TEST}_ADDITIONAL_LIB} ${CLOCK_GETTIME_LIBS})
ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST})
ENDFOREACH( TEST )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment