mirror of https://gitee.com/bigwinds/arangodb
added FLEX and BISON
This commit is contained in:
parent
ef71f52a24
commit
97e80b848e
|
@ -32,11 +32,11 @@ set(ARANGODB_VERSION_REVISION "0-devel")
|
|||
set(ARANGODB_VERSION
|
||||
"${ARANGODB_VERSION_MAJOR}.${ARANGODB_VERSION_MINOR}.${ARANGODB_VERSION_REVISION}")
|
||||
|
||||
configure_file (
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/Basics/build.h.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/lib/Basics/build.h")
|
||||
|
||||
configure_file (
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/Basics/VERSION.in"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
|
||||
|
||||
|
@ -261,7 +261,7 @@ endif ()
|
|||
# Maintainer mode (Assertions) -------------------------------------------------
|
||||
option(USE_MAINTAINER_MODE
|
||||
"whether we want to have assertions and other development features" OFF)
|
||||
if (USE_MAINTAINER_MODE)
|
||||
if ()
|
||||
add_definitions("-DTRI_ENABLE_MAINTAINER_MODE=1")
|
||||
endif ()
|
||||
|
||||
|
@ -630,10 +630,10 @@ if (OPENSSL_VERSION)
|
|||
endif ()
|
||||
|
||||
# BISON&FLEX -------------------------------------------------------------------
|
||||
find_package (BISON)
|
||||
find_package(BISON)
|
||||
|
||||
# FLEX -------------------------------------------------------------------------
|
||||
find_package (FLEX)
|
||||
find_package(FLEX)
|
||||
|
||||
# Python
|
||||
find_package(PythonInterp 2)
|
||||
|
|
|
@ -54,12 +54,42 @@ if (MSVC)
|
|||
)
|
||||
endif ()
|
||||
|
||||
# note that we check-in the generated FLEX/BISON files, therefore they are
|
||||
# generate inside the source tree
|
||||
|
||||
if (USE_MAINTAINER_MODE)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/tokens.cpp
|
||||
COMMAND
|
||||
${CMAKE_SOURCE_DIR}/utils/flex-c++.sh
|
||||
${FLEX_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/tokens.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/tokens.ll
|
||||
MAIN_DEPENDENCY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/tokens.ll
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/grammar.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/position.h
|
||||
COMMAND
|
||||
${CMAKE_SOURCE_DIR}/utils/bison-c.sh
|
||||
${BISON_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/grammar.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/grammar.y
|
||||
MAIN_DEPENDENCY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Aql/grammar.y
|
||||
)
|
||||
endif ()
|
||||
|
||||
add_executable(
|
||||
${BIN_ARANGOD}
|
||||
${ARANGO_MSVC}
|
||||
${ProductVersionFiles}
|
||||
Actions/actions.cpp
|
||||
Actions/RestActionHandler.cpp
|
||||
Actions/actions.cpp
|
||||
ApplicationServer/ApplicationFeature.cpp
|
||||
ApplicationServer/ApplicationServer.cpp
|
||||
Aql/Aggregator.cpp
|
||||
|
@ -74,12 +104,12 @@ add_executable(
|
|||
Aql/CalculationBlock.cpp
|
||||
Aql/ClusterBlocks.cpp
|
||||
Aql/ClusterNodes.cpp
|
||||
Aql/Collection.cpp
|
||||
Aql/Collections.cpp
|
||||
Aql/CollectionScanner.cpp
|
||||
Aql/CollectBlock.cpp
|
||||
Aql/CollectNode.cpp
|
||||
Aql/CollectOptions.cpp
|
||||
Aql/Collection.cpp
|
||||
Aql/CollectionScanner.cpp
|
||||
Aql/Collections.cpp
|
||||
Aql/Condition.cpp
|
||||
Aql/ConditionFinder.cpp
|
||||
Aql/EnumerateCollectionBlock.cpp
|
||||
|
@ -93,13 +123,13 @@ add_executable(
|
|||
Aql/Expression.cpp
|
||||
Aql/Function.cpp
|
||||
Aql/Functions.cpp
|
||||
Aql/grammar.cpp
|
||||
Aql/Graphs.cpp
|
||||
Aql/Index.cpp
|
||||
Aql/IndexBlock.cpp
|
||||
Aql/IndexNode.cpp
|
||||
Aql/ModificationBlocks.cpp
|
||||
Aql/ModificationNodes.cpp
|
||||
Aql/ModificationOptions.cpp
|
||||
Aql/NodeFinder.cpp
|
||||
Aql/Optimizer.cpp
|
||||
Aql/OptimizerRules.cpp
|
||||
|
@ -117,20 +147,20 @@ add_executable(
|
|||
Aql/SortCondition.cpp
|
||||
Aql/SortNode.cpp
|
||||
Aql/SubqueryBlock.cpp
|
||||
Aql/tokens.cpp
|
||||
Aql/TraversalConditionFinder.cpp
|
||||
Aql/TraversalBlock.cpp
|
||||
Aql/TraversalConditionFinder.cpp
|
||||
Aql/TraversalNode.cpp
|
||||
Aql/V8Expression.cpp
|
||||
Aql/Variable.cpp
|
||||
Aql/VariableGenerator.cpp
|
||||
Aql/ModificationOptions.cpp
|
||||
Aql/grammar.cpp
|
||||
Aql/tokens.cpp
|
||||
Cluster/AgencyComm.cpp
|
||||
Cluster/ApplicationCluster.cpp
|
||||
Cluster/ClusterComm.cpp
|
||||
Cluster/ClusterInfo.cpp
|
||||
Cluster/ClusterTraverser.cpp
|
||||
Cluster/ClusterMethods.cpp
|
||||
Cluster/ClusterTraverser.cpp
|
||||
Cluster/HeartbeatThread.cpp
|
||||
Cluster/RestShardHandler.cpp
|
||||
Cluster/ServerJob.cpp
|
||||
|
@ -159,6 +189,7 @@ add_executable(
|
|||
HttpServer/HttpsCommTask.cpp
|
||||
HttpServer/HttpsServer.cpp
|
||||
HttpServer/PathHandler.cpp
|
||||
IndexOperators/index-operator.cpp
|
||||
Indexes/CapConstraint.cpp
|
||||
Indexes/EdgeIndex.cpp
|
||||
Indexes/FulltextIndex.cpp
|
||||
|
@ -170,15 +201,14 @@ add_executable(
|
|||
Indexes/PrimaryIndex.cpp
|
||||
Indexes/SimpleAttributeEqualityMatcher.cpp
|
||||
Indexes/SkiplistIndex.cpp
|
||||
IndexOperators/index-operator.cpp
|
||||
Replication/ContinuousSyncer.cpp
|
||||
Replication/InitialSyncer.cpp
|
||||
Replication/Syncer.cpp
|
||||
RestHandler/RestAdminLogHandler.cpp
|
||||
RestHandler/RestBaseHandler.cpp
|
||||
RestHandler/RestBatchHandler.cpp
|
||||
RestHandler/RestDebugHandler.cpp
|
||||
RestHandler/RestCursorHandler.cpp
|
||||
RestHandler/RestDebugHandler.cpp
|
||||
RestHandler/RestDocumentHandler.cpp
|
||||
RestHandler/RestEdgeHandler.cpp
|
||||
RestHandler/RestEdgesHandler.cpp
|
||||
|
@ -233,8 +263,8 @@ add_executable(
|
|||
V8Server/V8TimerTask.cpp
|
||||
V8Server/V8Traverser.cpp
|
||||
V8Server/v8-actions.cpp
|
||||
V8Server/v8-collection.cpp
|
||||
V8Server/v8-collection-util.cpp
|
||||
V8Server/v8-collection.cpp
|
||||
V8Server/v8-dispatcher.cpp
|
||||
V8Server/v8-query.cpp
|
||||
V8Server/v8-replication.cpp
|
||||
|
@ -246,37 +276,37 @@ add_executable(
|
|||
V8Server/v8-voccursor.cpp
|
||||
V8Server/v8-vocindex.cpp
|
||||
V8Server/v8-wrapshapedjson.cpp
|
||||
VocBase/DatafileStatistics.cpp
|
||||
VocBase/Ditch.cpp
|
||||
VocBase/DocumentAccessor.cpp
|
||||
VocBase/ExampleMatcher.cpp
|
||||
VocBase/Graphs.cpp
|
||||
VocBase/KeyGenerator.cpp
|
||||
VocBase/Legends.cpp
|
||||
VocBase/Shaper.cpp
|
||||
VocBase/Traverser.cpp
|
||||
VocBase/VocShaper.cpp
|
||||
VocBase/auth.cpp
|
||||
VocBase/cleanup.cpp
|
||||
VocBase/collection.cpp
|
||||
VocBase/compactor.cpp
|
||||
VocBase/datafile.cpp
|
||||
VocBase/DatafileStatistics.cpp
|
||||
VocBase/Ditch.cpp
|
||||
VocBase/document-collection.cpp
|
||||
VocBase/DocumentAccessor.cpp
|
||||
VocBase/ExampleMatcher.cpp
|
||||
VocBase/edge-collection.cpp
|
||||
VocBase/Graphs.cpp
|
||||
VocBase/headers.cpp
|
||||
VocBase/KeyGenerator.cpp
|
||||
VocBase/Legends.cpp
|
||||
VocBase/replication-applier.cpp
|
||||
VocBase/replication-common.cpp
|
||||
VocBase/replication-dump.cpp
|
||||
VocBase/server.cpp
|
||||
VocBase/shape-accessor.cpp
|
||||
VocBase/shaped-json.cpp
|
||||
VocBase/Shaper.cpp
|
||||
VocBase/transaction.cpp
|
||||
VocBase/Traverser.cpp
|
||||
VocBase/vocbase.cpp
|
||||
VocBase/vocbase-defaults.cpp
|
||||
VocBase/VocShaper.cpp
|
||||
VocBase/vocbase.cpp
|
||||
Wal/AllocatorThread.cpp
|
||||
Wal/CollectorThread.cpp
|
||||
Wal/LogfileManager.cpp
|
||||
Wal/Logfile.cpp
|
||||
Wal/LogfileManager.cpp
|
||||
Wal/Marker.cpp
|
||||
Wal/RecoverState.cpp
|
||||
Wal/RemoverThread.cpp
|
||||
|
|
|
@ -10,6 +10,35 @@ include_directories(.)
|
|||
## --SECTION-- LIBRARIES
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
# note that we check-in the generated FLEX/BISON files, therefore they are
|
||||
# generate inside the source tree
|
||||
|
||||
if (USE_MAINTAINER_MODE)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/JsonParser/json-parser.cpp
|
||||
COMMAND
|
||||
${CMAKE_SOURCE_DIR}/utils/flex-c++.sh
|
||||
${FLEX_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/JsonParser/json-parser.ll
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/JsonParser/json-parser.cpp
|
||||
MAIN_DEPENDENCY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/JsonParser/json-parser.ll
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/JsonParser.cpp
|
||||
COMMAND
|
||||
${CMAKE_SOURCE_DIR}/utils/flex-c++.sh
|
||||
${FLEX_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/V8/v8-json.ll
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/V8/v8-json.cpp
|
||||
MAIN_DEPENDENCY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/V8/v8-json.ll
|
||||
)
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
### @brief LIB_ARANGO
|
||||
################################################################################
|
||||
|
@ -79,14 +108,10 @@ add_library(
|
|||
${LIB_ARANGO_POSIX}
|
||||
${LIB_ARANGO_CONSOLE}
|
||||
${LIB_ARANGO_VPACK}
|
||||
Basics/application-exit.cpp
|
||||
Basics/associative.cpp
|
||||
Basics/AttributeNameParser.cpp
|
||||
Basics/Barrier.cpp
|
||||
Basics/ConditionLocker.cpp
|
||||
Basics/ConditionVariable.cpp
|
||||
Basics/conversions.cpp
|
||||
Basics/csv.cpp
|
||||
Basics/DataProtector.cpp
|
||||
Basics/Exceptions.cpp
|
||||
Basics/FileUtils.cpp
|
||||
|
@ -95,6 +120,23 @@ add_library(
|
|||
Basics/Mutex.cpp
|
||||
Basics/MutexLocker.cpp
|
||||
Basics/Nonce.cpp
|
||||
Basics/ProgramOptions.cpp
|
||||
Basics/ProgramOptionsDescription.cpp
|
||||
Basics/RandomGenerator.cpp
|
||||
Basics/ReadWriteLock.cpp
|
||||
Basics/ReadWriteLockCPP11.cpp
|
||||
Basics/StringBuffer.cpp
|
||||
Basics/StringUtils.cpp
|
||||
Basics/Thread.cpp
|
||||
Basics/ThreadPool.cpp
|
||||
Basics/Utf8Helper.cpp
|
||||
Basics/VPackStringBufferAdapter.cpp
|
||||
Basics/VelocyPackHelper.cpp
|
||||
Basics/WorkMonitor.cpp
|
||||
Basics/application-exit.cpp
|
||||
Basics/associative.cpp
|
||||
Basics/conversions.cpp
|
||||
Basics/csv.cpp
|
||||
Basics/debugging.cpp
|
||||
Basics/error.cpp
|
||||
Basics/fasthash.cpp
|
||||
|
@ -108,37 +150,24 @@ add_library(
|
|||
Basics/mimetypes.cpp
|
||||
Basics/prime-numbers.cpp
|
||||
Basics/process-utils.cpp
|
||||
Basics/ProgramOptions.cpp
|
||||
Basics/ProgramOptionsDescription.cpp
|
||||
Basics/random.cpp
|
||||
Basics/RandomGenerator.cpp
|
||||
Basics/ReadWriteLock.cpp
|
||||
Basics/ReadWriteLockCPP11.cpp
|
||||
Basics/socket-utils.cpp
|
||||
Basics/ssl-helper.cpp
|
||||
Basics/StringBuffer.cpp
|
||||
Basics/StringUtils.cpp
|
||||
Basics/structures.cpp
|
||||
Basics/system-functions.cpp
|
||||
Basics/terminal-utils.cpp
|
||||
Basics/Thread.cpp
|
||||
Basics/ThreadPool.cpp
|
||||
Basics/tri-strings.cpp
|
||||
Basics/tri-zip.cpp
|
||||
Basics/Utf8Helper.cpp
|
||||
Basics/vector.cpp
|
||||
Basics/VelocyPackHelper.cpp
|
||||
Basics/voc-errors.cpp
|
||||
Basics/voc-mimetypes.cpp
|
||||
Basics/VPackStringBufferAdapter.cpp
|
||||
Basics/WorkMonitor.cpp
|
||||
JsonParser/json-parser.cpp
|
||||
ProgramOptions/program-options.cpp
|
||||
Rest/EndpointList.cpp
|
||||
Rest/Endpoint.cpp
|
||||
Rest/EndpointIp.cpp
|
||||
Rest/EndpointIpV4.cpp
|
||||
Rest/EndpointIpV6.cpp
|
||||
Rest/EndpointList.cpp
|
||||
Rest/HttpRequest.cpp
|
||||
Rest/HttpResponse.cpp
|
||||
Rest/InitializeRest.cpp
|
||||
|
@ -177,12 +206,12 @@ target_link_libraries(${LIB_ARANGO_CLIENT} ${AR_V8_LIBS} ${AR_ICU_LIBS} )
|
|||
add_library(
|
||||
${LIB_ARANGO_V8}
|
||||
STATIC
|
||||
V8/v8-json.cpp
|
||||
V8/JSLoader.cpp
|
||||
V8/V8LineEditor.cpp
|
||||
V8/v8-buffer.cpp
|
||||
V8/v8-conv.cpp
|
||||
V8/v8-globals.cpp
|
||||
V8/v8-json.cpp
|
||||
V8/v8-shell.cpp
|
||||
V8/v8-utils.cpp
|
||||
V8/v8-vpack.cpp
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
BISON="$1"
|
||||
OUTPUT="$2"
|
||||
INPUT="$3"
|
||||
|
||||
if test "x$BISON" = x -o "x$OUTPUT" = x -o "x$INPUT" = x; then
|
||||
echo "usage: $0 <bison> <output> <input>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#############################################################################
|
||||
## bison
|
||||
#############################################################################
|
||||
|
||||
${BISON} -l -d -ra -S lalr1.cc --warnings="deprecated,other,error=conflicts-sr,error=conflicts-rr" -o ${OUTPUT} ${INPUT}
|
||||
|
||||
#############################################################################
|
||||
## sanity checks
|
||||
#############################################################################
|
||||
|
||||
PREFIX=`echo ${OUTPUT} | sed -e 's:\.cpp$::'`
|
||||
|
||||
test -f ${PREFIX}.hpp || exit 1
|
||||
test -f ${PREFIX}.cpp || exit 1
|
||||
|
||||
|
||||
#############################################################################
|
||||
# the following command will insert extra parentheses around a sub expression
|
||||
# to suppress compiler warnings. it will copy the file to a new location 1st
|
||||
#############################################################################
|
||||
|
||||
DIR=`dirname ${OUTPUT}`
|
||||
|
||||
mv ${DIR}/position.hh ${DIR}/position.hh.tmp
|
||||
|
||||
sed -e 's/\(pos1.filename && pos2.filename && .pos1.filename == .pos2.filename\)/(&)/g' \
|
||||
${DIR}/position.hh.tmp > ${DIR}/position.hh
|
||||
|
||||
# give some information
|
||||
diff -u ${DIR}/position.hh.tmp ${DIR}/position.hh
|
||||
|
||||
# cleanup
|
||||
rm -f ${DIR}/position.hh.tmp
|
||||
|
||||
|
||||
#############################################################################
|
||||
## rename file
|
||||
#############################################################################
|
||||
|
||||
mv ${PREFIX}.hpp ${PREFIX}.h || exit 1
|
||||
|
||||
#############################################################################
|
||||
## fix header file name in source, fix defines
|
||||
#############################################################################
|
||||
|
||||
sed -e 's:\.hpp:.h:' < ${OUTPUT} \
|
||||
| sed -e 's:# if YYENABLE_NLS:# if defined(YYENABLE_NLS) \&\& YYENABLE_NLS:' \
|
||||
| sed -e 's:__attribute__((__unused__)):' \
|
||||
> ${OUTPUT}.tmp
|
||||
|
||||
# give some information
|
||||
diff -u ${OUTPUT} ${OUTPUT}.tmp
|
||||
|
||||
# and move the files to the final destination
|
||||
mv ${OUTPUT}.tmp ${OUTPUT} || exit 1
|
||||
|
Loading…
Reference in New Issue