Mercurial > hg > freeDiameter
annotate include/freeDiameter/CMakeLists.txt @ 51:08d8cbeff30b
Fix for number of args to sctp_connectx
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 27 Nov 2009 17:19:45 +0900 |
parents | bd83ce9328ed |
children | 6db078b955e3 |
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 |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
3 Project("freeDiameter include directory" C) |
0 | 4 |
5 ######################## | |
6 # Configurable parameters | |
7 | |
8 # Name of the default configuration file | |
9 OPTION(DEFAULT_CONF_FILE "Default path to configuration file?" OFF) | |
10 | |
11 # Disable SCTP support completly ? | |
23
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
12 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
|
13 IF (NOT DISABLE_SCTP) |
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
14 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
|
15 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
|
16 ENDIF (NOT DISABLE_SCTP) |
0 | 17 |
17
ab3c58d88be3
Added proper gcrypt initializer
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
13
diff
changeset
|
18 # Find TODO items in the code easily ? |
13
ef9ef3bf4752
Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
19 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
|
20 |
0 | 21 |
22 ######################## | |
23 # System checks | |
24 | |
25 INCLUDE (CheckLibraryExists) | |
26 INCLUDE (CheckFunctionExists) | |
27 INCLUDE (CheckIncludeFiles) | |
28 INCLUDE (CheckSymbolExists) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
29 INCLUDE (CheckCSourceCompiles) |
0 | 30 INCLUDE (TestBigEndian) |
31 | |
32 # We use dlopen and dlclose | |
33 SET(FD_LIBS ${FD_LIBS} ${CMAKE_DL_LIBS}) | |
34 | |
35 # We need the threads library (pthread) | |
36 INCLUDE(FindThreads) | |
37 SET(FD_LIBS ${FD_LIBS} ${CMAKE_THREAD_LIBS_INIT}) | |
38 | |
39 # We need the clock_gettime function ( -lrt, -lposix4 ) | |
40 CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME) | |
41 IF (HAVE_CLOCK_GETTIME) | |
42 SET(CLOCK_GETTIME_LIBS "") | |
43 ELSE (HAVE_CLOCK_GETTIME) | |
44 CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT) | |
45 IF (HAVE_LIBRT) | |
46 SET(CLOCK_GETTIME_LIBS "-lrt") | |
47 ELSE (HAVE_LIBRT) | |
48 CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" HAVE_LIBPOSIX4) | |
49 IF (HAVE_LIBPOSIX4) | |
50 SET(CLOCK_GETTIME_LIBS "-lposix4") | |
51 ENDIF (HAVE_LIBPOSIX4) | |
52 ENDIF (HAVE_LIBRT) | |
53 ENDIF (HAVE_CLOCK_GETTIME) | |
54 SET(FD_LIBS ${FD_LIBS} ${CLOCK_GETTIME_LIBS}) | |
55 | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
56 # We need the sctp_connectx function among others |
0 | 57 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h |
58 IF(NOT DISABLE_SCTP) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
59 CHECK_FUNCTION_EXISTS(sctp_connectx HAVE_NATIVE_SCTP) |
0 | 60 IF(NOT HAVE_NATIVE_SCTP) |
61 FIND_PACKAGE(SCTP REQUIRED) | |
62 INCLUDE_DIRECTORIES(${SCTP_INCLUDE_DIRS}) | |
63 SET(FD_LIBS ${FD_LIBS} ${SCTP_LIBRARIES}) | |
64 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
|
65 # 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
|
66 SET(CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE " |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
67 #include <netinet/sctp.h>; |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
68 int main() { |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
69 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
|
70 } |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
71 ") |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
72 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
|
73 CHECK_C_SOURCE_COMPILES("${CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE}" SCTP_CONNECTX_4_ARGS) |
0 | 74 ENDIF(NOT DISABLE_SCTP) |
75 | |
76 # Check byte ordering | |
77 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN) | |
78 | |
79 # We need the getopt_long function | |
80 CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS) | |
81 IF (NOT HAVE_LONG_OPTIONS) | |
82 MESSAGE(SEND_ERROR "The getopt_long function is not found, please add needed library in build system") | |
83 ENDIF (NOT HAVE_LONG_OPTIONS) | |
84 | |
85 # Check if ntohll is provided on the system | |
86 CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL) | |
87 | |
88 # malloc.h ? | |
89 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) | |
90 | |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
91 # signalent.h ? -- found in strace distrib; just for nice signal names... |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
92 CHECK_INCLUDE_FILES (signalent.h HAVE_SIGNALENT_H) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
93 |
0 | 94 # The default configuration file name |
95 IF (NOT DEFAULT_CONF_FILE) | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
96 SET(DEFAULT_CONF_FILE "freeDiameter.conf") |
0 | 97 ENDIF (NOT DEFAULT_CONF_FILE) |
98 ########################## | |
99 | |
100 # Generate the host.h file | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
101 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h) |
0 | 102 |
103 # Save the FD_LIBS for parent scope | |
104 SET(FD_LIBS ${FD_LIBS} PARENT_SCOPE) |