This is an automated email from the ASF dual-hosted git repository.

huor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hawq.git


The following commit(s) were added to refs/heads/master by this push:
     new c8d6571  apache hawq make dbcommon univplan storage
c8d6571 is described below

commit c8d657135ec6e5b715225d6adfc819264364c0eb
Author: oushu1tuyu1 <[email protected]>
AuthorDate: Fri Apr 5 18:33:59 2019 +0800

    apache hawq make dbcommon univplan storage
---
 GNUmakefile.in                                    |  12 ++
 configure                                         | 108 +++++++++++++++++-
 configure.in                                      |  28 ++++-
 depends/README                                    |   0
 depends/build-all.sh                              | 132 ----------------------
 depends/dbcommon/CMake/FindJSON.cmake             |   2 +-
 depends/dbcommon/CMake/Options.cmake              |   9 +-
 depends/dbcommon/CMakeLists.txt                   |   3 +
 depends/dbcommon/Makefile                         |  76 +++++++++++++
 depends/{bootstrap => dbcommon/Makefile.global}   |  31 +++--
 depends/{Makefile => dbcommon/Makefile.global.in} |  34 +++---
 depends/dbcommon/README                           |   2 +-
 depends/dbcommon/bootstrap                        | 103 ++++++++++++-----
 depends/dbcommon/src/CMakeLists.txt               |   5 +-
 depends/dbcommon/test/CMakeLists.txt              |   4 +-
 depends/storage/CMake/FindJSON.cmake              |   2 +-
 depends/storage/CMake/Options.cmake               |   9 +-
 depends/storage/CMakeLists.txt                    |   3 +
 depends/storage/Makefile                          |  76 +++++++++++++
 depends/{Makefile => storage/Makefile.global}     |  32 +++---
 depends/{Makefile => storage/Makefile.global.in}  |  34 +++---
 depends/storage/README                            |   2 +-
 depends/storage/bootstrap                         |  86 +++++++++-----
 depends/storage/src/CMakeLists.txt                |   9 +-
 depends/storage/test/CMakeLists.txt               |   2 +-
 depends/storage/test/unit/CMakeLists.txt          |   2 +-
 depends/univplan/CMake/FindJSON.cmake             |   2 +-
 depends/univplan/CMake/Options.cmake              |   9 +-
 depends/univplan/CMakeLists.txt                   |   3 +
 depends/univplan/Makefile                         |  76 +++++++++++++
 depends/{Makefile => univplan/Makefile.global}    |  32 +++---
 depends/{Makefile => univplan/Makefile.global.in} |  34 +++---
 depends/univplan/bootstrap                        |  86 +++++++++-----
 depends/univplan/src/CMakeLists.txt               |   7 +-
 depends/univplan/test/CMakeLists.txt              |   4 +-
 35 files changed, 738 insertions(+), 321 deletions(-)

diff --git a/GNUmakefile.in b/GNUmakefile.in
index e6d01d0..d23cdee 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -13,6 +13,9 @@ all:
        $(MAKE) -C depends/thirdparty/googletest $@
        $(MAKE) -C depends/libhdfs3 $@
        $(MAKE) -C depends/libyarn $@
+       $(MAKE) -C depends/dbcommon $@
+       $(MAKE) -C depends/univplan $@
+       $(MAKE) -C depends/storage $@
        $(MAKE) -C src $@
        $(MAKE) -C config $@
        $(MAKE) -C contrib $@
@@ -25,6 +28,9 @@ install:
        $(MAKE) -C depends/thirdparty/googletest $@ 
        $(MAKE) -C depends/libhdfs3 $@
        $(MAKE) -C depends/libyarn $@
+       $(MAKE) -C depends/dbcommon $@
+       $(MAKE) -C depends/univplan $@
+       $(MAKE) -C depends/storage $@
        $(MAKE) -C src $@
        $(MAKE) -C config $@
        $(MAKE) -C contrib $@
@@ -66,6 +72,9 @@ clean:
        -$(MAKE) -C depends/thirdparty/googletest $@ 
        -$(MAKE) -C depends/libhdfs3 $@
        -$(MAKE) -C depends/libyarn $@
+       -$(MAKE) -C depends/dbcommon $@
+       -$(MAKE) -C depends/univplan $@
+       -$(MAKE) -C depends/storage $@
        $(MAKE) -C src $@
        $(MAKE) -C config $@
        $(MAKE) -C contrib $@
@@ -85,6 +94,9 @@ distclean maintainer-clean:
        -$(MAKE) -C depends/thirdparty/googletest $@ 
        -$(MAKE) -C depends/libhdfs3 $@
        -$(MAKE) -C depends/libyarn $@
+       -$(MAKE) -C depends/dbcommon $@
+       -$(MAKE) -C depends/univplan $@
+       -$(MAKE) -C depends/storage $@
        -$(MAKE) -C config $@
        -$(MAKE) -C tools $@
        -$(MAKE) -C src feature-test-clean
diff --git a/configure b/configure
index 2a442c4..3ca66a6 100755
--- a/configure
+++ b/configure
@@ -723,6 +723,9 @@ with_zlib
 with_system_tzdata
 with_libhdfs3
 with_libyarn
+with_dbcommon
+with_univplan
+with_storage
 with_openssl
 with_bonjour
 with_ldap
@@ -872,6 +875,9 @@ with_openssl
 with_readline
 with_libyarn
 with_libhdfs3
+with_dbcommon
+with_univplan
+with_storage
 with_libedit_preferred
 with_system_tzdata
 with_zlib
@@ -1563,6 +1569,9 @@ Optional Packages:
   --without-readline      do not use GNU Readline nor BSD Libedit for editing
   --without-libyarn       do not build libyarn
   --without-libhdfs3      do not build libhdfs3
+  --without-dbcommon      do not build dbcommon
+  --without-univplan      do not build univplan
+  --without-storage       do not build storage
   --without-libedit-preferred  Don't prefer BSD Libedit over GNU Readline
   --with-system-tzdata=DIR  use system time zone data in DIR
   --without-zlib          do not use Zlib
@@ -6234,6 +6243,95 @@ fi
 
 
 #
+# dbcommon
+#
+
+pgac_args="$pgac_args with_dbcommon"
+
+
+# Check whether --with-dbcommon was given.
+if test "${with_dbcommon+set}" = set; then :
+  withval=$with_dbcommon;
+  case $withval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      as_fn_error $? "no argument expected for --with-dbcommon option" 
"$LINENO" 5
+      ;;
+  esac
+
+else
+  with_dbcommon=yes
+
+fi
+
+
+
+
+#
+# univplan
+#
+
+pgac_args="$pgac_args with_univplan"
+
+
+# Check whether --with-univplan was given.
+if test "${with_univplan+set}" = set; then :
+  withval=$with_univplan;
+  case $withval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      as_fn_error $? "no argument expected for --with-univplan option" 
"$LINENO" 5
+      ;;
+  esac
+
+else
+  with_univplan=yes
+
+fi
+
+
+
+
+#
+# storage
+#
+
+pgac_args="$pgac_args with_storage"
+
+
+# Check whether --with-storage was given.
+if test "${with_storage+set}" = set; then :
+  withval=$with_storage;
+  case $withval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      as_fn_error $? "no argument expected for --with-storage option" 
"$LINENO" 5
+      ;;
+  esac
+
+else
+  with_storage=yes
+
+fi
+
+
+
+#
 # Prefer libedit
 #
 # In GPDB we want the default to be yes, because we don't want to link with 
GPL code.
@@ -16837,7 +16935,7 @@ $as_echo "done" >&6; }
 fi
 
 
-ac_config_files="$ac_config_files GNUmakefile src/VERSIONS.mk 
depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global 
depends/libyarn/Makefile.global src/Makefile.global 
src/pl/pljava/src/java/Makefile.global ranger-plugin/Makefile.global"
+ac_config_files="$ac_config_files GNUmakefile src/VERSIONS.mk 
depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global 
depends/libyarn/Makefile.global depends/dbcommon/Makefile.global 
depends/univplan/Makefile.global depends/storage/Makefile.global 
src/Makefile.global src/pl/pljava/src/java/Makefile.global 
ranger-plugin/Makefile.global"
 
 
 ac_config_links="$ac_config_links 
