This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Tarantool -- an efficient key/value data store".

The branch master has been updated
       via  bd6091dc91f9ef0926d43c2df24527820daf8952 (commit)
      from  aedff92b89a69cd8124108325322643aafa0b2e8 (commit)

Summary of changes:
 CMakeLists.txt      |    8 ++++++++
 core/CMakeLists.txt |    4 ++++
 core/util.c         |    2 +-
 include/util.h      |    2 +-
 mod/CMakeLists.txt  |    5 +++++
 mod/box/assoc.h     |    4 ++--
 6 files changed, 21 insertions(+), 4 deletions(-)

commit bd6091dc91f9ef0926d43c2df24527820daf8952
Author: Konstantin Osipov <[email protected]>
Date:   Tue Mar 1 20:59:07 2011 +0300

    CPack: enable statically built binaries.
    
    @todo: Deal with this:
    
    /build/buildd/binutils-2.20.1/builddir-single/bfd/../../bfd/plugin.c:127:
    warning: Using 'dlopen' in statically linked applications requires
    at runtime the shared libraries from the glibc version used for
    linking
    libltbox.a(tarantool.c.o): In function `main':
    /home/kostja/work/tarantool/core/tarantool.c:453: warning: Using
    'getpwnam' in statically linked applications requires at runtime
    the shared libraries from the glibc version used for linking

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b30a7c..543341d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -170,6 +170,13 @@ if (ENABLE_BACKTRACE)
     endif()
 endif()
 
+option(ENABLE_STATIC "Perform static linking whenever possible." OFF)
+
+if (ENABLE_STATIC)
+    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
+endif()
+
+
 add_subdirectory(third_party)
 add_subdirectory(cfg)
 add_subdirectory(core)
@@ -201,4 +208,5 @@ message (STATUS "ENABLE_GCOV: ${ENABLE_GCOV}")
 message (STATUS "ENABLE_TRACE: ${ENABLE_TRACE}")
 message (STATUS "ENABLE_BACKTRACE: ${ENABLE_BACKTRACE}")
 message (STATUS "Backtrace is with symbol resolve: ${HAVE_BFD}")
+message (STATUS "ENABLE_STATIC: ${ENABLE_STATIC}")
 message (STATUS "")
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 391c018..9ccc809 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -74,6 +74,10 @@ endif()
 
 if (ENABLE_BACKTRACE AND HAVE_BFD)
   set (common_libraries ${common_libraries} bfd)
+  if (ENABLE_STATIC)
+     include (FindZLIB)
+     set (common_libraries ${common_libraries} ${ZLIB_LIBRARIES} iberty dl)
+  endif()
 endif()
 
 set (common_libraries ${common_libraries} PARENT_SCOPE) 
diff --git a/core/util.c b/core/util.c
index 8184fb4..fff5fe4 100644
--- a/core/util.c
+++ b/core/util.c
@@ -96,7 +96,7 @@ coredump(int dump_interval)
 }
 
 void *
-xrealloc(void *ptr, size_t size)
+tnt_xrealloc(void *ptr, size_t size)
 {
        void *ret = realloc(ptr, size);
        if (size > 0 && ret == NULL)
diff --git a/include/util.h b/include/util.h
index 243fde4..f8418a8 100644
--- a/include/util.h
+++ b/include/util.h
@@ -104,7 +104,7 @@ extern int forked;
 pid_t tfork();
 void close_all_xcpt(int fdc, ...);
 void coredump(int dump_interval);
-void *xrealloc(void *ptr, size_t size);
+void *tnt_xrealloc(void *ptr, size_t size);
 
 void __gcov_flush();
 
diff --git a/mod/CMakeLists.txt b/mod/CMakeLists.txt
index 5904339..b7cc1e1 100644
--- a/mod/CMakeLists.txt
+++ b/mod/CMakeLists.txt
@@ -24,6 +24,11 @@ function(tarantool_module mod)
   set_target_properties(tarantool_${mod} PROPERTIES COMPILE_FLAGS
       "${core_cflags}")
 
+  if (ENABLE_STATIC)
+      set_target_properties(tarantool_${mod} PROPERTIES
+          LINK_SEARCH_END_STATIC ON)
+  endif()
+
   install (TARGETS tarantool_${mod} DESTINATION bin)
 
 endfunction()
diff --git a/mod/box/assoc.h b/mod/box/assoc.h
index 4c8ef83..b1d55ce 100644
--- a/mod/box/assoc.h
+++ b/mod/box/assoc.h
@@ -68,8 +68,8 @@ static inline int lstrcmp(void *a, void *b)
 #define kh_lstr_hash_func(key) ({ void *_k = key; unsigned int l = 
load_varint32(&_k); MurmurHash2(_k, l, 13); })
 #define kh_lstr_hash_equal(a, b) (lstrcmp(a, b) == 0)
 
-KHASH_INIT(lstr_ptr_map, void *, ptr_t, 1, kh_lstr_hash_func, 
kh_lstr_hash_equal, xrealloc);
-KHASH_INIT(ptr_set, uint64_t, char, 0, kh_int64_hash_func, 
kh_int64_hash_equal, xrealloc);
+KHASH_INIT(lstr_ptr_map, void *, ptr_t, 1, kh_lstr_hash_func, 
kh_lstr_hash_equal, tnt_xrealloc);
+KHASH_INIT(ptr_set, uint64_t, char, 0, kh_int64_hash_func, 
kh_int64_hash_equal, tnt_xrealloc);
 
 void assoc_init(void);
 

-- 
Tarantool -- an efficient key/value data store

_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to