Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH 0/3] Fix FreeBSD build
@ 2018-11-03  4:29 Alexander Turenko
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 1/3] Update README.FreeBSD Alexander Turenko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexander Turenko @ 2018-11-03  4:29 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: Alexander Turenko, tarantool-patches

https://github.com/tarantool/tarantool/issues/3677
https://github.com/tarantool/tarantool/issues/3750
https://github.com/tarantool/tarantool/tree/Totktonada/freebsd-fixes

Related: https://github.com/tarantool/tarantool/pull/3739

Tested on FreeBSD 10.4 and FreeBSD 11.2.

Please, check-in into 1.10.

Alexander Turenko (3):
  Update README.FreeBSD
  Add <netinet/in.h> include on FreeBSD
  Make libdl.so optional (for FreeBSD prior to 11.2)

 README.FreeBSD       | 13 ++++++++-----
 cmake/FindCURL.cmake | 21 +++++++++++++++++----
 src/CMakeLists.txt   |  9 ++++++++-
 src/say.c            |  1 +
 4 files changed, 34 insertions(+), 10 deletions(-)

-- 
2.19.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tarantool-patches] [PATCH 1/3] Update README.FreeBSD
  2018-11-03  4:29 [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Alexander Turenko
@ 2018-11-03  4:29 ` Alexander Turenko
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 2/3] Add <netinet/in.h> include on FreeBSD Alexander Turenko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Turenko @ 2018-11-03  4:29 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: Alexander Turenko, tarantool-patches

---
 README.FreeBSD | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/README.FreeBSD b/README.FreeBSD
index 3908d13ec..ca643279f 100644
--- a/README.FreeBSD
+++ b/README.FreeBSD
@@ -1,8 +1,8 @@
-Target OS: FreeBSD 10.1 (RELEASE)
+Target OS: FreeBSD 10.4 (RELEASE) and FreeBSD 11.2 (RELEASE)
 
 1. Install necessary packages:
 -------------
-pkg install sudo git cmake gmake readline
+pkg install git cmake gmake readline icu
 
 
 2. Download & build tarantool source code:
@@ -19,11 +19,14 @@ gmake
 3. Set up python 2.7
 -------------
 
-From packages:
-pkg install python27 py27-yaml py27-daemon py27-msgpack
+Install testing dependences either from packages or from pip.
 
-From pip:
+3.1. From packages:
+-------------
+pkg install python27 py27-yaml py27-daemon py27-msgpack
 
+3.2. From pip:
+-------------
 pkg install py27-virtualenv
 virtualenv .venv
 source .venv/bin/activate
-- 
2.19.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tarantool-patches] [PATCH 2/3] Add <netinet/in.h> include on FreeBSD
  2018-11-03  4:29 [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Alexander Turenko
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 1/3] Update README.FreeBSD Alexander Turenko
@ 2018-11-03  4:29 ` Alexander Turenko
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 3/3] Make libdl.so optional (for FreeBSD prior to 11.2) Alexander Turenko
  2018-11-03  6:23 ` [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Vladimir Davydov
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Turenko @ 2018-11-03  4:29 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: Alexander Turenko, tarantool-patches

FreeBSD does not include headers recursively, so we need to include it
explicitly at least for using IPPROTO_UDP macro.

Thanks Po-Chuan Hsieh (@sunpoet) for the fix proposal (PR #3739).

Fixes #3677.
---
 src/say.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/say.c b/src/say.c
index 7f018ec11..860176ac2 100644
--- a/src/say.c
+++ b/src/say.c
@@ -37,6 +37,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <netdb.h>
+#include <netinet/in.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <fcntl.h>
-- 
2.19.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tarantool-patches] [PATCH 3/3] Make libdl.so optional (for FreeBSD prior to 11.2)
  2018-11-03  4:29 [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Alexander Turenko
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 1/3] Update README.FreeBSD Alexander Turenko
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 2/3] Add <netinet/in.h> include on FreeBSD Alexander Turenko
@ 2018-11-03  4:29 ` Alexander Turenko
  2018-11-03  6:23 ` [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Vladimir Davydov
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Turenko @ 2018-11-03  4:29 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: Alexander Turenko, tarantool-patches

FreeBSD 10.4 has no libdl.so.

Fixes #3750.
---
 cmake/FindCURL.cmake | 21 +++++++++++++++++----
 src/CMakeLists.txt   |  9 ++++++++-
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake
index e2e2c6f20..e13b6cde4 100644
--- a/cmake/FindCURL.cmake
+++ b/cmake/FindCURL.cmake
@@ -24,9 +24,15 @@ else()
     set(NGHTTP2_LIB_NAME nghttp2)
 endif()
 
-# Curl may require nghttp library, search for it and add to dependicies if
-# found
+# Always links pthread and dl dynamically.
+set(PTHREAD_LIB_NAME pthread)
+set(DL_LIB_NAME dl)
+
+# Curl may be linked with optional or target-dependent libraries,
+# search for them and add to dependicies if found.
 find_library(NGHTTP2_LIBRARY NAMES ${NGHTTP2_LIB_NAME})
+find_library(PTHREAD_LIBRARY NAMES ${PTHREAD_LIB_NAME})
+find_library(DL_LIBRARY NAMES ${DL_LIB_NAME})
 
 if(DEFINED CURL_ROOT)
     set(CURL_FIND_OPTS NO_CMAKE NO_CMAKE_SYSTEM_PATH)
@@ -79,14 +85,21 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
 
 if(CURL_FOUND)
   set(CURL_LIBRARIES ${CURL_LIBRARY})
+  set(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
   if(BUILD_STATIC)
-    # in case of a static build we have to add curl dependencies
+    # In case of a static build we have to add curl dependencies.
     if(NOT "${NGHTTP2_LIBRARY}" STREQUAL "NGHTTP2_LIBRARY-NOTFOUND")
       set(CURL_LIBRARIES ${CURL_LIBRARIES} ${NGHTTP2_LIBRARY})
     endif()
+    if(NOT "${PTHREAD_LIBRARY}" STREQUAL "PTHREAD_LIBRARY-NOTFOUND")
+      set(CURL_LIBRARIES ${CURL_LIBRARIES} ${PTHREAD_LIBRARY})
+    endif()
+    if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
+      set(CURL_LIBRARIES ${CURL_LIBRARIES} ${DL_LIBRARY})
+    endif()
   endif()
   set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
-  set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} pthread dl)
+  set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES})
   set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
   check_c_source_runs("
     #include <curl/curl.h>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d296348a3..ceff96ec0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -67,7 +67,14 @@ add_custom_target(ragel
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     COMMAND ragel -G2 src/uri.rl -o src/uri.c)
 
-set (generic_libraries pthread dl)
+# There is no libdl.so on FreeBSD prior to 11.2.
+#
+# Always links pthread and dl dynamically.
+set(generic_libraries pthread)
+find_library(DL_LIBRARY NAMES dl)
+if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
+    set(generic_libraries ${generic_libraries} dl)
+endif()
 
 set (core_sources
      diag.c
-- 
2.19.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [tarantool-patches] [PATCH 0/3] Fix FreeBSD build
  2018-11-03  4:29 [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Alexander Turenko
                   ` (2 preceding siblings ...)
  2018-11-03  4:29 ` [tarantool-patches] [PATCH 3/3] Make libdl.so optional (for FreeBSD prior to 11.2) Alexander Turenko
@ 2018-11-03  6:23 ` Vladimir Davydov
  3 siblings, 0 replies; 5+ messages in thread