src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c 
src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} 
src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} 
src/include/dynloader.h:src/backend/port/dynloader/${template}.h 
src/include/pg_config_os.h:src/include/port/${template}.h 
src/Makefile.port:src/makefiles/Makefile.${template}"
@@ -16848,9 +16946,12 @@ ac_config_commands="$ac_config_commands 
check_win32_symlinks"
 
 fi
 
-# Remove build_timestamp file to make sure rebuild depends lib: libhdfs & 
libyarn
+# Remove build_timestamp file to make sure rebuild depends lib: libhdfs & 
libyarn & dbcommon & univplan & storage
 rm -f depends/libhdfs3/build/libhdfs3_build_timestamp
 rm -f depends/libyarn/build/libyarn_build_timestamp
+rm -f depends/dbcommon/build/dbcommon_build_timestamp
+rm -f depends/univplan/build/univplan_build_timestamp
+rm -f depends/storage/build/storage_build_timestamp
 rm -f depends/thirdparty/gporca_build_timestamp
 rm -f depends/thirdparty/gpos_build_timestamp
 rm -f depends/thirdparty/gp-xerces_build_timestamp
@@ -17568,6 +17669,9 @@ do
     "depends/thirdparty/googletest/Makefile.global") 
CONFIG_FILES="$CONFIG_FILES depends/thirdparty/googletest/Makefile.global" ;;
     "depends/libhdfs3/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
depends/libhdfs3/Makefile.global" ;;
     "depends/libyarn/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
depends/libyarn/Makefile.global" ;;
+    "depends/dbcommon/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
depends/dbcommon/Makefile.global" ;;
+    "depends/univplan/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
depends/univplan/Makefile.global" ;;
+    "depends/storage/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
depends/storage/Makefile.global" ;;
     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
     "src/pl/pljava/src/java/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
src/pl/pljava/src/java/Makefile.global" ;;
     "ranger-plugin/Makefile.global") CONFIG_FILES="$CONFIG_FILES 
ranger-plugin/Makefile.global" ;;
diff --git a/configure.in b/configure.in
index 10024e4..b65bee5 100644
--- a/configure.in
+++ b/configure.in
@@ -843,6 +843,27 @@ PGAC_ARG_BOOL(with, libhdfs3, yes,
 AC_SUBST(with_libhdfs3)
 
 #
+# dbcommon
+#
+PGAC_ARG_BOOL(with, dbcommon, yes,
+              [  --without-dbcommon      do not build dbcommon])
+AC_SUBST(with_dbcommon)
+
+#
+# univplan
+#
+PGAC_ARG_BOOL(with, univplan, yes,
+              [  --without-univplan      do not build univplan])
+AC_SUBST(with_univplan)
+
+#
+# storage
+#
+PGAC_ARG_BOOL(with, storage, yes,
+              [  --without-storage      do not build storage])
+AC_SUBST(with_storage)
+
+#
 # Prefer libedit
 #
 # In GPDB we want the default to be yes, because we don't want to link with 
GPL code.
@@ -2185,7 +2206,7 @@ else
 fi
 AC_SUBST(vpath_build)
 
-AC_CONFIG_FILES([GNUmakefile src/VERSIONS.mk 
depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global 
depends/libyarn/Makefile.global src/Makefile.global 
src/pl/pljava/src/java/Makefile.global ranger-plugin/Makefile.global])
+AC_CONFIG_FILES([GNUmakefile src/VERSIONS.mk 
depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global 
depends/libyarn/Makefile.global depends/dbcommon/Makefile.global 
depends/univplan/Makefile.global depends/storage/Makefile.global 
src/Makefile.global src/pl/pljava/src/java/Makefile.global 
ranger-plugin/Makefile.global])
 
 AC_CONFIG_LINKS([
   src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c
@@ -2208,9 +2229,12 @@ for FILE in $CONFIG_LINKS
 ])
 fi
 
-# Remove build_timestamp file to make sure rebuild depends lib: libhdfs & 
libyarn 
+# Remove build_timestamp file to make sure rebuild depends lib: libhdfs & 
libyarn & dbcommon & univplan & storage
 rm -f depends/libhdfs3/build/libhdfs3_build_timestamp
 rm -f depends/libyarn/build/libyarn_build_timestamp
+rm -f depends/dbcommon/build/dbcommon_build_timestamp
+rm -f depends/univplan/build/univplan_build_timestamp
+rm -f depends/storage/build/storage_build_timestamp
 rm -f depends/thirdparty/gporca_build_timestamp
 rm -f depends/thirdparty/gpos_build_timestamp
 rm -f depends/thirdparty/gp-xerces_build_timestamp
diff --git a/depends/README b/depends/README
deleted file mode 100644
index e69de29..0000000
diff --git a/depends/build-all.sh b/depends/build-all.sh
deleted file mode 100755
index 29d7782..0000000
--- a/depends/build-all.sh
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/bash -e
-# 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.
-
-DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-PREFIX="/opt/dependency/package"
-export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
-export DYLD_FALLBACK_LIBRARY_PATH=$PREFIX/lib:$DYLD_FALLBACK_LIBRARY_PATH
-
-if [[ -z $RUN_UNITTEST ]]; then
-   RUN_UNITTEST=YES
-fi
-OPTION=""
-case $1 in
-    release)
-        echo "Build Release Version ..."
-        OPTION=""
-        ;;
-    debug)
-        echo "Build Debug Version ..."
-        OPTION="--enable-debug"
-        ;;
-    coverage)
-        echo "Build Coverage Version ..."
-        OPTION="--enable-coverage"
-        ;;
-    noavx)
-        echo "Build AVX Version ..."
-        OPTION="--enable-avx=OFF"
-        ;;
-    incremental)
-        echo "Build incremental ..."
-        OPTION="incremental"
-        ;;
-    *)
-        echo "Build Release Version ..."
-        OPTION="";
-        ;;
-esac
-
-function build() {
-  echo "Build $1 ..."
-  
-  MODULE=$1
-  MAGMA_OPTION=""
-  ###kv_client && kv_server#####
-  if [ $1 = "magma_client" ] ;then
-    MAGMA_OPTION="--enable-client"
-    MODULE=magma
-  fi
-  if [ $1 = "magma_server" ] ;then
-    MAGMA_OPTION="--enable-server"
-    MODULE=magma
-  fi
-   
-  if [ "$OPTION" != "incremental" ]; then
-    echo "rm $DIR/$MODULE/build"
-    rm -rf $DIR/$MODULE/build
-
-    mkdir -p $DIR/$MODULE/build
-    cd $DIR/$MODULE/build
-    echo "../bootstrap $OPTION $MAGMA_OPTION"
-    ../bootstrap $OPTION $MAGMA_OPTION
-    CMAKE_OPTION=$OPTION
-  else
-    if [ ! -d $DIR/$MODULE/build ]; then mkdir -p $DIR/$MODULE/build; fi
-    cd $DIR/$MODULE/build
-    CMAKE_OPTION=$(grep 'CMAKE_BUILD_TYPE:STRING=' CMakeCache.txt | cut -d'=' 
-f2)
-    case $CMAKE_OPTION in
-      Release)
-        CMAKE_OPTION=""
-        ;;
-      Debug)
-        CMAKE_OPTION="--enable-debug"
-        codecov=$(grep 'ENABLE_COVERAGE:BOOL=' CMakeCache.txt | cut -d'=' -f2)
-        if [ $codecov = 'ON' ]; then
-          CMAKE_OPTION="--enable-coverage"
-        fi
-        ;;
-      *)
-        CMAKE_OPTION="";
-        ;;
-      esac
-    echo "../bootstrap $CMAKE_OPTION $MAGMA_OPTION"
-    ../bootstrap $CMAKE_OPTION $MAGMA_OPTION
-  fi
-
-  if [[ $OPTION == "--enable-coverage" || $CMAKE_OPTION == "--enable-coverage" 
]]
-  then
-    make coverage
-  else
-    make -j8 ;
-    if [[ $RUN_UNITTEST == "YES" ]]; then
-        echo "Run unittest ...."
-        make -j8 punittest
-    else
-        echo "Do not run unittest...."
-    fi
-  fi
-  make -j8 install
-
-  echo "Done."
-}
-echo "Delete headers in ${PREFIX}/include ..."
-rm -rf $PREFIX/include/dbcommon
-rm -rf $PREFIX/include/univplan
-rm -rf $PREFIX/include/storage
-echo "Done."
-
-echo "Delete libs in ${PREFIX}/lib ..."
-rm -rf $PREFIX/lib/libdbcommon*
-rm -rf $PREFIX/lib/libunivplan*
-rm -rf $PREFIX/lib/libstorage*
-echo "Done."
-
-build dbcommon
-build univplan
-build storage
diff --git a/depends/dbcommon/CMake/FindJSON.cmake 
b/depends/dbcommon/CMake/FindJSON.cmake
index a334948..ff5008b 100644
--- a/depends/dbcommon/CMake/FindJSON.cmake
+++ b/depends/dbcommon/CMake/FindJSON.cmake
@@ -20,7 +20,7 @@
 #  License text for the above reference.)
 
 # Look for the header file.
