Navigation


Changeset 1159:05f74dc19c49 in freeDiameter for include


Ignore:
Timestamp:
May 31, 2013, 12:20:27 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Include source rev number in version information when available

Location:
include/freeDiameter
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/CMakeLists.txt

    r1136 r1159  
    187187##########################
    188188
     189# Additional hg version when relevant, stored in version.h
     190if (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)
     207else (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)
     211endif (EXISTS "${CMAKE_SOURCE_DIR}/.hg")
     212
     213
     214##########################
     215
    189216# LFDPROTO_LIBS = libraries required by the libfdproto.
    190217SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LIBRARIES} PARENT_SCOPE)
  • include/freeDiameter/libfdcore.h

    r1155 r1159  
    6161                CHECK_PRELUDE(__call__);                                                                \
    6262                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__)); \
    6564                        __fallback__;                                                                   \
    6665                }                                                                                       \
     
    7675#ifndef EXCLUDE_DEPRECATED
    7776/* 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__  )
    8679
    8780#endif /* EXCLUDE_DEPRECATED */
     
    9689int fd_core_initialize(void);
    9790
    98 /* Return a string describing the version of the library */
    99 const char *fd_core_version(void);
     91/* A string describing the version of the library */
     92extern const char fd_core_version[];
    10093
    10194/* Parse the freeDiameter.conf configuration file, load the extensions */
  • include/freeDiameter/libfdproto.h

    r1134 r1159  
    123123void fd_libproto_fini(void);
    124124
     125/* Retrieve the version of the binary */
     126extern const char fd_libproto_version[];
    125127
    126128/*============================================================*/
Note: See TracChangeset for help on using the changeset viewer.