THRIFT-2962:Docker Thrift env for development and testing
Client: build
Patch: jfarrell
Adds build folder and moves all travis, cmake and docker build scripts into
one location for easier maintainability.
diff --git a/build/cmake/CPackConfig.cmake b/build/cmake/CPackConfig.cmake
new file mode 100644
index 0000000..0941a80
--- /dev/null
+++ b/build/cmake/CPackConfig.cmake
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+
+
+#TODO: Should we bundle system libraries for DLLs?
+#include(InstallRequiredSystemLibraries)
+
+# For help take a look at:
+# http://www.cmake.org/Wiki/CMake:CPackConfiguration
+
+### general settings
+set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
+set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Thrift")
+set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
+set(CPACK_PACKAGE_VENDOR "Apache Software Foundation")
+set(CPACK_PACKAGE_CONTACT "dev@thrift.apache.org")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
+set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
+
+### versions
+set(CPACK_PACKAGE_VERSION_MAJOR ${thrift_VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${thrift_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${thrift_VERSION_PATCH})
+
+### source generator
+set(CPACK_SOURCE_GENERATOR "TGZ")
+set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;tags;cscope.*")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
+
+### zip generator
+set(CPACK_GENERATOR "ZIP")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "thrift")
+
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set(CPACK_GENERATOR "NSIS")
+ set(CPACK_NSIS_HELP_LINK "http://thrift.apache.org")
+ set(CPACK_NSIS_MENU_LINKS
+ "http://thrift.apache.org" "Apache Thrift - Web Site"
+ "https://issues.apache.org/jira/browse/THRIFT" "Apache Thrift - Issues")
+ set(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
+ set(CPACK_NSIS_MODIFY_PATH "ON")
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
+else()
+ set(CPACK_GENERATOR "DEB" )
+ set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
+endif()
+
+
+include(CPack)
diff --git a/build/cmake/ConfigureChecks.cmake b/build/cmake/ConfigureChecks.cmake
new file mode 100644
index 0000000..9295d38
--- /dev/null
+++ b/build/cmake/ConfigureChecks.cmake
@@ -0,0 +1,75 @@
+#
+# 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.
+#
+
+
+include(CheckSymbolExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckFunctionExists)
+
+# If AI_ADDRCONFIG is not defined we define it as 0
+check_symbol_exists(AI_ADDRCONFIG "sys/types.h;sys/socket.h;netdb.h" HAVE_AI_ADDRCONFIG)
+if(NOT HAVE_AI_ADDRCONFIG)
+set(AI_ADDRCONFIG 1)
+endif(NOT HAVE_AI_ADDRCONFIG)
+
+check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
+check_include_file(fcntl.h HAVE_FCNTL_H)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
+check_include_file(netdb.h HAVE_NETDB_H)
+check_include_file(netinet/in.h HAVE_NETINET_IN_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+check_include_file(pthread.h HAVE_PTHREAD_H)
+check_include_file(sys/time.h HAVE_SYS_TIME_H)
+check_include_file(sys/param.h HAVE_SYS_PARAM_H)
+check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
+check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(sys/un.h HAVE_SYS_UN_H)
+check_include_file(sys/poll.h HAVE_SYS_POLL_H)
+check_include_file(sys/select.h HAVE_SYS_SELECT_H)
+check_include_file(sched.h HAVE_SCHED_H)
+check_include_file(strings.h HAVE_STRINGS_H)
+
+check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
+check_function_exists(strerror_r HAVE_STRERROR_R)
+check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
+check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
+
+include(CheckCSourceCompiles)
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles(
+ "
+ #include <string.h>
+ int main(){char b;char *a = strerror_r(0, &b, 0); return(0);}
+ "
+ STRERROR_R_CHAR_P)
+
+
+set(PACKAGE ${PACKAGE_NAME})
+set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set(VERSION ${thrift_VERSION})
+
+# generate a config.h file
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
+# HACK: Some files include thrift/config.h and some config.h so we include both. This should be cleaned up.
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/thrift" "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/build/cmake/DefineCMakeDefaults.cmake b/build/cmake/DefineCMakeDefaults.cmake
new file mode 100644
index 0000000..2fe41d3
--- /dev/null
+++ b/build/cmake/DefineCMakeDefaults.cmake
@@ -0,0 +1,58 @@
+#
+# 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.
+#
+
+
+# Always include srcdir and builddir in include path
+# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
+# about every subdir
+# since cmake 2.4.0
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Put the include dirs which are in the source or build tree
+# before all other include dirs, so the headers in the sources
+# are prefered over the already installed ones
+# since cmake 2.4.1
+set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
+
+# Use colored output
+# since cmake 2.4.0
+set(CMAKE_COLOR_MAKEFILE ON)
+
+# Define the generic version of the libraries here
+set(GENERIC_LIB_VERSION "0.1.0")
+set(GENERIC_LIB_SOVERSION "0")
+
+# Set the default build type to release with debug info
+if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE RelWithDebInfo
+ CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+ )
+endif (NOT CMAKE_BUILD_TYPE)
+
+# Create the compile command database for clang by default
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+# Put the libraries and binaries that get built into directories at the
+# top of the build tree rather than in hard-to-find leaf
+# directories. This simplifies manual testing and the use of the build
+# tree rather than installed thrift libraries.
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake
new file mode 100644
index 0000000..122f0f6
--- /dev/null
+++ b/build/cmake/DefineInstallationPaths.cmake
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+
+# Define the default install paths
+set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)")
+set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
+set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
+set(CMAKE_INSTALL_DIR "cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
+set(DOC_INSTALL_DIR "share/doc" CACHE PATH "The subdirectory to install documentation files (default: share/doc)")
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
new file mode 100644
index 0000000..457deb6
--- /dev/null
+++ b/build/cmake/DefineOptions.cmake
@@ -0,0 +1,111 @@
+#
+# 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.
+#
+
+
+include(CMakeDependentOption)
+
+# Additional components
+option(BUILD_COMPILER "Build Thrift compiler" ON)
+option(BUILD_TESTING "Build with unit tests" ON)
+option(BUILD_EXAMPLES "Build examples" ON)
+option(BUILD_LIBRARIES "Build Thrfit libraries" ON)
+
+# Libraries to build
+
+# Each language library can be enabled or disabled using the WITH_<LANG> flag.
+# By default CMake checks if the required dependencies for a language are present
+# and enables the library if all are found. This means the default is to build as
+# much as possible but leaving out libraries if their dependencies are not met.
+
+# C++
+find_package(Boost 1.53 QUIET)
+CMAKE_DEPENDENT_OPTION(WITH_CPP "Build C++ library" ON
+ "BUILD_LIBRARIES;Boost_FOUND" OFF)
+# NOTE: Currently the following options are C++ specific,
+# but in future other libraries might reuse them.
+# So they are not dependent on WIHT_CPP but setting them without WITH_CPP currently
+# has no effect.
+find_package(ZLIB QUIET)
+CMAKE_DEPENDENT_OPTION(WITH_ZLIB "Build with ZLIB support" ON
+ "ZLIB_FOUND" OFF)
+find_package(Libevent QUIET)
+CMAKE_DEPENDENT_OPTION(WITH_LIBEVENT "Build with libevent support" ON
+ "Libevent_FOUND" OFF)
+find_package(Qt4 QUIET COMPONENTS QtCore QtNetwork)
+CMAKE_DEPENDENT_OPTION(WITH_QT4 "Build with Qt4 support" ON
+ "QT4_FOUND" OFF)
+find_package(Qt5 QUIET COMPONENTS Core Network)
+CMAKE_DEPENDENT_OPTION(WITH_QT5 "Build with Qt5 support" ON
+ "Qt5_FOUND" OFF)
+if(${WITH_QT4} AND ${WITH_QT5} AND ${CMAKE_MAJOR_VERSION} LESS 3)
+ # cmake < 3.0.0 causes conflict when building both Qt4 and Qt5
+ set(WITH_QT4 OFF)
+endif()
+find_package(OpenSSL QUIET)
+CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
+ "OPENSSL_FOUND" OFF)
+option(WITH_BOOSTTHREADS "Build with Boost thread support" OFF)
+option(WITH_STDTHREADS "Build with C++ std::thread support" OFF)
+
+# C GLib
+find_package(GLIB QUIET COMPONENTS gobject)
+CMAKE_DEPENDENT_OPTION(WITH_C_GLIB "Build C (GLib) library" ON
+ "BUILD_LIBRARIES;GLIB_FOUND" OFF)
+# Java
+find_package(Java QUIET)
+find_package(Ant QUIET)
+CMAKE_DEPENDENT_OPTION(WITH_JAVA "Build Java library" ON
+ "BUILD_LIBRARIES;JAVA_FOUND;Ant_FOUND" OFF)
+
+# Common library options
+option(WITH_SHARED_LIB "Build shared libraries" ON)
+option(WITH_STATIC_LIB "Build static libraries" ON)
+
+#NOTE: C++ compiler options are defined in the lib/cpp/CMakeLists.txt
+
+# Visual Studio only options
+if(MSVC)
+option(WITH_MT "Build unsing MT instead of MT (MSVC only)" OFF)
+endif(MSVC)
+
+macro(PRINT_CONFIG_SUMMARY)
+message(STATUS "----------------------------------------------------------")
+message(STATUS "Thrift version: ${thrift_VERSION} (${thrift_VERSION_MAJOR}.${thrift_VERSION_MINOR}.${thrift_VERSION_PATCH})")
+message(STATUS "Thrift package version: ${PACKAGE_VERSION}")
+message(STATUS "Build configuration Summary")
+message(STATUS " Build Thrift compiler: ${BUILD_COMPILER}")
+message(STATUS " Build with unit tests: ${BUILD_TESTING}")
+message(STATUS " Build examples: ${BUILD_EXAMPLES}")
+message(STATUS " Build Thrfit libraries: ${BUILD_LIBRARIES}")
+message(STATUS " Language libraries:")
+message(STATUS " Build C++ library: ${WITH_CPP}")
+message(STATUS " Build C (GLib) library: ${WITH_C_GLIB}")
+message(STATUS " Build Java library: ${WITH_JAVA}")
+message(STATUS " Library features:")
+message(STATUS " Build shared libraries: ${WITH_SHARED_LIB}")
+message(STATUS " Build static libraries: ${WITH_STATIC_LIB}")
+message(STATUS " Build with ZLIB support: ${WITH_ZLIB}")
+message(STATUS " Build with libevent support: ${WITH_LIBEVENT}")
+message(STATUS " Build with Qt4 support: ${WITH_QT4}")
+message(STATUS " Build with Qt5 support: ${WITH_QT5}")
+message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}")
+message(STATUS " Build with Boost thread support: ${WITH_BOOSTTHREADS}")
+message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}")
+message(STATUS "----------------------------------------------------------")
+endmacro(PRINT_CONFIG_SUMMARY)
diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake
new file mode 100644
index 0000000..282cad3
--- /dev/null
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -0,0 +1,65 @@
+#
+# 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.
+#
+
+
+# Visual Studio specific options
+if(MSVC)
+ #For visual studio the library naming is as following:
+ # Dynamic libraries:
+ # - thfirt.dll for release library
+ # - thriftd.dll for debug library
+ #
+ # Static libraries:
+ # - thriftmd.lib for /MD release build
+ # - thriftmt.lib for /MT release build
+ #
+ # - thriftmdd.lib for /MD debug build
+ # - thriftmtd.lib for /MT debug build
+ #
+ # the same holds for other libraries like libthriftz etc.
+
+ # For Debug build types, append a "d" to the library names.
+ set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
+ set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set release library postfix" FORCE)
+
+
+ # Build using /MT option instead of /MD if the WITH_MT options is set
+ if(WITH_MT)
+ set(CompilerFlags
+ CMAKE_CXX_FLAGS
+ CMAKE_CXX_FLAGS_DEBUG
+ CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_C_FLAGS
+ CMAKE_C_FLAGS_DEBUG
+ CMAKE_C_FLAGS_RELEASE
+ )
+ foreach(CompilerFlag ${CompilerFlags})
+ string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
+ endforeach()
+ set(STATIC_POSTFIX "mt" CACHE STRING "Set static library postfix" FORCE)
+ else(WITH_MT)
+ set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE)
+ endif(WITH_MT)
+endif(MSVC)
+
+# GCC Specific
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ # TODO: -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
+ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -pedantic")
+endif()
diff --git a/build/cmake/FindAnt.cmake b/build/cmake/FindAnt.cmake
new file mode 100644
index 0000000..16b9afd
--- /dev/null
+++ b/build/cmake/FindAnt.cmake
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+
+
+# Ant_FOUND - system has Ant
+# Ant_EXECUTBALE - the Ant executable
+#
+# It will search the environment variable ANT_HOME if it is set
+
+include(FindPackageHandleStandardArgs)
+
+find_program(Ant_EXECUTABLE NAMES ant PATHS $ENV{ANT_HOME}/bin)
+find_package_handle_standard_args(Ant DEFAULT_MSG Ant_EXECUTABLE)
+mark_as_advanced(Ant_EXECUTABLE)
diff --git a/build/cmake/FindGLIB.cmake b/build/cmake/FindGLIB.cmake
new file mode 100644
index 0000000..acbe433
--- /dev/null
+++ b/build/cmake/FindGLIB.cmake
@@ -0,0 +1,122 @@
+# - Try to find Glib and its components (gio, gobject etc)
+# Once done, this will define
+#
+# GLIB_FOUND - system has Glib
+# GLIB_INCLUDE_DIRS - the Glib include directories
+# GLIB_LIBRARIES - link these to use Glib
+#
+# Optionally, the COMPONENTS keyword can be passed to find_package()
+# and Glib components can be looked for. Currently, the following
+# components can be used, and they define the following variables if
+# found:
+#
+# gio: GLIB_GIO_LIBRARIES
+# gobject: GLIB_GOBJECT_LIBRARIES
+# gmodule: GLIB_GMODULE_LIBRARIES
+# gthread: GLIB_GTHREAD_LIBRARIES
+#
+# Note that the respective _INCLUDE_DIR variables are not set, since
+# all headers are in the same directory as GLIB_INCLUDE_DIRS.
+#
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+find_package(PkgConfig)
+pkg_check_modules(PC_GLIB QUIET glib-2.0)
+
+find_library(GLIB_LIBRARIES
+ NAMES glib-2.0
+ HINTS ${PC_GLIB_LIBDIR}
+ ${PC_GLIB_LIBRARY_DIRS}
+)
+
+# Files in glib's main include path may include glibconfig.h, which,
+# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
+get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
+find_path(GLIBCONFIG_INCLUDE_DIR
+ NAMES glibconfig.h
+ HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
+ ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0/include
+)
+
+find_path(GLIB_INCLUDE_DIR
+ NAMES glib.h
+ HINTS ${PC_GLIB_INCLUDEDIR}
+ ${PC_GLIB_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0
+)
+
+set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
+
+if(GLIBCONFIG_INCLUDE_DIR)
+ # Version detection
+ file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
+ string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+ set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+ set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+ set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
+ set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
+endif()
+
+# Additional Glib components. We only look for libraries, as not all of them
+# have corresponding headers and all headers are installed alongside the main
+# glib ones.
+foreach (_component ${GLIB_FIND_COMPONENTS})
+ if (${_component} STREQUAL "gio")
+ find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
+ elseif (${_component} STREQUAL "gobject")
+ find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
+ elseif (${_component} STREQUAL "gmodule")
+ find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
+ elseif (${_component} STREQUAL "gthread")
+ find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
+ elseif (${_component} STREQUAL "gio-unix")
+ # gio-unix is compiled as part of the gio library, but the include paths
+ # are separate from the shared glib ones. Since this is currently only used
+ # by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
+ pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
+ endif ()
+endforeach ()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
+ VERSION_VAR GLIB_VERSION)
+
+mark_as_advanced(
+ GLIBCONFIG_INCLUDE_DIR
+ GLIB_GIO_LIBRARIES
+ GLIB_GIO_UNIX_LIBRARIES
+ GLIB_GMODULE_LIBRARIES
+ GLIB_GOBJECT_LIBRARIES
+ GLIB_GTHREAD_LIBRARIES
+ GLIB_INCLUDE_DIR
+ GLIB_INCLUDE_DIRS
+ GLIB_LIBRARIES
+)
diff --git a/build/cmake/README.md b/build/cmake/README.md
new file mode 100644
index 0000000..a5dde19
--- /dev/null
+++ b/build/cmake/README.md
@@ -0,0 +1,54 @@
+# Apache Thrift - CMake build
+
+## Goal
+Extend Apache Thrift's *make cross* approach to the build system.
+
+Due to growing the field of operating system support, a proper executable
+and library detection mechanism running on as much platforms as possible
+becomes required. The other aspect to simplify the release process and
+package generation process.
+
+As nice side benefit of CMake is the generation of development environment
+specific soultion files. => No solution files within source tree.
+
+
+## Usage
+just do this:
+
+ mkdir build
+ cmake ${THRIFT_SRC}
+
+if you use a specific toolchain pass it to cmake, the same for options:
+
+ cmake -DCMAKE_TOOLCHAIN_FILE=${THRIFT_SRC}/contrib/mingw32-toolchain.cmake ${THRIFT_SRC}
+ cmake -DTHRIFT_COMPILER_HS=OFF ${THRIFT_SRC}
+ cmake -DWITH_ZLIB=ON ${THRIFT_SRC}
+
+and open the development environment you like with the solution or do this:
+
+ make
+ make check
+ make cross
+ make dist
+
+to generate an installer and distribution package do this:
+
+ cpack
+
+## TODO
+* git hash or tag based versioning depending on source state
+* build tutorial
+* build test
+* with/without language lib/<lang>/
+* enable/disable
+* make check (QUESTION: Is test the default CMake target?)
+* make cross
+* make dist (create an alias to make package_source)
+* make doc
+* cpack (C++ and make dist only ?)
+ * thrift-compiler
+ * libthrift
+ * tutorial
+ * test
+* merge into /README.md
+
diff --git a/build/cmake/ThriftMacros.cmake b/build/cmake/ThriftMacros.cmake
new file mode 100644
index 0000000..d35ec10
--- /dev/null
+++ b/build/cmake/ThriftMacros.cmake
@@ -0,0 +1,67 @@
+#
+# 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.
+#
+
+
+set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
+
+
+macro(ADD_LIBRARY_THRIFT name)
+
+if(WITH_SHARED_LIB)
+ add_library(${name} SHARED ${ARGN})
+ #target_link_libraries(${name} ${SYSLIBS})
+ set_target_properties(${name} PROPERTIES
+ OUTPUT_NAME ${name}
+ VERSION ${thrift_VERSION}
+ SOVERSION ${thrift_VERSION} )
+ #set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
+ install(TARGETS ${name}
+ RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
+ ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
+ PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
+endif()
+
+if(WITH_STATIC_LIB)
+ add_library(${name}_static STATIC ${ARGN})
+ #target_link_libraries(${name}_static ${SYSLIBS})
+ set_target_properties(${name}_static PROPERTIES
+ OUTPUT_NAME ${name}${STATIC_POSTFIX}
+ VERSION ${thrift_VERSION}
+ SOVERSION ${thrift_VERSION} )
+ install(TARGETS ${name}_static
+ RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
+ ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
+ PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
+endif()
+
+endmacro()
+
+macro(TARGET_LINK_LIBRARIES_THRIFT name)
+
+if(WITH_SHARED_LIB)
+ target_link_libraries(${name} ${ARGN})
+endif()
+
+if(WITH_STATIC_LIB)
+ target_link_libraries(${name}_static ${ARGN})
+endif()
+
+endmacro()
\ No newline at end of file
diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in
new file mode 100644
index 0000000..8b75e8c
--- /dev/null
+++ b/build/cmake/config.h.in
@@ -0,0 +1,157 @@
+/*
+ * 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.
+ */
+
+/* config.h generated by CMake from config.h.in */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+
+/* Name of package */
+#cmakedefine PACKAGE "${PACKAGE}"
+
+/* Define to the address where bug reports for this package should be sent. */
+#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
+
+/* Define to the full name of this package. */
+#cmakedefine PACKAGE_NAME "${PACKAGE_NAME}"
+
+/* Define to the one symbol short name of this package. */
+#cmakedefine PACKAGE_TARNAME "${PACKAGE_TARNAME}"
+
+/* Define to the home page for this package. */
+#cmakedefine PACKAGE_URL "${PACKAGE_URL}"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "${PACKAGE_VERSION}"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "${PACKAGE_STRING}"
+
+/* Version number of package */
+#define VERSION "${VERSION}"
+
+/************************** DEFINES *************************/
+
+/* Define if the AI_ADDRCONFIG symbol is unavailable */
+#cmakedefine AI_ADDRCONFIG 0
+
+/* Possible value for SIGNED_RIGHT_SHIFT_IS */
+/* TODO: This is just set to 1 for the moment
+ port the macro aclocal/ax_signed_right_shift.m4 to CMake to make this work */
+#define ARITHMETIC_RIGHT_SHIFT 1
+
+/* Indicates the effect of the right shift operator on negative signed
+ integers */
+/* TODO: This is just set to 1 for the moment */
+#define SIGNED_RIGHT_SHIFT_IS 1
+
+/* Use *.h extension for parser header file */
+/* TODO: This might now be necessary anymore as it is set onyl for automake < 1.11
+ see: aclocal/ac_prog_bison.m4 */
+#cmakedefine BISON_USE_PARSER_H_EXTENSION 1
+
+/* replaces POSIX pthread by boost::thread */
+#cmakedefine USE_BOOST_THREAD 1
+
+/* replaces POSIX pthread by std::thread */
+#cmakedefine USE_STD_THREAD 1
+
+/* Define to 1 if strerror_r returns char *. */
+#cmakedefine STRERROR_R_CHAR_P 1
+
+
+/************************** HEADER FILES *************************/
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#cmakedefine HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#cmakedefine HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#cmakedefine HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#cmakedefine HAVE_PTHREAD_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#cmakedefine HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#cmakedefine HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#cmakedefine HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#cmakedefine HAVE_SYS_UN_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#cmakedefine HAVE_SYS_POLL_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sched.h> header file. */
+#cmakedefine HAVE_SCHED_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/*************************** FUNCTIONS ***************************/
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#cmakedefine HAVE_GETHOSTBYNAME 1
+
+/* Define to 1 if you have the `gethostbyname_r' function. */
+#cmakedefine HAVE_GETHOSTBYNAME_R 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+#cmakedefine HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the `sched_get_priority_max' function. */
+#cmakedefine HAVE_SCHED_GET_PRIORITY_MAX 1
+
+/* Define to 1 if you have the `sched_get_priority_min' function. */
+#cmakedefine HAVE_SCHED_GET_PRIORITY_MIN 1
+
+
+/* Define to 1 if strerror_r returns char *. */
+#cmakedefine STRERROR_R_CHAR_P 1
+
+#endif
\ No newline at end of file
diff --git a/build/docker/README.md b/build/docker/README.md
new file mode 100644
index 0000000..2ae309b
--- /dev/null
+++ b/build/docker/README.md
@@ -0,0 +1,27 @@
+# Apache Thrift Docker containers
+A set of docker containers used to build and test Apache Thrift
+
+### Available Containers
+
+* Ubuntu
+* Centos
+
+## Dependencies
+
+* A working Docker environment. A Vagrantfile is provided which will setup an Ubuntu host and working Docker environment as well as build the Apache Thrift Docker container for testing and development
+
+## Usage
+From the Apache Thrift code base root
+
+* Build
+
+ docker build -t thrift contrib/docker/ubuntu
+
+ or
+
+ docker build -t thrift contrib/docker/centos
+
+* Run
+
+ docker run -v $(pwd):/thrift -it thrift /bin/bash
+
diff --git a/build/docker/Vagrantfile b/build/docker/Vagrantfile
new file mode 100644
index 0000000..5eac6e6
--- /dev/null
+++ b/build/docker/Vagrantfile
@@ -0,0 +1,59 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+#
+# Licensed 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.
+
+# Base system bootstrap script
+$bootstrap_script = <<__BOOTSTRAP__
+echo "Provisioning defaults"
+
+sudo apt-get update -y
+sudo apt-get upgrade -y
+
+# Install default packages
+sudo apt-get install -y build-essential curl git
+
+# Install latest Docker version
+sudo curl -sSL https://get.docker.io/gpg | sudo apt-key add -
+sudo echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
+sudo apt-get update -y
+sudo apt-get install -y linux-image-extra-`uname -r` aufs-tools
+sudo apt-get install -y lxc-docker
+
+echo "Finished provisioning defaults"
+__BOOTSTRAP__
+
+Vagrant.configure("2") do |config|
+ config.vm.box = "trusty64"
+ config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
+ config.ssh.forward_agent = true
+
+ config.vm.provider :virtualbox do |vbox|
+ vbox.customize ["modifyvm", :id, "--memory", "1024"]
+ vbox.customize ["modifyvm", :id, "--cpus", "2"]
+ end
+
+ # Setup the default bootstrap script for our ubuntu base box image
+ config.vm.provision "shell", inline: $bootstrap_script
+
+ # Setup the custom docker image from our Ubuntu Dockerfile
+ config.vm.provision "docker" do |d|
+ d.build_image "/vagrant/ubuntu", args: "-t thrift"
+ end
+
+ # Setup the custom docker image from our Centos Dockerfile
+ #config.vm.provision "docker" do |d|
+ # d.build_image "/vagrant/centos", args: "-t thrift-centos"
+ #end
+
+end
diff --git a/build/docker/centos/Dockerfile b/build/docker/centos/Dockerfile
new file mode 100644
index 0000000..999a98f
--- /dev/null
+++ b/build/docker/centos/Dockerfile
@@ -0,0 +1,118 @@
+# Licensed 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.
+
+# Apache Thrift Docker build environment for Centos
+#
+# Known missing client libraries:
+# - D
+# - Haxe
+#
+
+FROM centos:6.6
+MAINTAINER Apache Thrift <dev@thrift.apache.org>
+
+ENV HOME /root
+
+RUN yum -y update
+
+# General dependencies
+RUN yum -y install -y tar m4 perl gcc git libtool libevent-devel zlib-devel openssl-devel
+
+RUN mkdir -p /tmp/epel && \
+ curl -SL "http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm" -o /tmp/epel/epel-release-6-8.noarch.rpm && \
+ cd /tmp/epel && \
+ rpm -ivh epel-release-6-8.noarch.rpm && \
+ cd $HOME
+
+# Autoconf
+RUN mkdir -p /tmp/autoconf && \
+ curl -SL "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz" | tar -xzC /tmp/autoconf && \
+ cd /tmp/autoconf/autoconf-2.69 && \
+ ./configure --prefix=/usr && \
+ make && \
+ make install && \
+ cd $HOME
+
+# Automake
+RUN mkdir -p /tmp/automake && \
+ curl -SL "http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz" | tar -xzC /tmp/automake && \
+ cd /tmp/automake/automake-1.14 && \
+ ./configure --prefix=/usr && \
+ make && \
+ make install && \
+ cd $HOME
+
+# Bison
+RUN mkdir -p /tmp/bison && \
+ curl -SL "http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz" | tar -xzC /tmp/bison && \
+ cd /tmp/bison/bison-2.5.1 && \
+ ./configure --prefix=/usr && \
+ make && \
+ make install && \
+ cd $HOME
+
+# Install an updated Boost library
+RUN mkdir -p /tmp/boost && \
+ curl -SL "http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz" | tar -xzC /tmp/boost && \
+ cd /tmp/boost/boost_1_55_0 && \
+ ./bootstrap.sh && \
+ ./b2 install && \
+ cd $HOME
+
+# Java Dependencies
+RUN yum install -y ant junit ant-nodeps ant-junit java-1.7.0-openjdk-devel
+
+# Python Dependencies
+RUN yum install -y python-devel python-setuptools python-twisted
+
+# Ruby Dependencies
+RUN yum install -y ruby ruby-devel rubygems && \
+ gem install bundler rake
+
+# Node.js Dependencies
+RUN yum install -y nodejs nodejs-devel npm
+
+# Perl Dependencies
+RUN yum install -y perl-Bit-Vector perl-Class-Accessor perl-ExtUtils-MakeMaker perl-Test-Simple
+
+# PHP Dependencies
+RUN yum install -y php php-devel php-pear re2c
+
+# GLibC Dependencies
+RUN yum install -y glib2-devel
+
+# Erlang Dependencies
+RUN yum install -y erlang-kernel erlang-erts erlang-stdlib erlang-eunit erlang-rebar
+
+# Lua Dependencies
+RUN yum install -y lua-devel
+
+# Go Dependencies
+RUN yum install -y golang golang-pkg-linux-amd64
+
+# C# Dependencies
+RUN yum install -y mono-core mono-devel mono-web-devel mono-extras mingw32-binutils mingw32-runtime mingw32-nsis
+
+# Haskell Dependencies
+RUN mkdir -p /tmp/haskell &&\
+ curl -SL "http://sherkin.justhub.org/el6/RPMS/x86_64/justhub-release-2.0-4.0.el6.x86_64.rpm" -o /tmp/haskell/justhub-release-2.0-4.0.el6.x86_64.rpm && \
+ cd /tmp/haskell && \
+ rpm -ivh justhub-release-2.0-4.0.el6.x86_64.rpm && \
+ yum -y install haskell && \
+ cabal update && \
+ cabal install cabal-install && \
+ cd $HOME
+
+# Clean up
+RUN rm -rf /tmp/*
+
+WORKDIR $HOME
\ No newline at end of file
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
new file mode 100644
index 0000000..eff474f
--- /dev/null
+++ b/build/docker/ubuntu/Dockerfile
@@ -0,0 +1,103 @@
+# Licensed 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.
+
+# Apache Thrift Docker build environment for Centos
+#
+# Known missing client libraries:
+# - None
+
+FROM ubuntu:trusty
+MAINTAINER Apache Thrift <dev@thrift.apache.org>
+
+ENV HOME /root
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt-get update -y && apt-get dist-upgrade -y
+
+# General dependencies
+RUN apt-get install -y automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git \
+ debhelper
+
+# C++ dependencies
+RUN apt-get install -y libboost-dev libboost-test-dev libboost-program-options-dev \
+ libboost-filesystem-dev libboost-system-dev libevent-dev
+
+# Java dependencies
+RUN apt-get install -y ant openjdk-7-jdk maven && \
+ update-java-alternatives -s java-1.7.0-openjdk-amd64
+
+# Python dependencies
+RUN apt-get install -y python-all python-all-dev python-all-dbg python-setuptools python-support
+
+# Ruby dependencies
+RUN apt-get install -y ruby ruby-dev && \
+ gem install bundler rake
+
+# Perl dependencies
+RUN apt-get install -y libbit-vector-perl libclass-accessor-class-perl
+
+# Php dependencies
+RUN apt-get install -y php5 php5-dev php5-cli php-pear re2c phpunit
+
+# GlibC dependencies
+RUN apt-get install -y libglib2.0-dev
+
+# Erlang dependencies
+RUN apt-get install -y erlang-base erlang-eunit erlang-dev
+
+# GO dependencies
+RUN echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections && \
+ apt-get install -y golang golang-go
+
+# Haskell dependencies
+RUN apt-get install -y ghc cabal-install libghc-binary-dev libghc-network-dev libghc-http-dev \
+ libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev && \
+ cabal update
+
+# Haxe
+RUN apt-get install -y libneko0 && \
+ mkdir -p /tmp/haxe /usr/lib/haxe && \
+ curl http://haxe.org/website-content/downloads/3,1,3/downloads/haxe-3.1.3-linux64.tar.gz -o /tmp/haxe/haxe-3.1.3-linux64.tar.gz && \
+ tar -xvzf /tmp/haxe/haxe-3.1.3-linux64.tar.gz -C /usr/lib/haxe --strip-components=1 && \
+ ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
+ ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
+ ln -s /usr/lib/libneko.so.0 /usr/lib/libneko.so && \
+ mkdir -p /usr/lib/haxe/lib && \
+ chmod -R 777 /usr/lib/haxe/lib && \
+ haxelib setup /usr/lib/haxe/lib && \
+ haxelib install hxcpp
+
+# Lua dependencies
+RUN apt-get install -y lua5.2 lua5.2-dev
+
+# Node.js dependencies
+RUN apt-get install -y nodejs nodejs-dev nodejs-legacy npm
+
+# CSharp
+RUN apt-get install -y mono-gmcs mono-devel mono-xbuild mono-complete libmono-system-web2.0-cil \
+ mingw32 mingw32-binutils mingw32-runtime nsis
+
+# D dependencies
+# THRIFT-2916: DMD pinned to 2.065.0-0 due to regression in 2.066
+RUN curl http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -o /etc/apt/sources.list.d/d-apt.list && \
+ apt-get update && apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && \
+ apt-get update && \
+ apt-get install -y xdg-utils dmd-bin=2.065.0-0 libphobos2-dev=2.065.0-0
+
+# Clean up
+RUN apt-get clean && \
+ rm -rf /var/cache/apt/* && \
+ rm -rf /var/lib/apt/lists/* && \
+ rm -rf /tmp/* && \
+ rm -rf /var/tmp/*
+
+WORKDIR $HOME
diff --git a/build/travis/installCXXDependencies.sh b/build/travis/installCXXDependencies.sh
new file mode 100755
index 0000000..ac3edf3
--- /dev/null
+++ b/build/travis/installCXXDependencies.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# 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.
+
+
+# Mainly aiming Travis CI's Ubuntu machines for now
+# see what we need: http://thrift.apache.org/docs/install/ubuntu
+
+# General dependencies
+sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main restricted" -y
+sudo apt-get update -qq
+
+sudo apt-get install -qq libpango-1.0-0 libqt4-dev qtbase5-dev qtbase5-dev-tools qt5-default libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev make cmake git debhelper bc nsis ninja-build
+dpkg -S /usr/include/boost/version.hpp
diff --git a/build/travis/installDependencies.sh b/build/travis/installDependencies.sh
new file mode 100755
index 0000000..852a805
--- /dev/null
+++ b/build/travis/installDependencies.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# 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.
+
+SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
+
+# Mainly aiming Travis CI's Ubuntu machines for now
+# see what we need: http://thrift.apache.org/docs/install/ubuntu
+
+# General dependencies
+sh ${SCRIPTPATH}/installCXXDependencies.sh
+
+# Java dependencies
+sudo apt-get install -qq ant openjdk-7-jdk
+sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
+
+# Python dependencies
+sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools python-support
+
+# Ruby dependencies
+sudo apt-get install -qq ruby ruby-dev
+sudo gem install bundler rake
+
+# Perl dependencies
+sudo apt-get install -qq libbit-vector-perl libclass-accessor-class-perl
+
+# Php dependencies
+sudo apt-get install -qq php5 php5-dev php5-cli php-pear re2c
+
+# GlibC dependencies
+sudo apt-get install -qq libglib2.0-dev
+
+# Erlang dependencies
+sudo apt-get install -qq erlang-base erlang-eunit erlang-dev
+
+# GO dependencies
+echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections
+sudo apt-get -y install -qq golang golang-go
+
+# Haskell dependencies
+sudo add-apt-repository -y ppa:hvr/ghc
+sudo apt-get update
+sudo apt-get install cabal-install-1.20 ghc-$GHCVER
+
+# Lua dependencies
+sudo apt-get install -qq lua5.2 lua5.2-dev
+
+# Node.js dependencies
+sudo apt-get install -qq nodejs nodejs-dev npm
+sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
+
+# CSharp
+sudo apt-get install -qq mono-gmcs mono-devel libmono-system-web2.0-cil
+sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime nsis