-find_path(JSON_INCLUDE_DIR NAMES json/json.h)
+find_path(JSON_INCLUDE_DIR NAMES json-c/json.h)
 mark_as_advanced(JSON_INCLUDE_DIR)
 
 # Look for the library (sorted from most current/relevant entry to least).
diff --git a/depends/dbcommon/CMake/Options.cmake 
b/depends/dbcommon/CMake/Options.cmake
index 36841ea..8be997e 100644
--- a/depends/dbcommon/CMake/Options.cmake
+++ b/depends/dbcommon/CMake/Options.cmake
@@ -5,7 +5,8 @@
 ##############################################################################
 # Setup build and dependencies information 
 ##############################################################################
-SET(DEPENDENCY_INSTALL_PREFIX "/opt/dependency")
+#SET(DEPENDENCY_INSTALL_PREFIX "/opt/dependency")
+SET(DEPENDENCY_INSTALL_PREFIX "/usr/local/hawq")
 IF($ENV{DEPENDENCY_INSTALL_PREFIX})
        SET(DEPENDENCY_INSTALL_PREFIX $ENV{DEPENDENCY_INSTALL_PREFIX})
 ENDIF()
@@ -19,8 +20,10 @@ SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}" 
${CMAKE_PREFIX_PATH})
 SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}/package" 
${CMAKE_PREFIX_PATH})
 SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}/tools" 
${CMAKE_PREFIX_PATH})
 
-SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib:${DEPENDENCY_LIBRARY_PATH}")
-SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib64:${DEPENDENCY_LIBRARY_PATH}")
+#SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib:${DEPENDENCY_LIBRARY_PATH}")
+#SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib64:${DEPENDENCY_LIBRARY_PATH}")
+SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/lib:${DEPENDENCY_LIBRARY_PATH}")
+SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/lib64:${DEPENDENCY_LIBRARY_PATH}")
 
 ##############################################################################
 # Setup build flags
diff --git a/depends/dbcommon/CMakeLists.txt b/depends/dbcommon/CMakeLists.txt
index dd15bfc..67ef822 100644
--- a/depends/dbcommon/CMakeLists.txt
+++ b/depends/dbcommon/CMakeLists.txt
@@ -1,10 +1,13 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 PROJECT(dbcommon)
 
+SET(CMAKE_VERBOSE_MAKEFILE ON CACHE STRING "Verbose build." FORCE)
+
 ##############################################################################
 # General CMake initialization
 ##############################################################################
 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
+SET(DOXYFILE_PATH ${CMAKE_SOURCE_DIR}/docs)
 SET(CMAKE_VERBOSE_MAKEFILE OFF CACHE STRING "Verbose build." FORCE)
 
 IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
diff --git a/depends/dbcommon/Makefile b/depends/dbcommon/Makefile
new file mode 100644
index 0000000..dd89703
--- /dev/null
+++ b/depends/dbcommon/Makefile
@@ -0,0 +1,76 @@
+# 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.
+#
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
+subdir = depends/dbcommon
+top_builddir = ../../
+include Makefile.global
+
+PRE_CFG_ARG =
+# get argument for running ../boostrap
+ifeq ($(enable_debug), yes)
+       PRE_CFG_ARG += --enable-debug
+endif # enable_debug
+
+ifeq ($(enable_coverage), yes)
+       PRE_CFG_ARG += --enable-coverage
+endif # enable_coverage
+
+##########################################################################
+#
+
+.PHONY: build all install distclean maintainer-clean clean pre-config
+
+ifeq ($(with_dbcommon), yes)
+
+# We will need to install it temporarily under build/install for hawq building.
+all: build
+       cd $(top_builddir)/$(subdir)/build; mkdir -p install; \
+       $(MAKE) DESTDIR=$(abs_top_builddir)/$(subdir)/build/install install
+
+install: build
+       cd $(top_builddir)/$(subdir)/build && $(MAKE) install
+
+distclean:
+       rm -rf $(top_builddir)/$(subdir)/build
+
+maintainer-clean: distclean
+
+clean:
+       if [ -d $(top_builddir)/$(subdir)/build ]; then \
+               cd $(top_builddir)/$(subdir)/build && $(MAKE) clean && rm -f 
dbcommon_build_timestamp; \
+       fi
+
+build: pre-config
+       cd $(top_builddir)/$(subdir)/build && $(MAKE)
+
+# trigger bootstrap only once.
+pre-config:
+       cd $(top_builddir)/$(subdir)/; \
+       mkdir -p build; \
+       cd build; \
+       if [ ! -f dbcommon_build_timestamp ]; then \
+               $(abs_top_srcdir)/$(subdir)/bootstrap --prefix=$(prefix) 
$(PRE_CFG_ARG) && touch dbcommon_build_timestamp; \
+       fi
+
+else
+all install distclean maintainer-clean clean pre-config:
+
+endif
diff --git a/depends/bootstrap b/depends/dbcommon/Makefile.global
old mode 100755
new mode 100644
similarity index 56%
rename from depends/bootstrap
rename to depends/dbcommon/Makefile.global
index 1851fd2..de78d01
--- a/depends/bootstrap
+++ b/depends/dbcommon/Makefile.global
@@ -1,4 +1,3 @@
-#!/bin/bash -e
 # 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
@@ -15,13 +14,27 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+#
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
+
+prefix := /usr/local/hawq
+enable_debug    = no
+enable_coverage = no
+with_dbcommon = yes
+
+# Support for VPATH builds
+vpath_build = no
+abs_top_srcdir = /Users/tuyu/hawq
+abs_top_builddir = /Users/tuyu/hawq
 
-source_dir=`cd "\`dirname \"$0\"\`";pwd`
-if [ $source_dir = `pwd` ]; then
-       echo 'Error: Don''t bootstrap in the source folder'
-       exit
-fi
+ifneq ($(vpath_build),yes)
+top_srcdir = $(top_builddir)
+srcdir = .
+else # vpath_build = yes
+top_srcdir = $(abs_top_srcdir)
+srcdir = $(top_srcdir)/$(subdir)
 
-cp $source_dir/Makefile .
-cat $source_dir/build-all.sh| sed 
"s|../bootstrap|$source_dir/\$MODULE/bootstrap|g" > ./build-all.sh
-chmod +x ./build-all.sh
+endif
diff --git a/depends/Makefile b/depends/dbcommon/Makefile.global.in
similarity index 54%
copy from depends/Makefile
copy to depends/dbcommon/Makefile.global.in
index 739e200..2d45b54 100644
--- a/depends/Makefile
+++ b/depends/dbcommon/Makefile.global.in
@@ -15,20 +15,26 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
 
-.PHONY: release debug
+prefix := @prefix@
+enable_debug    = @enable_debug@
+enable_coverage = @enable_coverage@
+with_dbcommon = @with_dbcommon@
 
-incremental:
-       ./build-all.sh incremental
+# Support for VPATH builds
+vpath_build = @vpath_build@
+abs_top_srcdir = @abs_top_srcdir@
+abs_top_builddir = @abs_top_builddir@
 
