Navigation



Ignore:
Timestamp:
Nov 27, 2009, 5:19:45 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Fix for number of args to sctp_connectx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/CMakeLists.txt

    r24 r51  
    2727INCLUDE (CheckIncludeFiles)
    2828INCLUDE (CheckSymbolExists)
     29INCLUDE (CheckCSourceCompiles)
    2930INCLUDE (TestBigEndian)
    3031
     
    5354SET(FD_LIBS ${FD_LIBS} ${CLOCK_GETTIME_LIBS})
    5455
    55 # We need the sctp_getladdrs function ( -lsctp )
     56# We need the sctp_connectx function among others
    5657# We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h
    5758IF(NOT DISABLE_SCTP)
    58         CHECK_FUNCTION_EXISTS(sctp_getladdrs HAVE_NATIVE_SCTP)
     59        CHECK_FUNCTION_EXISTS(sctp_connectx HAVE_NATIVE_SCTP)
    5960        IF(NOT HAVE_NATIVE_SCTP)
    6061                FIND_PACKAGE(SCTP REQUIRED)
     
    6263                SET(FD_LIBS ${FD_LIBS} ${SCTP_LIBRARIES})
    6364        ENDIF(NOT HAVE_NATIVE_SCTP)
     65        # Now check the number of args of this function, since it changed between Ubuntu 9.04 and 9.10
     66        SET(CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE "
     67                #include <netinet/sctp.h>;
     68                int main() {
     69                   return sctp_connectx(0, NULL, 0, NULL);
     70                }
     71                ")
     72        SET(CMAKE_REQUIRED_LIBRARIES ${SCTP_LIBRARIES})
     73        CHECK_C_SOURCE_COMPILES("${CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE}" SCTP_CONNECTX_4_ARGS)
    6474ENDIF(NOT DISABLE_SCTP)
    6575
Note: See TracChangeset for help on using the changeset viewer.