Skip to content

Commit

Permalink
Merge branch '1.0' of github.com:triAGENS/ArangoDB into devel
Browse files Browse the repository at this point in the history
Conflicts:
	arangod/RestServer/ArangoServer.cpp
	arangosh/V8Client/arangosh.cpp
  • Loading branch information
fceller committed Jun 8, 2012
2 parents 9c5ee06 + 4988c4a commit fc3957a
Show file tree
Hide file tree
Showing 715 changed files with 14,708 additions and 20,942 deletions.
30 changes: 13 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@
3rdParty/mruby/GPATH
3rdParty/mruby/GRTAGS
3rdParty/mruby/GTAGS
3rdParty/mruby/lib/ritevm.a
3rdParty/mruby/mrblib/mrblib.c
3rdParty/mruby/mrblib/mrblib.ctmp
3rdParty/mruby/mrblib/mrblib.rbtmp
3rdParty/ptmalloc3/libptmalloc3.a
3rdParty/ptmalloc3/tst-independent-alloc
3rdParty/ptmalloc3/t-test1
3rdParty/ptmalloc3/t-test2
arangod/Ahuacatl/ahuacatl-grammar.output
ARCH.*
autom4te.cache
BasicsC/local-configuration.h
bin
build.h
build.info
commit.sh
config/config.h
config/config.guess
config/config.h
config/config.sub
config.h
config.log
Expand All @@ -37,6 +36,8 @@ Doxygen/arango.doxy
Doxygen/html/
Doxygen/js
Doxygen/latex/
Doxygen/.setup-directories
Doxygen/web/*.html
Doxygen/wiki/
Doxygen/xml/
.DS_Store
Expand All @@ -45,10 +46,10 @@ Doxygen/xml/
GPATH
GRTAGS
GTAGS
JsonParserX/JsonParserX.output
lib/JsonParserX/JsonParserX.output
*.la
libarango.a
libarangodb.a
lib*.a
lib/BasicsC/local-configuration.h
.libev-build-*
.libs
*.lo
Expand All @@ -72,17 +73,20 @@ m4/external.libxml2
Makefile
Makefile.local
.mruby-build-*
/nbproject/private/
*.o
*.old
out
*.Po
*.pyc
.setup-directories
.setup-js-directories
.setup-mr-directories
stamp-h*
.svn
*.swp
tags
Ahuacatl/ahuacatl-grammar.output
UnitTests/basics_suite
UnitTests/geo_suite
UnitTests/HttpInterface/logs
UnitTests/Jutland/CsvReaderTest.cpp
UnitTests/Jutland/Makefile.am
Expand All @@ -91,13 +95,5 @@ UnitTests/Jutland/Runner.cpp
UnitTests/Philadelphia/Makefile.am
UnitTests/Philadelphia/Makefile.py
UnitTests/Philadelphia/Runner.cpp
UnitTests/basics_suite
.v8-build-*
VC++
/nbproject/private/
UnitTests/geo_suite
Doxygen/web/*.html
arangod
arangosh
arangoimp
arangoirb
6 changes: 6 additions & 0 deletions 3rdParty/mruby/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ cscope.out
/bin
/mrblib/mrblib.c
/mrblib/*.*tmp
/build
/test/mrbtest
/test/mrbtest.c
/test/*.*tmp
CMakeFiles
CMakeCache.txt
3 changes: 3 additions & 0 deletions 3rdParty/mruby/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# no installation...

script: "make all test"
4 changes: 4 additions & 0 deletions 3rdParty/mruby/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ Original Authors "mruby developers" are:
FUKUOKA CSK CORPORATION
Kyushu Institute of Technology
Network Applied Communication Laboratory, Inc.
Daniel Bovensiepen
Jon Maken
Bjorn De Meyer
Yuichiro MASUI
110 changes: 110 additions & 0 deletions 3rdParty/mruby/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# CMake build system for mruby
# License: released under the same license as mruby
# Author: jonforums@gmail.com
# Author: beoran@gmail.com
#
# Usage example:
# 1. Ensure CMake, Bison, and a build toolchain are on `PATH`
# 2. Change to a build directory outside source tree, eg - `build` subdir
# 3. Create build Makefiles or project files.
# `cmake ..` (UNIX-like system)
# `cmake -G "MSYS Makefiles" ..`
# `cmake -G "Visual Studio 10" ..`
# `cmake -G "NMake Makefiles" ..`
# ** to cross-compile: add -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain/file
# ** to set install dir: add -DCMAKE_INSTALL_PREFIX=/path/to/installdir
# 4a. Build: `make` (to make noisy, add `VERBOSE=1`)
# 4b. Build and test: `make all test`
# 4c. Build, test, and install: `make all test install`
# 4d. Build, test, and package: `make all test package`

cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

# Default build mode is Release With Debug Info unless specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose build type: empty Debug Release RelWithDebInfo MinSizeRel"
FORCE)
message(STATUS "Build type not set, defaulting to 'RelWithDebInfo'")
endif()

project(mruby C)

# TODO stop polluting source tree with CMakeFiles/ and CMakeCache.txt
# on build location check failure
# Make sure we are not trying to generate in in-tree build unless building
# with an MSVC or Xcode IDE where it's OK.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT (MSVC_IDE OR XCODE))
message(FATAL_ERROR
"\nIn-source builds are not allowed as CMake would overwrite the "
"Makefiles distributed with mruby. Delete any created 'CMakeFiles' "
"subdirectory and 'CMakeCache.txt' file from the current directory, "
"change to the 'build' subdirectory, and re-run CMake from there.")
endif()

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # don't split absolute link paths
cmake_policy(SET CMP0012 NEW) # recognize number & boolean literals
cmake_policy(SET CMP0015 NEW) # convert relative link paths to absolute
endif(COMMAND cmake_policy)

# Match original Makefile's default in-tree install.
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE PATH
"Install path prefix prepended to install directories."
FORCE
)
endif()

# TODO refactor to use an option when adding shared lib support
set(BUILD_SHARED_LIBS OFF)

# Version of mruby, useful for versoning .so and .dll files.
# TODO automate by parsing src/version.h -or- extract git info?
set(MRUBY_VERSION 1.0.0dev)
string(REGEX MATCH "^[0-9]+[.][0-9]+" MRUBY_SOVERSION ${MRUBY_VERSION})
string(REPLACE "." "" MRUBY_DLL_SHORTVER ${MRUBY_SOVERSION})

# Search in the `cmake` directory for custom CMake helper modules.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
include(IntrospectSystem)

# Search for C header files in these directories.
include_directories("${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/src")

# TODO re-enable (and implement) if needed
# On some 64-bit platforms, libraries should be installed into `lib64'
# instead of `lib'. Set this to 64 to do that.
#set(LIB_SUFFIX "" CACHE STRING "Suffix for 'lib' directories, e.g. '64'")

# build the components
add_subdirectory(src)
add_subdirectory(mrblib)
add_subdirectory(tools)
add_subdirectory(test)

# install the header files
install(FILES include/mruby.h DESTINATION include)
install(FILES include/mrbconf.h DESTINATION include)
install(DIRECTORY include/mruby DESTINATION include FILES_MATCHING PATTERN "*.h")

# TODO refactor once proper versioning scheme implemented
# archive packaging
set(CPACK_GENERATOR "TGZ;ZIP")
string(TOLOWER ${CMAKE_SYSTEM_NAME} MRUBY_HOST)
if(CMAKE_C_COMPILER_VERSION)
string(REPLACE "." "" MRUBY_GCC_VERSION ${CMAKE_C_COMPILER_VERSION})
endif()

# TODO add build info suffix for non-Windows builds?
if(MINGW)
set(MRUBY_BUILD "-mingw${MRUBY_GCC_VERSION}")
elseif(MSVC)
set(MRUBY_BUILD "-msvc${MSVC_VERSION}")
endif()
set(CPACK_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${MRUBY_VERSION}-${MRUBY_HOST}${MRUBY_BUILD}"
)
include(CPack)

# vim: ts=2 sts=2 sw=2 et
49 changes: 44 additions & 5 deletions 3rdParty/mruby/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# makefile discription.
# basic build file for mruby

# compiler, linker (gcc)
CC = gcc
LL = gcc
# compiler, linker (gcc), archiver, parser generator
export CC = gcc
export LL = gcc
export AR = ar
export YACC = bison

DEBUG_MODE = 1
ifeq ($(DEBUG_MODE),1)
CFLAGS = -g -O3
CFLAGS = -g
else
CFLAGS = -O3
endif
Expand All @@ -17,6 +20,16 @@ else
MAKE_FLAGS = --no-print-directory CC='$(CC)' LL='$(LL)' ALL_CFLAGS='$(ALL_CFLAGS)'
endif

##############################
# internal variables

export MSG_BEGIN = @for line in
export MSG_END = ; do echo "$$line"; done

export CP := cp
export RM_F := rm -f
export CAT := cat

##############################
# generic build targets, rules

Expand All @@ -29,7 +42,7 @@ all :

# mruby test
.PHONY : test
test :
test : all
@$(MAKE) -C test $(MAKE_FLAGS)

# clean up
Expand All @@ -39,3 +52,29 @@ clean :
@$(MAKE) clean -C tools/mruby $(MAKE_FLAGS)
@$(MAKE) clean -C tools/mirb $(MAKE_FLAGS)
@$(MAKE) clean -C test $(MAKE_FLAGS)

# display help for build configuration and interesting targets
.PHONY : showconfig
showconfig :
$(MSG_BEGIN) \
"" \
" CC = $(CC)" \
" LL = $(LL)" \
" MAKE = $(MAKE)" \
"" \
" CFLAGS = $(CFLAGS)" \
" ALL_CFLAGS = $(ALL_CFLAGS)" \
$(MSG_END)

.PHONY : help
help :
$(MSG_BEGIN) \
"" \
" Basic mruby Makefile" \
"" \
"targets:" \
" all (default): build all targets, install (locally) in-repo" \
" clean: clean all built and in-repo installed artifacts" \
" showconfig: show build config summary" \
" test: run all mruby tests" \
$(MSG_END)
25 changes: 5 additions & 20 deletions 3rdParty/mruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,17 @@

## What's mruby

mruby is the lightweight implementation of the Ruby language complying to
mruby is the lightweight implementation of the Ruby language complying to (part of)
the [ISO standard](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).
mruby can run Ruby code in 'interpreter mode' or 'compile and execute it on a virtual machine' depending on the developer's preference.
mruby can be linked and embedded within your application. We provide the interpreter program "mruby" and
the interactive mruby shell "mirb" as examples. You can also compile Ruby programs into compiled byte code
using the mruby compiler "mrbc". All those tools reside in "bin" directory. The "mrbc" is also able to
generate compiled byte code in a C source file. You can check the "mrbtest" program under the "test" directory.

This achievement was sponsored by the Regional Innovation Creation R&D Programs of
the Ministry of Economy, Trade and Industry of Japan.


## Features of mruby

| Compatibility with MRI(Matz Ruby Implementation) version...
|
|FIXME:
| + Simple Syntax
| + *Normal* Object-Oriented features(ex. class, method calls)
| + *Advanced* Object-Oriented features(ex. Mixin, Singleton-method)
| + Operator Overloading
| + Exception Handling
| + Iterators and Closures
| + Garbage Collection
| + Dynamic Loading of Object files(on some architecture)
| + Highly Portable (works on many Unix-like/POSIX compatible platforms
| as well as Windows, Mac OS X, BeOS etc.)
| cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatforms


## How to get mruby

The mruby distribution files can be found in the following site:
Expand Down
30 changes: 30 additions & 0 deletions 3rdParty/mruby/cmake/Toolchain-Arch-mingw32.cmake.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Sample toolchain file for building for Windows from an Arch Linux system.
#
# Typical usage:
# 1) install cross compiler: `sudo pacman -S mingw32-gcc`
# 2) cp cmake/Toolchain-Arch-mingw32.cmake.sample ~/Toolchain-Arch-mingw32.cmake
# 3) tweak toolchain values as needed
# 4) cd build
# 5) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Arch-mingw32.cmake ..

# name of the target OS on which the built artifacts will run
# and the toolchain prefix
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i486-mingw32)

# cross compilers to use for C and C++
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

# target environment on the build host system
# set 1st to dir with the cross compiler's C/C++ headers/libs
# set 2nd to dir containing personal cross development headers/libs
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} ~/crossdev/w32)

# modify default behavior of FIND_XXX() commands to
# search for headers/libs in the target environment and
# search for programs in the build host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
32 changes: 32 additions & 0 deletions 3rdParty/mruby/cmake/Toolchain-OSX-mingw32.cmake.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Sample toolchain file for building for Windows from an OS X system.
#
# Typical usage:
# 1) install a mingw-w64 cross compiler
# a) darwin toolchain targeting win32: http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/
# b) extract toolchain into ~/mingw/w32
# 2) cp cmake/Toolchain-OSX-mingw32.cmake.sample ~/Toolchain-OSX-mingw32.cmake
# 3) tweak toolchain values as needed
# 4) cd build
# 5) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-OSX-mingw32.cmake ..

# name of the target OS on which the built artifacts will run
# and the toolchain prefix
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)

# cross compilers to use for C and C++
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

# target environment(s) on the build host system
# set 1st to dir with the cross compiler's C/C++ headers/libs
# set 2nd to dir containing personal cross development headers/libs
set(CMAKE_FIND_ROOT_PATH ~/mingw/w32/${TOOLCHAIN_PREFIX} ~/crossdev/w32)

# modify default behavior of FIND_XXX() commands to
# search for headers/libs in the target environment and
# search for programs in the build host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Loading

0 comments on commit fc3957a

Please sign in to comment.