-release:
-       ./build-all.sh release
-
-debug: 
-       ./build-all.sh debug
-
-coverage:
-       ./build-all.sh coverage
-
-noavx:
-       ./build-all.sh noavx
+ifneq ($(vpath_build),yes)
+top_srcdir = $(top_builddir)
+srcdir = .
+else # vpath_build = yes
+top_srcdir = $(abs_top_srcdir)
+srcdir = $(top_srcdir)/$(subdir)
+VPATH = $(srcdir)
+endif
diff --git a/depends/dbcommon/README b/depends/dbcommon/README
index 207ecb0..25582c5 100644
--- a/depends/dbcommon/README
+++ b/depends/dbcommon/README
@@ -3,7 +3,7 @@
     cd dbcommon
     mkdir build
     cd build
-    ../bootstrap --prefix=/opt/dependency/package (default)
+    ../bootstrap --prefix=/usr/local/hawq (default)
 
 ## Build
 
diff --git a/depends/dbcommon/bootstrap b/depends/dbcommon/bootstrap
index 1554c7b..51a8a24 100755
--- a/depends/dbcommon/bootstrap
+++ b/depends/dbcommon/bootstrap
@@ -1,20 +1,45 @@
-#!/bin/sh
-
+#!/bin/bash
+# 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.
+#
 die() {
     echo "$@" 1>&2 ; exit 1
 }
 
-arg ()
-{
-    echo "$1" | sed "s/^${2-[^=]*=}//"
+arg () {
+    echo "$1" | sed "s/^${2-[^=]*=}//" | sed "s/:/;/g"
 }
 
+export CMAKE_INCLUDE_PATH=/usr/local/include
+export CMAKE_LIBRARY_PATH=/usr/local/lib
+
 # Detect directory information.
 source_dir=`cd "\`dirname \"$0\"\`";pwd`
 binary_dir=`pwd`
 
 # Choose the default install prefix.
-default_prefix="/opt/dependency/package"
+default_prefix=${source_dir}/dist
+
+# Choose the default dependency install prefix
+default_dependency=${DEPENDENCY_INSTALL_PREFIX}
+
+if [ x"${default_dependency}" = x"" ]; then
+    default_dependency="/opt/dependency"
+fi
 
 # Display bootstrap usage
 usage() {
@@ -25,27 +50,52 @@ Configuration:
     --help                          print this message
     --prefix=PREFIX                 install files in tree rooted at PREFIX
                                     ['"${default_prefix}"']
-    --enable-coverage               enable code coverage, must be used 
together with --enable-debug
+    --dependency=DIRs               specify the dependencies at DIRs, 
separated by colon
+                                    ['"${default_dependency}"']
     --enable-debug                  enable debug build
-    --enable-avx                    enable avx for vector instruction 
optimization
+    --enable-boost                  force to enable boost
+    --enable-coverage               enable build with code coverage support
+    --enable-libc++                 using libc++ instead of libstdc++, only 
valid for clang compiler
+
+Dependencies:
+    c/c++ compiler
+    GNU make
+    cmake           http://www.cmake.org/
+    protobuf        https://code.google.com/p/protobuf/
+    kerberos        http://web.mit.edu/kerberos/
+    libgsasl        http://www.gnu.org/software/gsasl/
+    libxml2         http://xmlsoft.org/
+    libuuid         http://sourceforge.net/projects/libuuid/
+    boost 1.53+     http://www.boost.org/
+                    [boost is not required if c++ compiler is g++ 4.6.0+ or 
clang++ with stdc++]
+
+Example:
+    mkdir build
+    cd build
+    ../bootstrap --prefix=/path/to/install 
--dependency=/path/to/protobuf:/path/to/kerberos/:path/to/others
+    make
+    make install
 '
     exit 10
 }
 
 # Parse arguments
-prefix_dir="${default_prefix}"
+prefix_dirs="${default_prefix}"
+dependency_dir="${default_dependency}"
 build_type="Release"
+enable_boost="OFF"
 enable_coverage="OFF"
-enable_avx="ON"
+enable_clang_lib="OFF"
 while test $# != 0; do
     case "$1" in
     --prefix=*) dir=`arg "$1"`
-                prefix_dir="$dir";;
-       --enable-coverage) enable_coverage="ON"
-                       build_type="Debug";;
-    --enable-debug) build_type="Debug";;
-    --enable-avx=*) avx=`arg "$1"`
-                    enable_avx="$avx";;
+                prefix_dirs="$dir";;
+    --dependency=*) dir=`arg "$1"`
+                dependency_dir="$dir";;
+    --enable-debug) enable_build="ON";;
+    --enable-boost) enable_boost="ON";;
+    --enable-coverage) enable_coverage="ON";;
+    --enable-libc++) enable_clang_lib="ON";;
     --help) usage ;;
     *) die "Unknown option: $1" ;;
     esac
@@ -53,12 +103,7 @@ while test $# != 0; do
 done
 
 if [ ${source_dir} = ${binary_dir} ]; then
-       die "cannot build the project in the source directory! Out-of-source 
build is enforced!"
-fi
-
-enable_avx_upper=`echo "${enable_avx}" | tr [a-z] [A-Z]`
-if [ ${enable_avx_upper} != "ON" ] && [ ${enable_avx_upper} != "OFF" ]; then
-    die "unknown value for option enable-avx: ${enable_avx}, valid options 
are: on and off"
+    die "cannot build the project in the source directory! Out-of-source build 
is enforced!"
 fi
 
 # Check clang compiler
@@ -74,19 +119,23 @@ c_compiler=`which ${CC}`
 cxx_compiler=`which ${CXX}`
 cmake=`which cmake`
 
-if [ ! -x ${c_compiler} ]; then
+if [[ ! -x ${c_compiler} ]]; then
     die "cannot found c compiler"
 fi
 
-if [ ! -x ${cxx_compiler} ]; then
-    die "cannot found c++ compiler"
+if [[ ! -x ${cxx_compiler} ]]; then
+    die "cannot found cplusplus compiler"
 fi
 
-if [ ! -x ${cmake} ]; then
+if [[ ! -x ${cmake} ]]; then
     die "cannot found cmake"
 fi
 
 # Configure 
-${cmake} -DCMAKE_BUILD_TYPE=${build_type} -DCMAKE_INSTALL_PREFIX=${prefix_dir} 
-DCMAKE_C_COMPILER=${c_compiler} -DCMAKE_CXX_COMPILER=${cxx_compiler} 
-DENABLE_COVERAGE=${enable_coverage} -DENABLE_AVX=${enable_avx_upper} 
${source_dir} || die "failed to configure the project"
+${cmake} -DENABLE_DEBUG=${enable_build} -DCMAKE_INSTALL_PREFIX=${prefix_dirs} \
+    -DCMAKE_C_COMPILER=${c_compiler} -DCMAKE_CXX_COMPILER=${cxx_compiler} \
+    -DCMAKE_PREFIX_PATH=${dependency_dir} -DENABLE_BOOST=${enable_boost} \
+    -DENABLE_COVERAGE=${enable_coverage} -DENABLE_LIBCPP=${enable_clang_lib} 
${source_dir} \
+    || die "failed to configure the project"
 
 echo 'bootstrap success. Run "make" to build.'
diff --git a/depends/dbcommon/src/CMakeLists.txt 
b/depends/dbcommon/src/CMakeLists.txt
index d322580..67a1b57 100644
--- a/depends/dbcommon/src/CMakeLists.txt
+++ b/depends/dbcommon/src/CMakeLists.txt
@@ -107,10 +107,11 @@ SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
 INCLUDE_DIRECTORIES(${dbcommon_ROOT_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/codegen/src)
 INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIRS})
-INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
+INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/include)
 INCLUDE_DIRECTORIES(/usr/local/include)
-LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/lib)
 LINK_DIRECTORIES(/usr/local/lib)
+LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../libhdfs3/build/install/usr/local/hawq/lib)
 
 ADD_LIBRARY(dbcommon-shared SHARED
         ${TEMPLATE_GENERATED_HEADERS}
diff --git a/depends/dbcommon/test/CMakeLists.txt 
b/depends/dbcommon/test/CMakeLists.txt
index 6552ff9..54d7599 100644
--- a/depends/dbcommon/test/CMakeLists.txt
+++ b/depends/dbcommon/test/CMakeLists.txt
@@ -8,10 +8,10 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-access-control")
 INCLUDE_DIRECTORIES(${dbcommon_ROOT_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/codegen/src)
 INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIRS})
-INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
+INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/include)
 
 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
-LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/lib)
 
 ADD_SUBDIRECTORY(unit)
 
diff --git a/depends/storage/CMake/FindJSON.cmake 
b/depends/storage/CMake/FindJSON.cmake
index a334948..ff5008b 100644
--- a/depends/storage/CMake/FindJSON.cmake
+++ b/depends/storage/CMake/FindJSON.cmake
@@ -20,7 +20,7 @@
 #  License text for the above reference.)
 
 # Look for the header file.
-find_path(JSON_INCLUDE_DIR NAMES json/json.h)
+find_path(JSON_INCLUDE_DIR NAMES json-c/json.h)
 mark_as_advanced(JSON_INCLUDE_DIR)
 
 # Look for the library (sorted from most current/relevant entry to least).
diff --git a/depends/storage/CMake/Options.cmake 
b/depends/storage/CMake/Options.cmake
index 36841ea..8be997e 100644
--- a/depends/storage/CMake/Options.cmake
+++ b/depends/storage/CMake/Options.cmake
@@ -5,7 +5,8 @@
 ##############################################################################
 # Setup build and dependencies information 
 ##############################################################################
-SET(DEPENDENCY_INSTALL_PREFIX "/opt/dependency")
+#SET(DEPENDENCY_INSTALL_PREFIX "/opt/dependency")
+SET(DEPENDENCY_INSTALL_PREFIX "/usr/local/hawq")
 IF($ENV{DEPENDENCY_INSTALL_PREFIX})
        SET(DEPENDENCY_INSTALL_PREFIX $ENV{DEPENDENCY_INSTALL_PREFIX})
 ENDIF()
@@ -19,8 +20,10 @@ SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}" 
${CMAKE_PREFIX_PATH})
 SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}/package" 
${CMAKE_PREFIX_PATH})
 SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}/tools" 
${CMAKE_PREFIX_PATH})
 
-SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib:${DEPENDENCY_LIBRARY_PATH}")
-SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib64:${DEPENDENCY_LIBRARY_PATH}")
+#SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib:${DEPENDENCY_LIBRARY_PATH}")
+#SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib64:${DEPENDENCY_LIBRARY_PATH}")
+SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/lib:${DEPENDENCY_LIBRARY_PATH}")
+SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/lib64:${DEPENDENCY_LIBRARY_PATH}")
 
 ##############################################################################
 # Setup build flags
diff --git a/depends/storage/CMakeLists.txt b/depends/storage/CMakeLists.txt
index d2a64c6..e8eb968 100644
--- a/depends/storage/CMakeLists.txt
+++ b/depends/storage/CMakeLists.txt
@@ -1,10 +1,13 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 PROJECT(storage)
 
+SET(CMAKE_VERBOSE_MAKEFILE ON CACHE STRING "Verbose build." FORCE)
+
 ##############################################################################
 # General CMake initialization
 ##############################################################################
 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
+SET(DOXYFILE_PATH ${CMAKE_SOURCE_DIR}/docs)
 SET(CMAKE_VERBOSE_MAKEFILE OFF CACHE STRING "Verbose build." FORCE)
 
 IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
diff --git a/depends/storage/Makefile b/depends/storage/Makefile
new file mode 100644
index 0000000..3a2508e
--- /dev/null
+++ b/depends/storage/Makefile
@@ -0,0 +1,76 @@
+# 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.
+#
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
+subdir = depends/storage
+top_builddir = ../../
+include Makefile.global
+
+PRE_CFG_ARG =
+# get argument for running ../boostrap
+ifeq ($(enable_debug), yes)
+       PRE_CFG_ARG += --enable-debug
+endif # enable_debug
+
+ifeq ($(enable_coverage), yes)
+       PRE_CFG_ARG += --enable-coverage
+endif # enable_coverage
+
+##########################################################################
+#
+.PHONY: build all install distclean maintainer-clean clean pre-config
+
+ifeq ($(with_storage), yes)
+
+# We will need to install it temporarily under build/install for hawq building.
+all: build
+       cd $(top_builddir)/$(subdir)/build; mkdir -p install; \
+       $(MAKE) DESTDIR=$(abs_top_builddir)/$(subdir)/build/install install
+
+install: build
+       cd $(top_builddir)/$(subdir)/build && $(MAKE) install
+
+distclean:
+       rm -rf $(top_builddir)/$(subdir)/build
+
+maintainer-clean: distclean
+
+clean:
+       if [ -d $(top_builddir)/$(subdir)/build ]; then \
+               cd $(top_builddir)/$(subdir)/build && $(MAKE) clean && rm -f 
storage_build_timestamp; \
+       fi
+
+build: pre-config
+       cd $(top_builddir)/$(subdir)/build && $(MAKE)
+
+# trigger bootstrap only once.
+pre-config:
+       cd $(top_builddir)/$(subdir)/; \
+       mkdir -p build; \
+       cd build; \
+       if [ ! -f storage_build_timestamp ]; then \
+               $(abs_top_srcdir)/$(subdir)/bootstrap --prefix=$(prefix) 
$(PRE_CFG_ARG) && touch storage_build_timestamp; \
+       fi
+
+else
+
+all install distclean maintainer-clean clean pre-config:
+
+endif
diff --git a/depends/Makefile b/depends/storage/Makefile.global
similarity index 56%
copy from depends/Makefile
copy to depends/storage/Makefile.global
index 739e200..a2e43f1 100644
--- a/depends/Makefile
+++ b/depends/storage/Makefile.global
@@ -15,20 +15,26 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
 
-.PHONY: release debug
+prefix := /usr/local/hawq
+enable_debug    = no
+enable_coverage = no
+with_storage = yes
 
-incremental:
-       ./build-all.sh incremental
+# Support for VPATH builds
+vpath_build = no
+abs_top_srcdir = /Users/tuyu/hawq
+abs_top_builddir = /Users/tuyu/hawq
 
-release:
-       ./build-all.sh release
+ifneq ($(vpath_build),yes)
+top_srcdir = $(top_builddir)
+srcdir = .
+else # vpath_build = yes
+top_srcdir = $(abs_top_srcdir)
+srcdir = $(top_srcdir)/$(subdir)
 
-debug: 
-       ./build-all.sh debug
-
-coverage:
-       ./build-all.sh coverage
-
-noavx:
-       ./build-all.sh noavx
+endif
diff --git a/depends/Makefile b/depends/storage/Makefile.global.in
similarity index 54%
copy from depends/Makefile
copy to depends/storage/Makefile.global.in
index 739e200..96791c3 100644
--- a/depends/Makefile
+++ b/depends/storage/Makefile.global.in
@@ -15,20 +15,26 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
 
-.PHONY: release debug
+prefix := @prefix@
+enable_debug    = @enable_debug@
+enable_coverage = @enable_coverage@
+with_storage = @with_storage@
 
-incremental:
-       ./build-all.sh incremental
+# Support for VPATH builds
+vpath_build = @vpath_build@
+abs_top_srcdir = @abs_top_srcdir@
+abs_top_builddir = @abs_top_builddir@
 
-release:
-       ./build-all.sh release
-
-debug: 
-       ./build-all.sh debug
-
-coverage:
-       ./build-all.sh coverage
-
-noavx:
-       ./build-all.sh noavx
+ifneq ($(vpath_build),yes)
+top_srcdir = $(top_builddir)
+srcdir = .
+else # vpath_build = yes
+top_srcdir = $(abs_top_srcdir)
+srcdir = $(top_srcdir)/$(subdir)
+VPATH = $(srcdir)
+endif
diff --git a/depends/storage/README b/depends/storage/README
index f67eafe..86c7984 100644
--- a/depends/storage/README
+++ b/depends/storage/README
@@ -4,7 +4,7 @@
     cd storage
     mkdir build
     cd build
