[asterisk-scf-commits] asterisk-scf/integration/pjproject.git branch "cmake" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Jul 15 15:10:55 CDT 2011


branch "cmake" has been updated
       via  eda907598b764268e6876d184dfd5931047d6679 (commit)
       via  b5be5bbe9d0822118d2330b1b6a65bd478c0febf (commit)
      from  c99457a1afefae7290bcf7c2580b4dd93211cef4 (commit)

Summary of changes:
 CMakeLists.txt                |   89 ++++++++++++++++++++++++++++++++++------
 cmake/modules/pjproject.cmake |    3 +
 2 files changed, 78 insertions(+), 14 deletions(-)


- Log -----------------------------------------------------------------
commit eda907598b764268e6876d184dfd5931047d6679
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jul 15 15:10:52 2011 -0500

    More work in progress

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9f37b0..57a72f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -175,15 +175,6 @@ __pj_check_header(net/if.h PJ_HAS_NET_IF_H
                   "
                  )
 
-if(HAVE_UUID_H AND HAVE_LIBUUID)
-  list(APPEND ac_os_targets "guid_uuid")
-  if(LIBUUID_LIBRARY_DIRS)
-    link_directories(${LIBUUID_LIBRARY_DIRS})
-  endif()
-else()
-  list(APPEND ac_os_targets "guid_simple")
-endif()
-
 message(STATUS "Setting PJ_OS_NAME to ${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
 __pj_set_cache_string(PJ_OS_NAME "${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}" "")
 message(STATUS "Setting PJ_HAS_ERRNO_VAR to 1")
@@ -234,6 +225,29 @@ unset(CMAKE_EXTRA_INCLUDE_FILES)
 check_function_exists(pthread_mutexattr_settype PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE)
 check_struct_has_member(pthread_mutexattr_t recursive pthread.h PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE)
 
+if(CMAKE_SYSTEM_NAME STREQUAL Linux)
+  option(PJ_USE_EPOLL "Use /dev/epoll for ioqueue on Linux (experimental)" OFF)
+endif()
+if(PJ_USE_EPOLL)
+  list(APPEND ac_os_targets ioqueue_epoll)
+else()
+  list(APPEND ac_os_targets ioqueue_select)
+endif()
+
+if(WIN32)
+  list(APPEND ac_os_targets file_access_win32 file_io_win32 os_core_win32 os_time_win32 os_timestamp_win32 guid_win32)
+else()
+  list(APPEND ac_os_targets file_access_unistd file_io_ansi os_core_unix os_error_unix os_time_unix os_timestamp_posix)
+  if(HAVE_UUID_H AND HAVE_LIBUUID)
+    list(APPEND ac_os_targets guid_uuid)
+    if(LIBUUID_LIBRARY_DIRS)
+      link_directories(${LIBUUID_LIBRARY_DIRS})
+    endif()
+  else()
+    list(APPEND ac_os_targets guid_simple)
+  endif()
+endif()
+
 configure_file(pjlib/include/pj/compat/os_auto.h.in pjlib/include/pj/compat/os_auto.h ESCAPE_QUOTES @ONLY)
 configure_file(pjlib/include/pj/compat/m_auto.h.in pjlib/include/pj/compat/m_auto.h ESCAPE_QUOTES @ONLY)
 configure_file(pjmedia/include/pjmedia/config_auto.h.in pjmedia/include/pjmedia/config_auto.h ESCAPE_QUOTES @ONLY)

commit b5be5bbe9d0822118d2330b1b6a65bd478c0febf
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jul 15 14:29:18 2011 -0500

    Work in progress:
    
    * Set various system variables.
    * Check for some socket-related library functions.
    * Check for some pthread rwlock and mutex attributes.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79d5c56..e9f37b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
 cmake_minimum_required(VERSION 2.8)
 project("pjproject" C)
-include(CheckIncludeFile)
-include(CheckLibraryExists)
-include(CheckCSourceCompiles)
 include(CheckFunctionExists)
+include(CheckStructHasMember)
+include(CheckTypeSize)
+include(CheckSymbolExists)
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
 include("${CMAKE_SOURCE_DIR}/cmake/modules/pjproject.cmake")
@@ -63,13 +63,10 @@ if(UNIX)
 endif()
 
 find_package(Threads REQUIRED)
-if(CMAKE_THREAD_LIBS_INIT)
-  if(NOT CMAKE_HAVE_THREADS_LIBRARY)
-    list(APPEND c_flags "${CMAKE_THREAD_LIBS_INIT}")
-  else()
-    list(APPEND linker_flags "${CMAKE_THREAD_LIBS_INIT}")
-  endif()
+if(CMAKE_USE_PTHREADS_INIT)
+  __pj_append_to_var(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
 endif()
+
 if(CMAKE_COMPILER_IS_GNUCC)
   list(APPEND c_flags_debug "-Wall" "-g3")
   list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")
@@ -187,6 +184,56 @@ else()
   list(APPEND ac_os_targets "guid_simple")
 endif()
 
+message(STATUS "Setting PJ_OS_NAME to ${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
+__pj_set_cache_string(PJ_OS_NAME "${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}" "")
+message(STATUS "Setting PJ_HAS_ERRNO_VAR to 1")
+__pj_set_cache_string(PJ_HAS_ERRNO_VAR 1 "")
+message(STATUS "Setting PJ_HAS_HIGH_RES_TIMER to 1")
+__pj_set_cache_string(PJ_HAS_HIGH_RES_TIMER 1 "")
+message(STATUS "Setting PJ_HAS_MALLOC to 1")
+__pj_set_cache_string(PJ_HAS_MALLOC 1 "")
+message(STATUS "Setting PJ_NATIVE_STRING_IS_UNICODE to 0")
+__pj_set_cache_string(PJ_NATIVE_STRING_IS_UNICODE 0 "")
+message(STATUS "Setting PJ_ATOMIC_VALUE_TYPE to long")
+__pj_set_cache_string(PJ_ATOMIC_VALUE_TYPE "long" "")
+
+check_function_exists(inet_aton PJ_SOCK_HAS_INET_ATON)
+check_function_exists(inet_pton PJ_SOCK_HAS_INET_PTON)
+check_function_exists(inet_ntop PJ_SOCK_HAS_INET_NTOP)
+check_function_exists(getaddrinfo PJ_SOCK_HAS_GETADDRINFO)
+check_struct_has_member("struct sockaddr_in" "sin_len" "sys/types.h;sys/socket.h;netinet/in.h;arpa/inet.h" PJ_SOCKADDR_HAS_LEN)
+
+set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h")
+check_type_size(socklen_t PJ_HAS_SOCKLEN_T)
+unset(CMAKE_EXTRA_INCLUDE_FILES)
+
+if(WIN32)
+  __pj_set_cache_string(PJ_HAS_SO_ERROR 1)
+else()
+  check_symbol_exists(SO_ERROR "sys/types.h;sys/socket.h;netinet/in.h;arpa/inet.h" PJ_HAS_SO_ERROR)
+endif()
+
+set(CMAKE_EXTRA_INCLUDE_FILES "pthread.h")
+check_type_size(pthread_rwlock_t ac_rwmutex)
+if(NOT ac_rwmutex)
+  set(save_CRD ${CMAKE_REQUIRED_DEFINITIONS})
+  __pj_append_to_var(CMAKE_REQUIRED_DEFINITIONS "-D_POSIX_READER_WRITER_LOCKS")
+  check_type_size(pthread_rwlock_t ac_rwmutex)
+  if(ac_rwmutex)
+    __pj_append_to_var(CMAKE_REQUIRED_DEFINITIONS "-D_POSIX_THREADS")
+    __pj_set_cache_string(PJ_EMULATE_RWMUTEX 0 "")
+  else()
+    __pj_set_cache_string(PJ_EMULATE_RWMUTEX 1 "")
+    set(CMAKE_REQUIRED_DEFINITIONS ${save_CRD})
+  endif()
+else()
+  __pj_set_cache_string(PJ_EMULATE_RWMUTEX 0 "")
+endif()
+unset(CMAKE_EXTRA_INCLUDE_FILES)
+
+check_function_exists(pthread_mutexattr_settype PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE)
+check_struct_has_member(pthread_mutexattr_t recursive pthread.h PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE)
+
 configure_file(pjlib/include/pj/compat/os_auto.h.in pjlib/include/pj/compat/os_auto.h ESCAPE_QUOTES @ONLY)
 configure_file(pjlib/include/pj/compat/m_auto.h.in pjlib/include/pj/compat/m_auto.h ESCAPE_QUOTES @ONLY)
 configure_file(pjmedia/include/pjmedia/config_auto.h.in pjmedia/include/pjmedia/config_auto.h ESCAPE_QUOTES @ONLY)
diff --git a/cmake/modules/pjproject.cmake b/cmake/modules/pjproject.cmake
index 3412bb0..7f82a7b 100644
--- a/cmake/modules/pjproject.cmake
+++ b/cmake/modules/pjproject.cmake
@@ -1,3 +1,6 @@
+include(CheckIncludeFile)
+include(CheckCSourceCompiles)
+include(CheckLibraryExists)
 include(CheckLibraryExists)
 
 function(__pj_check_library LIBRARY FUNCTION)

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/pjproject.git



More information about the asterisk-scf-commits mailing list