Changeset 1159:05f74dc19c49 in freeDiameter
- Timestamp:
- May 31, 2013, 12:20:27 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameterd/main.c
r1134 r1159 111 111 static void main_version_core(void) 112 112 { 113 printf("%s, version %d.%d.%d" 114 #ifdef HG_VERSION 115 " (r%s" 116 # ifdef PACKAGE_HG_REVISION 117 "/%s" 118 # endif /* PACKAGE_HG_VERSION */ 119 ")" 120 #endif /* HG_VERSION */ 121 " (libfdcore: %s)\n", 122 FD_PROJECT_NAME, FD_PROJECT_VERSION_MAJOR, FD_PROJECT_VERSION_MINOR, FD_PROJECT_VERSION_REV 123 #ifdef HG_VERSION 124 , HG_VERSION 125 # ifdef PACKAGE_HG_REVISION 126 , PACKAGE_HG_REVISION 127 # endif /* PACKAGE_HG_VERSION */ 128 #endif /* HG_VERSION */ 129 , fd_core_version()); 113 printf("%s, version %s\n", FD_PROJECT_NAME, fd_core_version); 130 114 } 131 115 -
include/freeDiameter/CMakeLists.txt
r1136 r1159 187 187 ########################## 188 188 189 # Additional hg version when relevant, stored in version.h 190 if (EXISTS "${CMAKE_SOURCE_DIR}/.hg") 191 # Search for hg binary to use 192 FIND_PROGRAM(HGCOMMAND hg) 193 if (HGCOMMAND) 194 # Ok, add the custom target so that hg is executed at every build 195 ADD_CUSTOM_TARGET(version_information 196 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" 197 DEPENDS "${CMAKE_SOURCE_DIR}/.hg/dirstate" 198 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 199 COMMENT "Retrieving version of the hg repository" 200 ) 201 else (HGCOMMAND) 202 # Display at least "unknown" rev in this case 203 SET(FD_PROJECT_VERSION_HG "unknown") 204 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) 205 ADD_CUSTOM_TARGET(version_information DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h) 206 endif(HGCOMMAND) 207 else (EXISTS "${CMAKE_SOURCE_DIR}/.hg") 208 # We use the pure version number without extension 209 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) 210 ADD_CUSTOM_TARGET(version_information DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h) 211 endif (EXISTS "${CMAKE_SOURCE_DIR}/.hg") 212 213 214 ########################## 215 189 216 # LFDPROTO_LIBS = libraries required by the libfdproto. 190 217 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LIBRARIES} PARENT_SCOPE) -
include/freeDiameter/libfdcore.h
r1155 r1159 61 61 CHECK_PRELUDE(__call__); \ 62 62 if (__ret__ < 0) { \ 63 __ret__ = errno; \ 64 LOG(faillevel, "ERROR: in '%s' :\t%s", #__call__ , gnutls_strerror(__ret__)); \ 63 LOG(faillevel, "TLS ERROR: in '%s' :\t%s", #__call__ , gnutls_strerror(__ret__)); \ 65 64 __fallback__; \ 66 65 } \ … … 76 75 #ifndef EXCLUDE_DEPRECATED 77 76 /* Macro for transition, replace with CHECK_GNUTLS_GEN */ 78 #define CHECK_GNUTLS_DO( __call__, __fallback__ ) { \ 79 CHECK_PRELUDE(__call__); \ 80 if (__ret__ < 0) { \ 81 __ret__ = errno; \ 82 TRACE_ERROR("ERROR: in '%s' :\t%s", #__call__ , gnutls_strerror(__ret__)); \ 83 __fallback__; \ 84 } \ 85 } 77 #define CHECK_GNUTLS_DO( __call__, __fallback__ ) \ 78 CHECK_GNUTLS_GEN( FD_LOG_ERROR, __call__, __fallback__ ) 86 79 87 80 #endif /* EXCLUDE_DEPRECATED */ … … 96 89 int fd_core_initialize(void); 97 90 98 /* Return astring describing the version of the library */99 const char *fd_core_version(void);91 /* A string describing the version of the library */ 92 extern const char fd_core_version[]; 100 93 101 94 /* Parse the freeDiameter.conf configuration file, load the extensions */ -
include/freeDiameter/libfdproto.h
r1134 r1159 123 123 void fd_libproto_fini(void); 124 124 125 /* Retrieve the version of the binary */ 126 extern const char fd_libproto_version[]; 125 127 126 128 /*============================================================*/ -
libfdcore/CMakeLists.txt
r1077 r1159 35 35 server.c 36 36 tcp.c 37 version.c 37 38 ) 38 39 … … 53 54 # Include path 54 55 INCLUDE_DIRECTORIES(${LFDCORE_INCLUDES}) 56 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 55 57 56 58 # Build the executable 57 59 ADD_LIBRARY(libfdcore SHARED ${FDCORE_SRC} ${FDCORE_GEN_SRC}) 60 ADD_DEPENDENCIES(libfdcore version_information) 58 61 59 62 # Avoid the liblib name, and set the version -
libfdcore/core.c
r1142 r1159 166 166 /* Public interfaces */ 167 167 168 /* Return a string describing the version of the library */169 const char *fd_core_version(void)170 {171 return _stringize(FD_PROJECT_VERSION_MAJOR) "." _stringize(FD_PROJECT_VERSION_MINOR) "." _stringize(FD_PROJECT_VERSION_REV);172 }173 174 168 /* Initialize the libfdcore internals. This also initializes libfdproto */ 175 169 int fd_core_initialize(void) … … 189 183 } 190 184 191 LOG_N("libfdproto initialized.");192 193 185 /* Name this thread */ 194 186 fd_log_threadname("Main"); 187 188 LOG_N("libfdproto '%s' initialized.", fd_libproto_version); 195 189 196 190 /* Initialize gcrypt and gnutls */ … … 227 221 core_state_set(CORE_LIBS_INIT); 228 222 223 LOG_N("libfdcore '%s' initialized.", fd_core_version); 224 225 229 226 /* Next thing is to parse the config, leave this for a different function */ 230 227 return 0; -
libfdproto/CMakeLists.txt
r1080 r1159 1 1 # Name of the subproject 2 2 Project("libfdproto" C) 3 3 4 4 5 # List of source files for the library … … 18 19 sessions.c 19 20 utils.c 21 version.c 20 22 ) 23 21 24 22 25 # Save the list of files for testcases in the core's directory … … 28 31 # Build as a shared library 29 32 ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC}) 33 34 ADD_DEPENDENCIES(libfdproto version_information) 30 35 31 36 # Avoid the liblib name, and set the version
Note: See TracChangeset
for help on using the changeset viewer.