-    ../bootstrap --prefix=/opt/dependency/package (default)
+       ../bootstrap --prefix=/usr/local/hawq (default)
 
 ## Build
 
diff --git a/depends/storage/bootstrap b/depends/storage/bootstrap
index 36fd66c..51a8a24 100755
--- a/depends/storage/bootstrap
+++ b/depends/storage/bootstrap
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # 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
@@ -16,22 +16,30 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-
 die() {
     echo "$@" 1>&2 ; exit 1
 }
 
-arg ()
-{
-    echo "$1" | sed "s/^${2-[^=]*=}//"
+arg () {
+    echo "$1" | sed "s/^${2-[^=]*=}//" | sed "s/:/;/g"
 }
 
+export CMAKE_INCLUDE_PATH=/usr/local/include
+export CMAKE_LIBRARY_PATH=/usr/local/lib
+
 # Detect directory information.
 source_dir=`cd "\`dirname \"$0\"\`";pwd`
 binary_dir=`pwd`
 
 # Choose the default install prefix.
-default_prefix="/opt/dependency/package"
+default_prefix=${source_dir}/dist
+
+# Choose the default dependency install prefix
+default_dependency=${DEPENDENCY_INSTALL_PREFIX}
+
+if [ x"${default_dependency}" = x"" ]; then
+    default_dependency="/opt/dependency"
+fi
 
 # Display bootstrap usage
 usage() {
@@ -42,27 +50,52 @@ Configuration:
     --help                          print this message
     --prefix=PREFIX                 install files in tree rooted at PREFIX
                                     ['"${default_prefix}"']
-    --enable-coverage               enable code coverage, must be used 
together with --enable-debug
+    --dependency=DIRs               specify the dependencies at DIRs, 
separated by colon
+                                    ['"${default_dependency}"']
     --enable-debug                  enable debug build
-    --enable-avx                    enable avx for vector instruction 
optimization
+    --enable-boost                  force to enable boost
+    --enable-coverage               enable build with code coverage support
+    --enable-libc++                 using libc++ instead of libstdc++, only 
valid for clang compiler
+
+Dependencies:
+    c/c++ compiler
+    GNU make
+    cmake           http://www.cmake.org/
+    protobuf        https://code.google.com/p/protobuf/
+    kerberos        http://web.mit.edu/kerberos/
+    libgsasl        http://www.gnu.org/software/gsasl/
+    libxml2         http://xmlsoft.org/
+    libuuid         http://sourceforge.net/projects/libuuid/
+    boost 1.53+     http://www.boost.org/
+                    [boost is not required if c++ compiler is g++ 4.6.0+ or 
clang++ with stdc++]
+
+Example:
+    mkdir build
+    cd build
+    ../bootstrap --prefix=/path/to/install 
--dependency=/path/to/protobuf:/path/to/kerberos/:path/to/others
+    make
+    make install
 '
     exit 10
 }
 
 # Parse arguments
-prefix_dir="${default_prefix}"
+prefix_dirs="${default_prefix}"
+dependency_dir="${default_dependency}"
 build_type="Release"
+enable_boost="OFF"
 enable_coverage="OFF"
-enable_avx="ON"
+enable_clang_lib="OFF"
 while test $# != 0; do
     case "$1" in
     --prefix=*) dir=`arg "$1"`
-                prefix_dir="$dir";;
-       --enable-coverage) enable_coverage="ON"
-                       build_type="Debug";;
-    --enable-debug) build_type="Debug";;
-    --enable-avx=*) avx=`arg "$1"`
-                    enable_avx="$avx";;
+                prefix_dirs="$dir";;
+    --dependency=*) dir=`arg "$1"`
+                dependency_dir="$dir";;
+    --enable-debug) enable_build="ON";;
+    --enable-boost) enable_boost="ON";;
+    --enable-coverage) enable_coverage="ON";;
+    --enable-libc++) enable_clang_lib="ON";;
     --help) usage ;;
     *) die "Unknown option: $1" ;;
     esac
@@ -70,12 +103,7 @@ while test $# != 0; do
 done
 
 if [ ${source_dir} = ${binary_dir} ]; then
-       die "cannot build the project in the source directory! Out-of-source 
build is enforced!"
-fi
-
-enable_avx_upper=`echo "${enable_avx}" | tr [a-z] [A-Z]`
-if [ ${enable_avx_upper} != "ON" ] && [ ${enable_avx_upper} != "OFF" ]; then
-    die "unknown value for option enable-avx: ${enable_avx}, valid options 
are: on and off"
+    die "cannot build the project in the source directory! Out-of-source build 
is enforced!"
 fi
 
 # Check clang compiler
@@ -91,19 +119,23 @@ c_compiler=`which ${CC}`
 cxx_compiler=`which ${CXX}`
 cmake=`which cmake`
 
-if [ ! -x ${c_compiler} ]; then
+if [[ ! -x ${c_compiler} ]]; then
     die "cannot found c compiler"
 fi
 
-if [ ! -x ${cxx_compiler} ]; then
-    die "cannot found c++ compiler"
+if [[ ! -x ${cxx_compiler} ]]; then
+    die "cannot found cplusplus compiler"
 fi
 
-if [ ! -x ${cmake} ]; then
+if [[ ! -x ${cmake} ]]; then
     die "cannot found cmake"
 fi
 
 # Configure 
-${cmake} -DCMAKE_BUILD_TYPE=${build_type} -DCMAKE_INSTALL_PREFIX=${prefix_dir} 
-DCMAKE_C_COMPILER=${c_compiler} -DCMAKE_CXX_COMPILER=${cxx_compiler} 
-DENABLE_COVERAGE=${enable_coverage} -DENABLE_AVX=${enable_avx_upper} 
${source_dir} || die "failed to configure the project"
+${cmake} -DENABLE_DEBUG=${enable_build} -DCMAKE_INSTALL_PREFIX=${prefix_dirs} \
+    -DCMAKE_C_COMPILER=${c_compiler} -DCMAKE_CXX_COMPILER=${cxx_compiler} \
+    -DCMAKE_PREFIX_PATH=${dependency_dir} -DENABLE_BOOST=${enable_boost} \
+    -DENABLE_COVERAGE=${enable_coverage} -DENABLE_LIBCPP=${enable_clang_lib} 
${source_dir} \
+    || die "failed to configure the project"
 
 echo 'bootstrap success. Run "make" to build.'
diff --git a/depends/storage/src/CMakeLists.txt 
b/depends/storage/src/CMakeLists.txt
index dd7ed3b..dd6f1ac 100644
--- a/depends/storage/src/CMakeLists.txt
+++ b/depends/storage/src/CMakeLists.txt
@@ -42,11 +42,16 @@ AUTO_SOURCES(orc_format_HEADER "*.h" 
"${storage_SRC_DIR}/format/orc")
 AUTO_SOURCES(testutil_HEADER "*.h" "${storage_SRC_DIR}/testutil")
 
 INCLUDE_DIRECTORIES(${storage_ROOT_DIR})
-INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
+#INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
+INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/include)
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
 INCLUDE_DIRECTORIES(/usr/local/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../univplan/build/install/usr/local/hawq/include)
 LINK_DIRECTORIES(/usr/local/lib)
-LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+#LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/lib)
+LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../libhdfs3/build/install/usr/local/hawq/lib)
+LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../univplan/build/install/usr/local/hawq/lib)
 
 
 ADD_LIBRARY(storage-shared SHARED ${storage_SOURCES} ${storage_PROTO_SRCS} 
${storage_PROTO_HDRS})
diff --git a/depends/storage/test/CMakeLists.txt 
b/depends/storage/test/CMakeLists.txt
index 2092b56..94b7b7e 100644
--- a/depends/storage/test/CMakeLists.txt
+++ b/depends/storage/test/CMakeLists.txt
@@ -7,7 +7,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-access-control")
 
 INCLUDE_DIRECTORIES(${storage_ROOT_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
-INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
+INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/include)
 INCLUDE_DIRECTORIES(/usr/local/include)
 LINK_DIRECTORIES(/usr/local/lib)
 
diff --git a/depends/storage/test/unit/CMakeLists.txt 
b/depends/storage/test/unit/CMakeLists.txt
index e57aaeb..f922dce 100644
--- a/depends/storage/test/unit/CMakeLists.txt
+++ b/depends/storage/test/unit/CMakeLists.txt
@@ -14,7 +14,7 @@ INCLUDE_DIRECTORIES(${storage_ROOT_DIR}/test/unit)
 INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
 
 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
-LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/lib)
 
 ADD_EXECUTABLE(unit EXCLUDE_FROM_ALL
     ${unit_SOURCES}
diff --git a/depends/univplan/CMake/FindJSON.cmake 
b/depends/univplan/CMake/FindJSON.cmake
index a334948..ff5008b 100644
--- a/depends/univplan/CMake/FindJSON.cmake
+++ b/depends/univplan/CMake/FindJSON.cmake
@@ -20,7 +20,7 @@
 #  License text for the above reference.)
 
 # Look for the header file.
-find_path(JSON_INCLUDE_DIR NAMES json/json.h)
+find_path(JSON_INCLUDE_DIR NAMES json-c/json.h)
 mark_as_advanced(JSON_INCLUDE_DIR)
 
 # Look for the library (sorted from most current/relevant entry to least).
diff --git a/depends/univplan/CMake/Options.cmake 
b/depends/univplan/CMake/Options.cmake
index 36841ea..8be997e 100644
--- a/depends/univplan/CMake/Options.cmake
+++ b/depends/univplan/CMake/Options.cmake
@@ -5,7 +5,8 @@
 ##############################################################################
 # Setup build and dependencies information 
 ##############################################################################
-SET(DEPENDENCY_INSTALL_PREFIX "/opt/dependency")
+#SET(DEPENDENCY_INSTALL_PREFIX "/opt/dependency")
+SET(DEPENDENCY_INSTALL_PREFIX "/usr/local/hawq")
 IF($ENV{DEPENDENCY_INSTALL_PREFIX})
        SET(DEPENDENCY_INSTALL_PREFIX $ENV{DEPENDENCY_INSTALL_PREFIX})
 ENDIF()
@@ -19,8 +20,10 @@ SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}" 
${CMAKE_PREFIX_PATH})
 SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}/package" 
${CMAKE_PREFIX_PATH})
 SET(CMAKE_PREFIX_PATH "${DEPENDENCY_INSTALL_PREFIX}/tools" 
${CMAKE_PREFIX_PATH})
 
-SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib:${DEPENDENCY_LIBRARY_PATH}")
-SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib64:${DEPENDENCY_LIBRARY_PATH}")
+#SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib:${DEPENDENCY_LIBRARY_PATH}")
+#SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/package/lib64:${DEPENDENCY_LIBRARY_PATH}")
+SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/lib:${DEPENDENCY_LIBRARY_PATH}")
+SET(DEPENDENCY_LIBRARY_PATH 
"${DEPENDENCY_INSTALL_PREFIX}/lib64:${DEPENDENCY_LIBRARY_PATH}")
 
 ##############################################################################
 # Setup build flags
diff --git a/depends/univplan/CMakeLists.txt b/depends/univplan/CMakeLists.txt
index f25ad2c..789ec87 100644
--- a/depends/univplan/CMakeLists.txt
+++ b/depends/univplan/CMakeLists.txt
@@ -1,10 +1,13 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 PROJECT(univplan)
 
+SET(CMAKE_VERBOSE_MAKEFILE ON CACHE STRING "Verbose build." FORCE)
+
 ##############################################################################
 # General CMake initialization
 ##############################################################################
 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
+SET(DOXYFILE_PATH ${CMAKE_SOURCE_DIR}/docs)
 SET(CMAKE_VERBOSE_MAKEFILE OFF CACHE STRING "Verbose build." FORCE)
 
 IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
diff --git a/depends/univplan/Makefile b/depends/univplan/Makefile
new file mode 100644
index 0000000..b0c6f47
--- /dev/null
+++ b/depends/univplan/Makefile
@@ -0,0 +1,76 @@
+# 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.
+#
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
+subdir = depends/univplan
+top_builddir = ../../
+include Makefile.global
+
+PRE_CFG_ARG =
+# get argument for running ../boostrap
+ifeq ($(enable_debug), yes)
+       PRE_CFG_ARG += --enable-debug
+endif # enable_debug
+
+ifeq ($(enable_coverage), yes)
+       PRE_CFG_ARG += --enable-coverage
+endif # enable_coverage
+
+##########################################################################
+#
+.PHONY: build all install distclean maintainer-clean clean pre-config
+
+ifeq ($(with_univplan), yes)
+
+# We will need to install it temporarily under build/install for hawq building.
+all: build
+       cd $(top_builddir)/$(subdir)/build; mkdir -p install; \
+       $(MAKE) DESTDIR=$(abs_top_builddir)/$(subdir)/build/install install
+
+install: build
+       cd $(top_builddir)/$(subdir)/build && $(MAKE) install
+
+distclean:
+       rm -rf $(top_builddir)/$(subdir)/build
+
+maintainer-clean: distclean
+
+clean:
+       if [ -d $(top_builddir)/$(subdir)/build ]; then \
+               cd $(top_builddir)/$(subdir)/build && $(MAKE) clean && rm -f 
univplan_build_timestamp; \
+       fi
+
+build: pre-config
+       cd $(top_builddir)/$(subdir)/build && $(MAKE)
+
+# trigger bootstrap only once.
+pre-config:
+       cd $(top_builddir)/$(subdir)/; \
+       mkdir -p build; \
+       cd build; \
+       if [ ! -f univplan_build_timestamp ]; then \
+               $(abs_top_srcdir)/$(subdir)/bootstrap --prefix=$(prefix) 
$(PRE_CFG_ARG) && touch univplan_build_timestamp; \
+       fi
+
+else
+
+all install distclean maintainer-clean clean pre-config:
+
+endif
diff --git a/depends/Makefile b/depends/univplan/Makefile.global
similarity index 56%
copy from depends/Makefile
copy to depends/univplan/Makefile.global
index 739e200..a981862 100644
--- a/depends/Makefile
+++ b/depends/univplan/Makefile.global
@@ -15,20 +15,26 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
 
-.PHONY: release debug
+prefix := /usr/local/hawq
+enable_debug    = no
+enable_coverage = no
+with_univplan = yes
 
-incremental:
-       ./build-all.sh incremental
+# Support for VPATH builds
+vpath_build = no
+abs_top_srcdir = /Users/tuyu/hawq
+abs_top_builddir = /Users/tuyu/hawq
 
-release:
-       ./build-all.sh release
+ifneq ($(vpath_build),yes)
+top_srcdir = $(top_builddir)
+srcdir = .
+else # vpath_build = yes
+top_srcdir = $(abs_top_srcdir)
+srcdir = $(top_srcdir)/$(subdir)
 
-debug: 
-       ./build-all.sh debug
-
-coverage:
-       ./build-all.sh coverage
-
-noavx:
-       ./build-all.sh noavx
+endif
diff --git a/depends/Makefile b/depends/univplan/Makefile.global.in
similarity index 54%
rename from depends/Makefile
rename to depends/univplan/Makefile.global.in
index 739e200..07bacea 100644
--- a/depends/Makefile
+++ b/depends/univplan/Makefile.global.in
@@ -15,20 +15,26 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+# -*-makefile-*-
+#------------------------------------------------------------------------------
+# A makefile that integrate building this module with hawq
+#------------------------------------------------------------------------------
 
-.PHONY: release debug
+prefix := @prefix@
+enable_debug    = @enable_debug@
+enable_coverage = @enable_coverage@
+with_univplan = @with_univplan@
 
-incremental:
-       ./build-all.sh incremental
+# Support for VPATH builds
+vpath_build = @vpath_build@
+abs_top_srcdir = @abs_top_srcdir@
+abs_top_builddir = @abs_top_builddir@
 