From: Vladimir Davydov @ 2018-11-03  6:23 UTC (permalink / raw)
  To: Alexander Turenko; +Cc: Kirill Yukhin, tarantool-patches

On Sat, Nov 03, 2018 at 07:29:31AM +0300, Alexander Turenko wrote:
> https://github.com/tarantool/tarantool/issues/3677
> https://github.com/tarantool/tarantool/issues/3750
> https://github.com/tarantool/tarantool/tree/Totktonada/freebsd-fixes
> 
> Related: https://github.com/tarantool/tarantool/pull/3739
> 
> Tested on FreeBSD 10.4 and FreeBSD 11.2.
> 
> Please, check-in into 1.10.
> 
> Alexander Turenko (3):
>   Update README.FreeBSD
>   Add <netinet/in.h> include on FreeBSD
>   Make libdl.so optional (for FreeBSD prior to 11.2)

Pushed to 1.10

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-03  6:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-03  4:29 [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Alexander Turenko
2018-11-03  4:29 ` [tarantool-patches] [PATCH 1/3] Update README.FreeBSD Alexander Turenko
2018-11-03  4:29 ` [tarantool-patches] [PATCH 2/3] Add <netinet/in.h> include on FreeBSD Alexander Turenko
2018-11-03  4:29 ` [tarantool-patches] [PATCH 3/3] Make libdl.so optional (for FreeBSD prior to 11.2) Alexander Turenko
2018-11-03  6:23 ` [tarantool-patches] [PATCH 0/3] Fix FreeBSD build Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox