Mercurial > hg > freeDiameter
annotate include/freeDiameter/CMakeLists.txt @ 1561:699c3fb0c57b
Switch from libidn to libidn2.
libidn2 is the backwards compatible successor to libidn,
and at least Red Hat 8 does not provide a dev package for libidn1.
author | Thomas Klausner <wiz@gatalith.at> |
---|---|
date | Wed, 16 Jun 2021 18:44:45 +0200 |
parents | deaa89f4a994 |
children |
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 |
1561
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
5 INCLUDE(FindPkgConfig) |
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
6 |
0 | 7 ######################## |
8 # Configurable parameters | |
9 | |
871 | 10 # Disable SCTP support completely ? |
23
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
11 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
|
12 IF (NOT DISABLE_SCTP) |
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
13 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
|
14 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
|
15 ENDIF (NOT DISABLE_SCTP) |
0 | 16 |
17
ab3c58d88be3
Added proper gcrypt initializer
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
13
diff
changeset
|
17 # Find TODO items in the code easily ? |
13
ef9ef3bf4752
Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
18 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
|
19 |
1406
deaa89f4a994
add ERRORS_ON_WARNINGS to enable fatal compiler warnings
Luke Mewburn <luke@mewburn.net>
parents:
1333
diff
changeset
|
20 # Compiler warnings are fatal? |
deaa89f4a994
add ERRORS_ON_WARNINGS to enable fatal compiler warnings
Luke Mewburn <luke@mewburn.net>
parents:
1333
diff
changeset
|
21 OPTION(ERRORS_ON_WARNINGS "(development) Compiler warnings cause compilation errors ?" OFF) |
deaa89f4a994
add ERRORS_ON_WARNINGS to enable fatal compiler warnings
Luke Mewburn <luke@mewburn.net>
parents:
1333
diff
changeset
|
22 |
1295
a22d9e907d48
Make the stripped output the default. Define DEBUG_WITH_META to get longer format.
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1289
diff
changeset
|
23 # In DEBUG mode, each log can contain pid, calling function and file for easy debug. Set to ON to display this information. |
a22d9e907d48
Make the stripped output the default. Define DEBUG_WITH_META to get longer format.
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1289
diff
changeset
|
24 OPTION(DEBUG_WITH_META "Show calling location in logs?" OFF) |
1333 | 25 |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
26 # Create the absolute path for searching extensions |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
27 SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX}) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
28 |
707
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
29 # IDNA considerations |
871 | 30 OPTION(DIAMID_IDNA_IGNORE "Ignore completely invalid characters in Diameter Identities (process blindly)?" OFF) |
707
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
31 IF (NOT DIAMID_IDNA_IGNORE) |
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
32 OPTION (DIAMID_IDNA_REJECT "Reject internationalized Diameter Identities, do not attempt to convert it (stringprep) ?" OFF) |
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
33 ENDIF (NOT DIAMID_IDNA_IGNORE) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
34 |
933
04f590da5821
Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism
Sebastien Decugis <sdecugis@freediameter.net>
parents:
871
diff
changeset
|
35 # Disable expiration of connections with dynamically connected peers as per RFC 3539 ? (default is enabled) |
04f590da5821
Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism
Sebastien Decugis <sdecugis@freediameter.net>
parents:
871
diff
changeset
|
36 # Note: if someone needs, we could also make the delay configurable here... |
04f590da5821
Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism
Sebastien Decugis <sdecugis@freediameter.net>
parents:
871
diff
changeset
|
37 OPTION(DISABLE_PEER_EXPIRY "Disable RFC3539 Peers Connections Expiration after inactivity?" OFF) |
04f590da5821
Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism
Sebastien Decugis <sdecugis@freediameter.net>
parents:
871
diff
changeset
|
38 |
1333 | 39 # The following workaround increases compatibility with some implementations without breaking anything in freeDiameter, |
40 # so it can be enabled without risk. We keep it disabled by default anyway for those people who use freeDiameter to check the | |
935
6072619402a3
New CMake option WORKAROUND_ACCEPT_INVALID_VSAI for those invalids Vendor-Specific-Application-Id out there
Sebastien Decugis <sdecugis@freediameter.net>
parents:
933
diff
changeset
|
41 # compliancy of their implementation with the Diameter RFC... |
6072619402a3
New CMake option WORKAROUND_ACCEPT_INVALID_VSAI for those invalids Vendor-Specific-Application-Id out there
Sebastien Decugis <sdecugis@freediameter.net>
parents:
933
diff
changeset
|
42 OPTION(WORKAROUND_ACCEPT_INVALID_VSAI "Do not reject a CER/CEA with a Vendor-Specific-Application-Id AVP containing both Auth- and Acct- application AVPs?" OFF) |
933
04f590da5821
Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism
Sebastien Decugis <sdecugis@freediameter.net>
parents:
871
diff
changeset
|
43 |
1295
a22d9e907d48
Make the stripped output the default. Define DEBUG_WITH_META to get longer format.
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1289
diff
changeset
|
44 MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO DEBUG_WITH_META DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT DISABLE_PEER_EXPIRY WORKAROUND_ACCEPT_INVALID_VSAI) |
0 | 45 |
46 ######################## | |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
47 ### System checks part |
0 | 48 |
49 INCLUDE (CheckLibraryExists) | |
50 INCLUDE (CheckFunctionExists) | |
51 INCLUDE (CheckIncludeFiles) | |
1333 | 52 INCLUDE (CheckSymbolExists) |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
53 INCLUDE (CheckCSourceCompiles) |
0 | 54 INCLUDE (TestBigEndian) |
55 | |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
56 |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
57 ### System checks -- mandatory support |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
58 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
59 # We need the getopt_long function |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
60 CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
61 IF (NOT HAVE_LONG_OPTIONS) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
62 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
|
63 ENDIF (NOT HAVE_LONG_OPTIONS) |
0 | 64 |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
65 # getifaddrs ? |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
66 CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
67 IF (NOT HAVE_GETIFADDRS) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
68 MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.") |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
69 ENDIF (NOT HAVE_GETIFADDRS) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
70 |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
71 |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
72 ### System checks -- for freeDiameter-host.h |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
73 |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
74 # Check byte ordering |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
75 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
76 |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
77 # Check if ntohll is provided on the system |
1289
0aeb09ef20f1
fix ntohll on MacOSX
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1237
diff
changeset
|
78 CHECK_SYMBOL_EXISTS(ntohll netinet/in.h HAVE_NTOHLL) |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
79 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
80 # malloc.h ? |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
81 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
82 |
849
d7f940afd933
New portability function: strndup
Sebastien Decugis <sdecugis@freediameter.net>
parents:
836
diff
changeset
|
83 # strndup ? Missing on OS X |
d7f940afd933
New portability function: strndup
Sebastien Decugis <sdecugis@freediameter.net>
parents:
836
diff
changeset
|
84 CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP) |
d7f940afd933
New portability function: strndup
Sebastien Decugis <sdecugis@freediameter.net>
parents:
836
diff
changeset
|
85 |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
86 |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
87 ### System checks -- for includes / link |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
88 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
89 # pthreads |
0 | 90 INCLUDE(FindThreads) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
91 SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE) |
0 | 92 |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
93 # clock_gettime |
836
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
94 SET(HAVE_CLOCK_GETTIME "") |
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
95 CHECK_FUNCTION_EXISTS (clock_gettime HAVE_NATIVE_CLOCK_GETTIME) |
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
96 IF (HAVE_NATIVE_CLOCK_GETTIME) |
0 | 97 SET(CLOCK_GETTIME_LIBS "") |
836
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
98 SET(HAVE_CLOCK_GETTIME 1) |
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
99 ELSE (HAVE_NATIVE_CLOCK_GETTIME) |
0 | 100 CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT) |
101 IF (HAVE_LIBRT) | |
102 SET(CLOCK_GETTIME_LIBS "-lrt") | |
836
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
103 SET(HAVE_CLOCK_GETTIME 1) |
0 | 104 ELSE (HAVE_LIBRT) |
105 CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" HAVE_LIBPOSIX4) | |
106 IF (HAVE_LIBPOSIX4) | |
107 SET(CLOCK_GETTIME_LIBS "-lposix4") | |
836
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
108 SET(HAVE_CLOCK_GETTIME 1) |
0 | 109 ENDIF (HAVE_LIBPOSIX4) |
110 ENDIF (HAVE_LIBRT) | |
836
da97a5aa7976
Add replacement for clock_gettime (for Mac OS) -- ticket #38
Sebastien Decugis <sdecugis@freediameter.net>
parents:
815
diff
changeset
|
111 ENDIF (HAVE_NATIVE_CLOCK_GETTIME) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
112 SET(CLOCK_GETTIME_LIBS ${CLOCK_GETTIME_LIBS} PARENT_SCOPE) |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
113 |
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
313
diff
changeset
|
114 # dlopen and dlclose: CMAKE_DL_LIBS |
0 | 115 |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
116 # We need the sctp_connectx function among others |
0 | 117 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h |
118 IF(NOT DISABLE_SCTP) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
119 CHECK_FUNCTION_EXISTS(sctp_connectx HAVE_NATIVE_SCTP) |
0 | 120 IF(NOT HAVE_NATIVE_SCTP) |
121 FIND_PACKAGE(SCTP REQUIRED) | |
122 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
|
123 # 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
|
124 SET(CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE " |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
51
diff
changeset
|
125 #include <unistd.h> |
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
51
diff
changeset
|
126 #include <netinet/sctp.h> |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
127 int main() { |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
128 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
|
129 } |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
130 ") |
493
d68f27e7e814
Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
492
diff
changeset
|
131 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
|
132 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
|
133 CHECK_C_SOURCE_COMPILES("${CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE}" SCTP_CONNECTX_4_ARGS) |
305 | 134 ELSE (NOT DISABLE_SCTP) |
135 MESSAGE(STATUS "Disabled SCTP support.") | |
0 | 136 ENDIF(NOT DISABLE_SCTP) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
137 SET(SCTP_INCLUDE_DIR ${SCTP_INCLUDE_DIR} PARENT_SCOPE) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
138 SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE) |
0 | 139 |
1561
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
140 # IDNA process: we use GNU libidn2 |
1333 | 141 IF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT) |
1561
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
142 PKG_CHECK_MODULES(IDNA libidn2) |
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
143 IF(NOT IDNA_FOUND) |
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
144 MESSAGE(SEND_ERROR "Unable to find libidn2, please install libidn2-dev or equivalent, or set DIAMID_IDNA_IGNORE or DIAMID_IDNA_REJECT") |
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
145 ENDIF() |
707
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
146 ELSE (NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT) |
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
147 MESSAGE(STATUS "Non-default Internationalized Domain Names (IDN) behavior selected (no stringprep).") |
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
148 ENDIF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT) |
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
149 |
0 | 150 |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
151 # Require GNU TLS for building the library |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
152 FIND_PACKAGE(GnuTLS REQUIRED) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
153 SET(GNUTLS_INCLUDE_DIR ${GNUTLS_INCLUDE_DIR} PARENT_SCOPE) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
154 SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES} PARENT_SCOPE) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
155 |
1333 | 156 FIND_PATH(GCRYPT_INCLUDE_DIR NAMES gcrypt.h) |
157 IF(NOT GCRYPT_INCLUDE_DIR) | |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
158 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent") |
1333 | 159 ENDIF(NOT GCRYPT_INCLUDE_DIR) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
160 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
161 SET(GCRYPT_INCLUDE_DIR ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
162 |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
163 # Also we need libgcrypt to... display its version :( |
1333 | 164 FIND_LIBRARY(GCRYPT_LIBRARY |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
165 NAMES gcrypt |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
166 ) |
1333 | 167 IF(NOT GCRYPT_LIBRARY) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
168 MESSAGE(SEND_ERROR "Unable to find libgcrypt, please install libgcrypt or equivalent") |
1333 | 169 ENDIF(NOT GCRYPT_LIBRARY) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
170 SET(GCRYPT_LIBRARY ${GCRYPT_LIBRARY} PARENT_SCOPE) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
171 |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
561
diff
changeset
|
172 |
815
958d3efb45b5
Add test for AI_ADDRCONFIG for platforms where it does not exist
Sebastien Decugis <sdecugis@freediameter.net>
parents:
707
diff
changeset
|
173 # Check if AI_ADDRCONFIG is available on the system |
958d3efb45b5
Add test for AI_ADDRCONFIG for platforms where it does not exist
Sebastien Decugis <sdecugis@freediameter.net>
parents:
707
diff
changeset
|
174 CHECK_SYMBOL_EXISTS(AI_ADDRCONFIG "netdb.h" HAVE_AI_ADDRCONFIG) |
958d3efb45b5
Add test for AI_ADDRCONFIG for platforms where it does not exist
Sebastien Decugis <sdecugis@freediameter.net>
parents:
707
diff
changeset
|
175 |
958d3efb45b5
Add test for AI_ADDRCONFIG for platforms where it does not exist
Sebastien Decugis <sdecugis@freediameter.net>
parents:
707
diff
changeset
|
176 |
853
16428c4ecb22
Remove testfifo if pthread_barriers are not available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
849
diff
changeset
|
177 # Check if barriers are available (for test_fifo) |
16428c4ecb22
Remove testfifo if pthread_barriers are not available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
849
diff
changeset
|
178 SET(CMAKE_REQUIRED_INCLUDES "pthread.h") |
16428c4ecb22
Remove testfifo if pthread_barriers are not available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
849
diff
changeset
|
179 SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) |
16428c4ecb22
Remove testfifo if pthread_barriers are not available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
849
diff
changeset
|
180 CHECK_FUNCTION_EXISTS (pthread_barrier_wait HAVE_PTHREAD_BAR) |
16428c4ecb22
Remove testfifo if pthread_barriers are not available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
849
diff
changeset
|
181 SET(HAVE_PTHREAD_BAR ${HAVE_PTHREAD_BAR} PARENT_SCOPE) |
16428c4ecb22
Remove testfifo if pthread_barriers are not available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
849
diff
changeset
|
182 |
815
958d3efb45b5
Add test for AI_ADDRCONFIG for platforms where it does not exist
Sebastien Decugis <sdecugis@freediameter.net>
parents:
707
diff
changeset
|
183 |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
184 ########################## |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
185 |
1159
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
186 # Additional hg version when relevant, stored in version.h |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
187 if (EXISTS "${CMAKE_SOURCE_DIR}/.hg") |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
188 # Search for hg binary to use |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
189 FIND_PROGRAM(HGCOMMAND hg) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
190 if (HGCOMMAND) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
191 # Ok, add the custom target so that hg is executed at every build |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
192 ADD_CUSTOM_TARGET(version_information |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
193 COMMAND ${CMAKE_COMMAND} -D HGCOMMAND="${HGCOMMAND}" -D SRC="${CMAKE_CURRENT_SOURCE_DIR}/version.h.in" -D DST="${CMAKE_CURRENT_BINARY_DIR}/version.h" -P "${CMAKE_SOURCE_DIR}/cmake/Modules/GetVersionWithHg.cmake" |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
194 DEPENDS "${CMAKE_SOURCE_DIR}/.hg/dirstate" |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
195 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
196 COMMENT "Retrieving version of the hg repository" |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
197 ) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
198 else (HGCOMMAND) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
199 # Display at least "unknown" rev in this case |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
200 SET(FD_PROJECT_VERSION_HG "unknown") |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
201 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
202 ADD_CUSTOM_TARGET(version_information DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
203 endif(HGCOMMAND) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
204 else (EXISTS "${CMAKE_SOURCE_DIR}/.hg") |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
205 # We use the pure version number without extension |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
206 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
207 ADD_CUSTOM_TARGET(version_information DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h) |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
208 endif (EXISTS "${CMAKE_SOURCE_DIR}/.hg") |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
209 |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
210 |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
211 ########################## |
05f74dc19c49
Include source rev number in version information when available
Sebastien Decugis <sdecugis@freediameter.net>
parents:
1136
diff
changeset
|
212 |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
213 # LFDPROTO_LIBS = libraries required by the libfdproto. |
1561
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
214 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LINK_LIBRARIES} PARENT_SCOPE) |
707
e387d5c6b6f5
Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
677
diff
changeset
|
215 # And includes paths |
1561
699c3fb0c57b
Switch from libidn to libidn2.
Thomas Klausner <wiz@gatalith.at>
parents:
1406
diff
changeset
|
216 SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIRS} PARENT_SCOPE) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
217 # Dependencies: the libraries required by any code linking to libfdproto. |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
218 SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE) |
0 | 219 |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
220 # LFDCORE_LIBS = libraries required by the libfdcore (in addition to libfdproto and its dependencies) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
221 SET(LFDCORE_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} PARENT_SCOPE) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
222 # And includes paths |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
223 SET(LFDCORE_INCLUDES ${SCTP_INCLUDE_DIR} ${GNUTLS_INCLUDE_DIR} ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE) |
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
666
diff
changeset
|
224 # And dependencies |
1333 | 225 SET(LFDCORE_LINK_INTERFACES "" PARENT_SCOPE) |
677
fdce8d4575b7
Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
668
diff
changeset
|
226 # We don't force other libraries, the programs will link with what it needs |
fdce8d4575b7
Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
668
diff
changeset
|
227 # (such as libgnutls if it uses GNUTLS_DEBUG() macro |
fdce8d4575b7
Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
668
diff
changeset
|
228 # or libfdproto if it uses some of its interfaces directly) |
fdce8d4575b7
Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
668
diff
changeset
|
229 # See freeDiameterd/CMakeLists.txt for an example. |
305 | 230 |
231 ########################## | |
0 | 232 |
233 # Generate the host.h file | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
234 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h) |
0 | 235 |
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
|
236 #### |
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
|
237 ## 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
|
238 |
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
|
239 # 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
|
240 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
|
241 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
|
242 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
|
243 |