-release:
-       ./build-all.sh release
-
-debug: 
-       ./build-all.sh debug
-
-coverage:
-       ./build-all.sh coverage
-
-noavx:
-       ./build-all.sh noavx
+ifneq ($(vpath_build),yes)
+top_srcdir = $(top_builddir)
+srcdir = .
+else # vpath_build = yes
+top_srcdir = $(abs_top_srcdir)
+srcdir = $(top_srcdir)/$(subdir)
+VPATH = $(srcdir)
+endif
diff --git a/depends/univplan/bootstrap b/depends/univplan/bootstrap
index 36fd66c..51a8a24 100755
--- a/depends/univplan/bootstrap
+++ b/depends/univplan/bootstrap
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # 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
@@ -16,22 +16,30 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-
 die() {
     echo "$@" 1>&2 ; exit 1
 }
 
-arg ()
-{
-    echo "$1" | sed "s/^${2-[^=]*=}//"
+arg () {
+    echo "$1" | sed "s/^${2-[^=]*=}//" | sed "s/:/;/g"
 }
 
+export CMAKE_INCLUDE_PATH=/usr/local/include
+export CMAKE_LIBRARY_PATH=/usr/local/lib
+
 # Detect directory information.
 source_dir=`cd "\`dirname \"$0\"\`";pwd`
 binary_dir=`pwd`
 
 # Choose the default install prefix.
-default_prefix="/opt/dependency/package"
+default_prefix=${source_dir}/dist
+
+# Choose the default dependency install prefix
+default_dependency=${DEPENDENCY_INSTALL_PREFIX}
+
+if [ x"${default_dependency}" = x"" ]; then
+    default_dependency="/opt/dependency"
+fi
 
 # Display bootstrap usage
 usage() {
@@ -42,27 +50,52 @@ Configuration:
     --help                          print this message
     --prefix=PREFIX                 install files in tree rooted at PREFIX
                                     ['"${default_prefix}"']
-    --enable-coverage               enable code coverage, must be used 
together with --enable-debug
+    --dependency=DIRs               specify the dependencies at DIRs, 
separated by colon
+                                    ['"${default_dependency}"']
     --enable-debug                  enable debug build
-    --enable-avx                    enable avx for vector instruction 
optimization
+    --enable-boost                  force to enable boost
+    --enable-coverage               enable build with code coverage support
+    --enable-libc++                 using libc++ instead of libstdc++, only 
valid for clang compiler
+
+Dependencies:
+    c/c++ compiler
+    GNU make
+    cmake           http://www.cmake.org/
+    protobuf        https://code.google.com/p/protobuf/
+    kerberos        http://web.mit.edu/kerberos/
+    libgsasl        http://www.gnu.org/software/gsasl/
+    libxml2         http://xmlsoft.org/
+    libuuid         http://sourceforge.net/projects/libuuid/
+    boost 1.53+     http://www.boost.org/
+                    [boost is not required if c++ compiler is g++ 4.6.0+ or 
clang++ with stdc++]
+
+Example:
+    mkdir build
+    cd build
+    ../bootstrap --prefix=/path/to/install 
--dependency=/path/to/protobuf:/path/to/kerberos/:path/to/others
+    make
+    make install
 '
     exit 10
 }
 
 # Parse arguments
-prefix_dir="${default_prefix}"
+prefix_dirs="${default_prefix}"
+dependency_dir="${default_dependency}"
 build_type="Release"
+enable_boost="OFF"
 enable_coverage="OFF"
-enable_avx="ON"
+enable_clang_lib="OFF"
 while test $# != 0; do
     case "$1" in
     --prefix=*) dir=`arg "$1"`
-                prefix_dir="$dir";;
-       --enable-coverage) enable_coverage="ON"
-                       build_type="Debug";;
-    --enable-debug) build_type="Debug";;
-    --enable-avx=*) avx=`arg "$1"`
-                    enable_avx="$avx";;
+                prefix_dirs="$dir";;
+    --dependency=*) dir=`arg "$1"`
+                dependency_dir="$dir";;
+    --enable-debug) enable_build="ON";;
+    --enable-boost) enable_boost="ON";;
+    --enable-coverage) enable_coverage="ON";;
+    --enable-libc++) enable_clang_lib="ON";;
     --help) usage ;;
     *) die "Unknown option: $1" ;;
     esac
@@ -70,12 +103,7 @@ while test $# != 0; do
 done
 
 if [ ${source_dir} = ${binary_dir} ]; then
-       die "cannot build the project in the source directory! Out-of-source 
build is enforced!"
-fi
-
-enable_avx_upper=`echo "${enable_avx}" | tr [a-z] [A-Z]`
-if [ ${enable_avx_upper} != "ON" ] && [ ${enable_avx_upper} != "OFF" ]; then
-    die "unknown value for option enable-avx: ${enable_avx}, valid options 
are: on and off"
+    die "cannot build the project in the source directory! Out-of-source build 
is enforced!"
 fi
 
 # Check clang compiler
@@ -91,19 +119,23 @@ c_compiler=`which ${CC}`
 cxx_compiler=`which ${CXX}`
 cmake=`which cmake`
 
-if [ ! -x ${c_compiler} ]; then
+if [[ ! -x ${c_compiler} ]]; then
     die "cannot found c compiler"
 fi
 
-if [ ! -x ${cxx_compiler} ]; then
-    die "cannot found c++ compiler"
+if [[ ! -x ${cxx_compiler} ]]; then
+    die "cannot found cplusplus compiler"
 fi
 
-if [ ! -x ${cmake} ]; then
+if [[ ! -x ${cmake} ]]; then
     die "cannot found cmake"
 fi
 
 # Configure 
-${cmake} -DCMAKE_BUILD_TYPE=${build_type} -DCMAKE_INSTALL_PREFIX=${prefix_dir} 
-DCMAKE_C_COMPILER=${c_compiler} -DCMAKE_CXX_COMPILER=${cxx_compiler} 
-DENABLE_COVERAGE=${enable_coverage} -DENABLE_AVX=${enable_avx_upper} 
${source_dir} || die "failed to configure the project"
+${cmake} -DENABLE_DEBUG=${enable_build} -DCMAKE_INSTALL_PREFIX=${prefix_dirs} \
+    -DCMAKE_C_COMPILER=${c_compiler} -DCMAKE_CXX_COMPILER=${cxx_compiler} \
+    -DCMAKE_PREFIX_PATH=${dependency_dir} -DENABLE_BOOST=${enable_boost} \
+    -DENABLE_COVERAGE=${enable_coverage} -DENABLE_LIBCPP=${enable_clang_lib} 
${source_dir} \
+    || die "failed to configure the project"
 
 echo 'bootstrap success. Run "make" to build.'
diff --git a/depends/univplan/src/CMakeLists.txt 
b/depends/univplan/src/CMakeLists.txt
index f53e3a7..ffc4380 100644
--- a/depends/univplan/src/CMakeLists.txt
+++ b/depends/univplan/src/CMakeLists.txt
@@ -44,9 +44,10 @@ AUTO_SOURCES(testutil_HEADER "*.h" 
"${univplan_SRC_DIR}/testutil")
 
 INCLUDE_DIRECTORIES(${univplan_ROOT_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
-INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
-
-LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/include)
+INCLUDE_DIRECTORIES(/usr/local/include)
+LINK_DIRECTORIES(/usr/local/lib)
+LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/lib)
 
 
 ADD_LIBRARY(univplan-shared SHARED
diff --git a/depends/univplan/test/CMakeLists.txt 
b/depends/univplan/test/CMakeLists.txt
index 088ab7f..a98bb5b 100644
--- a/depends/univplan/test/CMakeLists.txt
+++ b/depends/univplan/test/CMakeLists.txt
@@ -7,10 +7,10 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-access-control")
 
 INCLUDE_DIRECTORIES(${univplan_ROOT_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
-INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/include)
+INCLUDE_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/include)
 
 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
-LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/package/lib)
+LINK_DIRECTORIES(${DEPENDENCY_INSTALL_PREFIX}/lib)
 
 ADD_SUBDIRECTORY(unit)
 

Reply via email to