Mercurial > hg > freeDiameter
annotate include/freeDiameter/CMakeLists.txt @ 658:f198d16fa7f4
Initial commit for 1.1.0:
* Restructuring:
* libfreeDiameter:
- renamed folder & binary into libfdproto
- renamed libfD.h into fdproto-internal.h
- removed signals management (replaced by triggers in libfdcore)
* freeDiameter split into:
- libfdcore (most contents)
- renamed fD.h into fdcore-internal.h
- added core.c for framework init/shutdown.
- new triggers mechanism in events.c.
- freeDiameterd (main, command line parsing, signals management)
* tests:
- now in top-level directory tests.
* other changes:
- fd_dict_new now returns 0 on duplicate identical entries.
- fixes in dict_legacy_xml
- fixes in some dictionaries
- moved FD_DEFAULT_CONF_FILENAME definition to freeDiameter-host.h
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 14 Jan 2011 15:15:23 +0900 |
parents | 1cb9352359f4 |
children | 40d499a58376 |
rev | line source |
---|---|
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
1 #CMake configuration for freeDiameter include directory |
0 | 2 |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
3 Project("freeDiameter includes directory" C) |
0 | 4 |
5 ######################## | |
6 # Configurable parameters | |
7 | |
8 # Disable SCTP support completly ? | |
23
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
9 OPTION(DISABLE_SCTP "Disable SCTP support?" OFF) |
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
10 IF (NOT DISABLE_SCTP) |
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
11 OPTION(DEBUG_SCTP "Verbose SCTP (for debug)?" OFF) |
24
bd83ce9328ed
Cleanups and completed sctp code (not finished)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
23
diff
changeset
|
12 OPTION(SCTP_USE_MAPPED_ADDRESSES "Use v6-mapped v4 addresses in SCTP (workaround some SCTP limitations)?" OFF) |
23
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
13 ENDIF (NOT DISABLE_SCTP) |
0 | 14 |
17
ab3c58d88be3
Added proper gcrypt initializer
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
13
diff
changeset
|
15 # Find TODO items in the code easily ? |
13
ef9ef3bf4752
Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
16 OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF) |
ef9ef3bf4752
Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
17 |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
18 MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO) |
0 | 19 |
20 ######################## | |
21 # System checks | |
22 | |
23 INCLUDE (CheckLibraryExists) | |
24 INCLUDE (CheckFunctionExists) | |
25 INCLUDE (CheckIncludeFiles) | |
26 INCLUDE (CheckSymbolExists) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
27 INCLUDE (CheckCSourceCompiles) |
0 | 28 INCLUDE (TestBigEndian) |
29 | |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
30 # Check byte ordering |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
31 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
32 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
33 # We need the getopt_long function |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
34 CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
35 IF (NOT HAVE_LONG_OPTIONS) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
36 MESSAGE(SEND_ERROR "The getopt_long function is not found, please add needed library in build system") |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
37 ENDIF (NOT HAVE_LONG_OPTIONS) |
0 | 38 |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
39 # Check if ntohll is provided on the system |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
40 CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
41 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
42 # malloc.h ? |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
43 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
44 |
378
41e3c2a3721c
Replaced old mechanism to discover local addresses by a call to getifaddrs, lot cleaner!
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
316
diff
changeset
|
45 # getifaddrs ? |
41e3c2a3721c
Replaced old mechanism to discover local addresses by a call to getifaddrs, lot cleaner!
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
316
diff
changeset
|
46 CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS) |
41e3c2a3721c
Replaced old mechanism to discover local addresses by a call to getifaddrs, lot cleaner!
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
316
diff
changeset
|
47 IF (NOT HAVE_GETIFADDRS) |
41e3c2a3721c
Replaced old mechanism to discover local addresses by a call to getifaddrs, lot cleaner!
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
316
diff
changeset
|
48 MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.") |
41e3c2a3721c
Replaced old mechanism to discover local addresses by a call to getifaddrs, lot cleaner!
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
316
diff
changeset
|
49 ENDIF (NOT HAVE_GETIFADDRS) |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
50 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
51 # pthreads |
0 | 52 INCLUDE(FindThreads) |
53 | |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
54 # clock_gettime |
0 | 55 CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME) |
56 IF (HAVE_CLOCK_GETTIME) | |
57 SET(CLOCK_GETTIME_LIBS "") | |
58 ELSE (HAVE_CLOCK_GETTIME) | |
59 CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT) | |
60 IF (HAVE_LIBRT) | |
61 SET(CLOCK_GETTIME_LIBS "-lrt") | |
62 ELSE (HAVE_LIBRT) | |
63 CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" HAVE_LIBPOSIX4) | |
64 IF (HAVE_LIBPOSIX4) | |
65 SET(CLOCK_GETTIME_LIBS "-lposix4") | |
66 ENDIF (HAVE_LIBPOSIX4) | |
67 ENDIF (HAVE_LIBRT) | |
68 ENDIF (HAVE_CLOCK_GETTIME) | |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
69 |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
70 # LFDPROTO_LIBS = libraries required by the libfdproto. |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
71 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT}) |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
72 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
73 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
74 # dlopen and dlclose: CMAKE_DL_LIBS |
0 | 75 |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
76 # We need the sctp_connectx function among others |
0 | 77 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h |
78 IF(NOT DISABLE_SCTP) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
79 CHECK_FUNCTION_EXISTS(sctp_connectx HAVE_NATIVE_SCTP) |
0 | 80 IF(NOT HAVE_NATIVE_SCTP) |
81 FIND_PACKAGE(SCTP REQUIRED) | |
493
d68f27e7e814
Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
492
diff
changeset
|
82 INCLUDE_DIRECTORIES(${SCTP_INCLUDE_DIR}) |
0 | 83 ENDIF(NOT HAVE_NATIVE_SCTP) |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
84 # Now check the number of args of this function, since it changed between Ubuntu 9.04 and 9.10 |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
85 SET(CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE " |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
51
diff
changeset
|
86 #include <unistd.h> |
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
51
diff
changeset
|
87 #include <netinet/sctp.h> |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
88 int main() { |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
89 return sctp_connectx(0, NULL, 0, NULL); |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
90 } |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
91 ") |
493
d68f27e7e814
Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
492
diff
changeset
|
92 SET(CMAKE_REQUIRED_INCLUDES ${SCTP_INCLUDE_DIR}) |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
93 SET(CMAKE_REQUIRED_LIBRARIES ${SCTP_LIBRARIES}) |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
94 CHECK_C_SOURCE_COMPILES("${CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE}" SCTP_CONNECTX_4_ARGS) |
305 | 95 ELSE (NOT DISABLE_SCTP) |
96 MESSAGE(STATUS "Disabled SCTP support.") | |
0 | 97 ENDIF(NOT DISABLE_SCTP) |
98 | |
99 | |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
100 # Require GNU TLS for building the library |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
101 FIND_PACKAGE(GnuTLS REQUIRED) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
102 INCLUDE_DIRECTORIES(${GNUTLS_INCLUDE_DIR}) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
103 |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
104 find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
105 If ( NOT GCRYPT_INCLUDE_DIR ) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
106 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent") |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
107 Endif ( NOT GCRYPT_INCLUDE_DIR ) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
108 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
109 INCLUDE_DIRECTORIES(${GCRYPT_INCLUDE_DIR}) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
110 |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
111 # Also we need libgcrypt to... display its version :( |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
112 find_library(GCRYPT_LIBRARY |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
113 NAMES gcrypt |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
114 ) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
115 If ( NOT GCRYPT_LIBRARY ) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
116 MESSAGE(SEND_ERROR "Unable to find libgcrypt, please install libgcrypt or equivalent") |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
117 Endif ( NOT GCRYPT_LIBRARY ) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
118 |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
119 |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
120 # LFDCORE_LIBS = libraries required by the libfdcore |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
121 SET(LFDCORE_LIBS ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES}) |
0 | 122 |
123 ########################## | |
313
6fd1e6f56af5
Completed initial debianization
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
305
diff
changeset
|
124 # Create the absolute path for searching extensions |
6fd1e6f56af5
Completed initial debianization
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
305
diff
changeset
|
125 SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX}) |
305 | 126 |
127 ########################## | |
0 | 128 |
129 # Generate the host.h file | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
130 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h) |
0 | 131 |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
132 # Save some variables for the other directories |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
133 SET(LFDPROTO_LIBS ${LFDPROTO_LIBS} PARENT_SCOPE) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
134 SET(LFDCORE_LIBS ${LFDCORE_LIBS} PARENT_SCOPE) |
561
1cb9352359f4
More cleanups in the packaging. Also removed rgw_common.so which was quite useless
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
493
diff
changeset
|
135 SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE) |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
136 |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
137 #### |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
138 ## INSTALL section ## |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
139 |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
140 # The headers from this directory are required to develop new extensions for freeDiameter. |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
141 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libfdproto.h libfdcore.h extension.h |
313
6fd1e6f56af5
Completed initial debianization
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
305
diff
changeset
|
142 DESTINATION ${INSTALL_HEADERS_SUFFIX} |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
143 COMPONENT freeDiameter-dev) |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
236
diff
changeset
|
144 |