Navigation


Changeset 304:ad3c46016584 in freeDiameter for include


Ignore:
Timestamp:
May 14, 2010, 5:26:53 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added install directives for cmake; also allow default directory to seek for extensions and configuration files

Location:
include/freeDiameter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/CMakeLists.txt

    r236 r304  
    66# Configurable parameters
    77
    8 # Name of the default configuration file
    9 OPTION(DEFAULT_CONF_FILE "Default path to configuration file?" OFF)
     8# The default directory for configuration files
     9SET(DEFAULT_CONF_PATH ${CMAKE_INSTALL_PREFIX}/etc/freeDiameter CACHE PATH "Default location of freeDiameter configuration files")
     10
     11# The default directory for extension files
     12SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/lib/fdx CACHE PATH "Default location of freeDiameter extensions")
    1013
    1114# Disable SCTP support completly ?
     
    1417        OPTION(DEBUG_SCTP "Verbose SCTP (for debug)?" OFF)
    1518        OPTION(SCTP_USE_MAPPED_ADDRESSES "Use v6-mapped v4 addresses in SCTP (workaround some SCTP limitations)?" OFF)
     19ELSE (NOT DISABLE_SCTP)
     20        MESSAGE(STATUS "Disabled SCTP support.")
    1621ENDIF (NOT DISABLE_SCTP)
    1722
     
    1924OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF)
    2025
     26MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO)
    2127
    2228########################
     
    9096CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
    9197
    92 # The default configuration file name
    93 IF (NOT DEFAULT_CONF_FILE)
    94    SET(DEFAULT_CONF_FILE "freeDiameter.conf")
    95 ENDIF (NOT DEFAULT_CONF_FILE)
    9698##########################
    9799
     
    99101CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h)
    100102
    101 # Save the FD_LIBS for parent scope
     103# Save some variables for the other directories
    102104SET(FD_LIBS ${FD_LIBS} PARENT_SCOPE)
     105SET(DEFAULT_CONF_PATH ${DEFAULT_CONF_PATH} PARENT_SCOPE)
     106SET(DEFAULT_EXTENSIONS_PATH ${DEFAULT_EXTENSIONS_PATH} PARENT_SCOPE)
     107
     108
     109####
     110## INSTALL section ##
     111
     112# The headers from this directory are required to develop new extensions for freeDiameter.
     113INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libfreeDiameter.h freeDiameter.h extension.h
     114        DESTINATION include/freeDiameter
     115        COMPONENT freeDiameter-dev)
     116
  • include/freeDiameter/freeDiameter-host.h.in

    r51 r304  
    7070#cmakedefine FD_PROJECT_COPYRIGHT "@FD_PROJECT_COPYRIGHT@"
    7171
    72 #cmakedefine DEFAULT_CONF_FILE "@DEFAULT_CONF_FILE@"
    73 
     72#cmakedefine DEFAULT_CONF_PATH "@DEFAULT_CONF_PATH@"
     73#cmakedefine DEFAULT_EXTENSIONS_PATH "@DEFAULT_EXTENSIONS_PATH@"
    7474
    7575#endif /* FD_IS_CONFIG */
  • include/freeDiameter/libfreeDiameter.h

    r302 r304  
    224224}
    225225#else /* DEBUG */
    226 /* Do not print thread, function, ... only the message itself in this case. */
    227 #define TRACE_DEBUG(level,format,args... ) {            \
    228         if ( TRACE_BOOL(level) ) {                      \
    229                 fd_log_debug(format "\n", ## args);     \
    230         }                                               \
     226/* Do not print thread, function, ... only the message itself in this case, unless the debug level is set > FULL. */
     227#define TRACE_DEBUG(level,format,args... ) {                                                                                            \
     228        if ( TRACE_BOOL(level) ) {                                                                                                      \
     229                if (fd_g_debug_lvl > FULL) {                                                                                            \
     230                        char __buf[25];                                                                                                 \
     231                        char * __thn = ((char *)pthread_getspecific(fd_log_thname) ?: "unnamed");                                       \
     232                        fd_log_debug("\t | tid:%-20s\t%s\tin %s@%s:%d\n"                                                                \
     233                                  "\t%s|%*s" format "\n",                                                                               \
     234                                                __thn, fd_log_time(NULL, __buf, sizeof(__buf)), __PRETTY_FUNCTION__, __FILE__, __LINE__,\
     235                                                (level < FULL)?"@":" ",level, "", ## args);                                             \
     236                } else {                                                                                                                \
     237                        fd_log_debug(format "\n", ## args);                                                                             \
     238                }                                                                                                                       \
     239        }                                                                                                                               \
    231240}
    232241#endif /* DEBUG */
Note: See TracChangeset for help on using the changeset viewer.