[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Aug 15 02:54:13 MDT 2014


The branch, master has been updated
       via  c83b7d4 Add #define __APPLE_USE_RFC_3542 to CFLAGS
       via  bc546d0 Define _GNU_SOURCE on one place only.
      from  baa8b43 Provide a compatible declaration of CMSG_ALIGN

http://gitweb.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c83b7d4096ece0ca536c3028e59efc29eb438feb
Author: Jakub Hrozek <jakub.hrozek at gmail.com>
Date:   Tue Jul 29 08:19:34 2014 +0200

    Add #define __APPLE_USE_RFC_3542 to CFLAGS
    
    Unless __APPLE_USE_RFC_3542 is defined on OSX, constants from RFC 3542
    such as IPV6_RECVPKTINFO are not usable.
    
    The patch adds the #define unconditionally -- on other platforms, the
    constant is harmless.
    
    Signed-off-by: Jakub Hrozek <jakub.hrozek at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit bc546d05a93794b1f0f1ef02e96f918533c250c3
Author: Jakub Hrozek <jakub.hrozek at gmail.com>
Date:   Wed Aug 13 09:44:30 2014 +0200

    Define _GNU_SOURCE on one place only.
    
    There were several _GNU_SOURCE definitions scaterred in the build
    system. This patch always adds -D_GNU_SOURCE to the CFLAGS if building
    on a UNIX platform.
    
    Signed-off-by: Jakub Hrozek <jakub.hrozek at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 ConfigureChecks.cmake                   |    2 --
 cmake/Modules/DefineCompilerFlags.cmake |    5 +++++
 src/CMakeLists.txt                      |    5 -----
 tests/CMakeLists.txt                    |    1 -
 4 files changed, 5 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index df65411..fb73449 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -61,9 +61,7 @@ check_function_exists(snprintf HAVE_SNPRINTF)
 check_function_exists(signalfd HAVE_SIGNALFD)
 check_function_exists(eventfd HAVE_EVENTFD)
 check_function_exists(timerfd_create HAVE_TIMERFD_CREATE)
-set(CMAKE_REQUIRED_FLAGS -D_GNU_SOURCE)
 check_function_exists(bindresvport HAVE_BINDRESVPORT)
-set(CMAKE_REQUIRED_FLAGS)
 
 
 if (UNIX)
diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake
index 218f4fe..4a747d2 100644
--- a/cmake/Modules/DefineCompilerFlags.cmake
+++ b/cmake/Modules/DefineCompilerFlags.cmake
@@ -19,6 +19,11 @@ if (UNIX AND NOT WIN32)
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=pointer-arith -Werror=declaration-after-statement")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration -Werror=write-strings")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE")
+
+	if (OSX)
+	    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__APPLE_USE_RFC_3542")
+	endif (OSX)
 
         # with -fPIC
         check_c_compiler_flag("-fPIC" WITH_FPIC)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b1ab95f..4b22d77 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,11 +2,6 @@ project(libsocket_wrapper C)
 
 include_directories(${CMAKE_BINARY_DIR})
 
-set_source_files_properties(socket_wrapper.c
-    PROPERTIES
-        COMPILE_DEFINITIONS
-            _GNU_SOURCE)
-
 add_library(socket_wrapper SHARED socket_wrapper.c)
 
 target_link_libraries(socket_wrapper ${SWRAP_REQUIRED_LIBRARIES})
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d3a4156..17b1212 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,7 +6,6 @@ include_directories(
   ${CMOCKA_INCLUDE_DIR}
 )
 
-add_definitions(-D_GNU_SOURCE)
 set(TORTURE_LIBRARY torture)
 
 # RFC862 echo server


-- 
Socket Wrapper Repository


More information about the samba-cvs mailing list