You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2017/01/26 18:12:58 UTC

[1/2] celix git commit: CELIX-385: Improvements for building stand-alone etcdlib

Repository: celix
Updated Branches:
  refs/heads/develop 2366cd86a -> 4e665476c


CELIX-385: Improvements for building stand-alone etcdlib


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e9528c69
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e9528c69
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e9528c69

Branch: refs/heads/develop
Commit: e9528c692f13f799c7d351b4a5b86c5628a11ee1
Parents: 2366cd8
Author: Roy Lenferink <le...@gmail.com>
Authored: Wed Jan 25 11:40:31 2017 +0100
Committer: Roy Lenferink <le...@gmail.com>
Committed: Wed Jan 25 11:40:31 2017 +0100

----------------------------------------------------------------------
 etcdlib/CMakeLists.txt          |  5 +++++
 etcdlib/cmake/FindJansson.cmake | 42 ++++++++++++++++++++++++++++++++++++
 etcdlib/public/include/etcd.h   |  2 +-
 3 files changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e9528c69/etcdlib/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/etcdlib/CMakeLists.txt b/etcdlib/CMakeLists.txt
index 5c078f1..fd72d79 100644
--- a/etcdlib/CMakeLists.txt
+++ b/etcdlib/CMakeLists.txt
@@ -28,6 +28,11 @@ if (NOT PROJECT_SOURCE_DIR)
     )
 
     include(GNUInstallDirs)
+
+    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
+    set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 ${CMAKE_C_FLAGS}")
+    set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
+
     set(ETCDLIB_CMP ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
 else()
     set(ETCDLIB_CMP framework)

http://git-wip-us.apache.org/repos/asf/celix/blob/e9528c69/etcdlib/cmake/FindJansson.cmake
----------------------------------------------------------------------
diff --git a/etcdlib/cmake/FindJansson.cmake b/etcdlib/cmake/FindJansson.cmake
new file mode 100644
index 0000000..bedf8be
--- /dev/null
+++ b/etcdlib/cmake/FindJansson.cmake
@@ -0,0 +1,42 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# - Try to find Jansson
+# Once done this will define
+#  JANSSON_FOUND - System has Jansson
+#  JANSSON_INCLUDE_DIRS - The Jansson include directories
+#  JANSSON_LIBRARIES - The libraries needed to use Jansson
+#  JANSSON_DEFINITIONS - Compiler switches required for using Jansson
+
+find_path(JANSSON_INCLUDE_DIR jansson.h
+          /usr/include
+          /usr/local/include )
+
+find_library(JANSSON_LIBRARY NAMES jansson
+             PATHS /usr/lib /usr/local/lib )
+
+set(JANSSON_LIBRARIES ${JANSSON_LIBRARY} )
+set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR} )
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(Jansson  DEFAULT_MSG
+                                  JANSSON_LIBRARY JANSSON_INCLUDE_DIR)
+
+mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/e9528c69/etcdlib/public/include/etcd.h
----------------------------------------------------------------------
diff --git a/etcdlib/public/include/etcd.h b/etcdlib/public/include/etcd.h
index ba05ff7..0fdb99a 100644
--- a/etcdlib/public/include/etcd.h
+++ b/etcdlib/public/include/etcd.h
@@ -25,7 +25,7 @@
 /*
  * If set etcdlib will _not_ initialize curl
  * using curl_global_init. Note that 
- * curl_global_init can be called mutiple 
+ * curl_global_init can be called multiple
  * times, but is _not_ thread-safe.
  */
 #define ETCDLIB_NO_CURL_INITIALIZATION (1)


[2/2] celix git commit: CELIX-385: Added README for etcdlib

Posted by pn...@apache.org.
CELIX-385: Added README for etcdlib


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/4e665476
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/4e665476
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/4e665476

Branch: refs/heads/develop
Commit: 4e665476c2bf1af7f546efc47a5c366498263a62
Parents: e9528c6
Author: Roy Lenferink <le...@gmail.com>
Authored: Thu Jan 26 10:52:11 2017 +0100
Committer: Roy Lenferink <le...@gmail.com>
Committed: Thu Jan 26 11:24:59 2017 +0100

----------------------------------------------------------------------
 etcdlib/README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/4e665476/etcdlib/README.md
----------------------------------------------------------------------
diff --git a/etcdlib/README.md b/etcdlib/README.md
new file mode 100644
index 0000000..1bbf14e
--- /dev/null
+++ b/etcdlib/README.md
@@ -0,0 +1,71 @@
+#Etcdlib
+etcd is a distributed, consistent key-value store for shared configuration and service discovery, part of the CoreOS project.
+
+This repository provides a library for etcd for C applications.
+
+Etcdlib can be used as part of Celix but is also useable stand-alone.
+
+##Preparing
+The following packages (libraries + headers) should be installed on your system:
+
+*	Development Environment
+	*	build-essentials (gcc/g++ or clang/clang++)
+	*	cmake (3.2 or higher)
+
+* 	Etcdlib Dependencies
+	*	curl
+	*	jansson
+
+##Download the Apache Celix sources
+To get started you first have to download the Apache Celix sources. This can be done by cloning the Apache Celix git repository:
+
+```bash
+#Create a new workspace to work in, e.g:
+mkdir -p ${HOME}/workspace
+export WS=${HOME}/workspace
+cd ${WS}
+
+#clone the repro
+git clone --single-branch --branch develop https://github.com/apache/celix.git
+```
+
+##Building
+Etcdlib uses [CMake](https://cmake.org) as build system. CMake can generate (among others) makefiles or ninja build files. Using ninja build files will result in a faster build.
+
+###Building using CMake and makefiles:
+```bash
+cd ${WS}/celix/etcdlib
+mkdir build
+cd build
+cmake .. 
+make 
+```
+
+###Building using CMake and Ninja
+```bash
+cd ${WS}/celix/etcdlib
+mkdir build
+cd build
+cmake -G Ninja ..
+ninja
+```
+
+##Editing Build options
+With use of CMake, Etcdlib makes it possible to edit build options. This enabled users, among other options, to configure a install location.
+To edit the options use ccmake or cmake-gui. For cmake-gui an additional package install can be necessary (Fedora: `dnf install cmake-gui`). 
+
+```bash
+cd ${WS}/celix/etcdlib/build
+ccmake .
+#Edit the CMAKE_INSTALL_PREFIX config to set the install location
+```
+
+For this guide we assume the CMAKE_INSTALL_PREFIX is `/usr/local`.
+
+##Installing Etcdlib
+
+```bash
+cd ${WS}/celix/etcdlib/build
+make
+sudo make install
+```