Repository: incubator-htrace
Updated Branches:
  refs/heads/master e5809a7f6 -> 6d5b91b59


HTRACE-219. Add -Dleveldb.prefix and -Djsonc.prefix build options (cmccabe)


Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/6d5b91b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/6d5b91b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/6d5b91b5

Branch: refs/heads/master
Commit: 6d5b91b599e9a4c3e86be2dc4ce663570a421dc4
Parents: e5809a7
Author: Colin Patrick Mccabe <[email protected]>
Authored: Tue Jul 21 18:28:23 2015 -0700
Committer: Colin Patrick Mccabe <[email protected]>
Committed: Wed Jul 22 15:28:27 2015 -0700

----------------------------------------------------------------------
 htrace-c/pom.xml             |  3 ++-
 htrace-c/src/CMakeLists.txt  |  4 ++--
 htrace-htraced/go/gobuild.sh | 28 +++++++++++++++++-----------
 htrace-htraced/pom.xml       |  3 ++-
 4 files changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/6d5b91b5/htrace-c/pom.xml
----------------------------------------------------------------------
diff --git a/htrace-c/pom.xml b/htrace-c/pom.xml
index eeab648..cb9ba69 100644
--- a/htrace-c/pom.xml
+++ b/htrace-c/pom.xml
@@ -33,6 +33,7 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <jsonc.prefix></jsonc.prefix>
   </properties>
 
   <profiles>
@@ -77,7 +78,7 @@
                   <target>
                     <mkdir dir="${project.build.directory}/build"/>
                     <exec executable="cmake" 
dir="${project.build.directory}/build" failonerror="true">
-                      <arg line="${basedir}/src 
-DCMAKE_INSTALL_PREFIX=${project.build.directory}/install"/>
+                      <arg line="${basedir}/src 
-DCMAKE_INSTALL_PREFIX=${project.build.directory}/install 
-DJSON_C_PREFIX=${jsonc.prefix}"/>
                     </exec>
                     <exec executable="make" 
dir="${project.build.directory}/build" failonerror="true">
                       <arg line="install VERBOSE=1"/>

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/6d5b91b5/htrace-c/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/htrace-c/src/CMakeLists.txt b/htrace-c/src/CMakeLists.txt
index fed850d..4240f32 100644
--- a/htrace-c/src/CMakeLists.txt
+++ b/htrace-c/src/CMakeLists.txt
@@ -51,9 +51,9 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/test/test_config.h.cmake 
${CMAKE_BINARY_DIR}/
 find_package(PkgConfig)
 pkg_check_modules(PC_JSON-C QUIET json-c)
 find_path(JSON_C_INCLUDE_DIR "json.h"
-    HINTS ${PC_JSON-C_INCLUDEDIR} ${PC_JSON-C_INCLUDE_DIRS} PATH_SUFFIXES 
json-c json)
+    HINTS ${JSON_C_PREFIX} ${PC_JSON-C_INCLUDEDIR} ${PC_JSON-C_INCLUDE_DIRS} 
PATH_SUFFIXES json-c json)
 find_library(JSON_C_LIBRARY NAMES json-c json libjson
-    HINTS ${PC_JSON-C_LIBDIR} ${PC_JSON-C_LIBRARY_DIRS})
+    HINTS ${JSON_C_PREFIX}${PC_JSON-C_LIBDIR} ${PC_JSON-C_LIBRARY_DIRS})
 IF(JSON_C_INCLUDE_DIR AND JSON_C_LIBRARY)
 ELSE(JSON_C_INCLUDE_DIR AND JSON_C_LIBRARY)
     MESSAGE(FATAL_ERROR "Failed to find libjson-c. Try installing libjson-c 
with apt-get or yum, or install it manually from 
http://oss.metaparadigm.com/json-c/";)

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/6d5b91b5/htrace-htraced/go/gobuild.sh
----------------------------------------------------------------------
diff --git a/htrace-htraced/go/gobuild.sh b/htrace-htraced/go/gobuild.sh
index 0c5ae54..e2b658f 100755
--- a/htrace-htraced/go/gobuild.sh
+++ b/htrace-htraced/go/gobuild.sh
@@ -78,19 +78,25 @@ exit 1
 fi
 
 # Check for libleveldb.so
-if [ -x "/sbin/ldconfig" ]; then
-    # Suse requires ldconfig to be run via the absolute path
-    ldconfig=/sbin/ldconfig
+if [ -n "$LEVELDB_PREFIX" ]; then
+    echo "using LEVELDB_PREFIX=$LEVELDB_PREFIX"
+    export CGO_CFLAGS="-I${LEVELDB_PREFIX}/include"
+    export CGO_LDFLAGS="-L${LEVELDB_PREFIX}"
 else
-    which ldconfig &> /dev/null
-    [ $? -eq 0 ] && ldconfig=ldconfig
-fi
-if [ -n "${ldconfig}" ]; then
-    if "${ldconfig}" -p | grep -q libleveldb; then
-        :
+    if [ -x "/sbin/ldconfig" ]; then
+        # Suse requires ldconfig to be run via the absolute path
+        ldconfig=/sbin/ldconfig
     else
-        echo "You must install the leveldb-devel package (or distro-specific 
equivalent.)"
-        exit 1
+        which ldconfig &> /dev/null
+        [ $? -eq 0 ] && ldconfig=ldconfig
+    fi
+    if [ -n "${ldconfig}" ]; then
+        if "${ldconfig}" -p | grep -q libleveldb; then
+            :
+        else
+            echo "You must install the leveldb-devel package (or 
distro-specific equivalent.)"
+            exit 1
+        fi
     fi
 fi
 

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/6d5b91b5/htrace-htraced/pom.xml
----------------------------------------------------------------------
diff --git a/htrace-htraced/pom.xml b/htrace-htraced/pom.xml
index c6166bc..67a67fd 100644
--- a/htrace-htraced/pom.xml
+++ b/htrace-htraced/pom.xml
@@ -28,8 +28,8 @@ language governing permissions and limitations under the 
License. -->
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <leveldb.prefix></leveldb.prefix>
   </properties>
-
   <build>
     <plugins>
       <plugin>
@@ -113,6 +113,7 @@ language governing permissions and limitations under the 
License. -->
                       dir="${basedir}//go/"
                       failonerror="true">
                   <env key="RELEASE_VERSION" value="${project.version}"/>
+                  <env key="LEVELDB_PREFIX" value="${leveldb.prefix}"/>
                 </exec>
               </tasks>
             </configuration>

Reply via email to