Removing vendored files as they are now cached by go proxy. (#10)
We no longer need vendoring as packages are cached in case they go missing or move from their current location.
This commit is contained in:
parent
ca2fab72fd
commit
b068369e86
4290 changed files with 0 additions and 1437507 deletions
56
vendor/git.apache.org/thrift.git/.clang-format
generated
vendored
56
vendor/git.apache.org/thrift.git/.clang-format
generated
vendored
|
@ -1,56 +0,0 @@
|
|||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
ConstructorInitializerIndentWidth: 2
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
BreakBeforeBinaryOperators: true
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BinPackParameters: false
|
||||
ColumnLimit: 100
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
DerivePointerAlignment: false
|
||||
IndentCaseLabels: false
|
||||
IndentWrappedFunctionNames: false
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakBeforeFirstCallParameter: 190
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakString: 10000
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 1200
|
||||
PointerAlignment: Left
|
||||
SpacesBeforeTrailingComments: 1
|
||||
Cpp11BracedListStyle: true
|
||||
Standard: Auto
|
||||
IndentWidth: 2
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
BreakBeforeBraces: Attach
|
||||
SpacesInParentheses: false
|
||||
SpacesInAngles: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
ContinuationIndentWidth: 4
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
SpaceBeforeParens: ControlStatements
|
||||
DisableFormat: false
|
||||
...
|
||||
|
1
vendor/git.apache.org/thrift.git/.dockerignore
generated
vendored
1
vendor/git.apache.org/thrift.git/.dockerignore
generated
vendored
|
@ -1 +0,0 @@
|
|||
.git/
|
112
vendor/git.apache.org/thrift.git/.editorconfig
generated
vendored
112
vendor/git.apache.org/thrift.git/.editorconfig
generated
vendored
|
@ -1,112 +0,0 @@
|
|||
#
|
||||
## 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.
|
||||
##
|
||||
#
|
||||
|
||||
# EditorConfig: http://editorconfig.org
|
||||
# see doc/coding_standards.md
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
# ActionScript
|
||||
# [*.as]
|
||||
|
||||
# C
|
||||
# [*.c]
|
||||
|
||||
# C++
|
||||
[*.cpp]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# C-Sharp
|
||||
# [*.cs]
|
||||
|
||||
# D
|
||||
# [*.d]
|
||||
|
||||
# Erlang
|
||||
# [*.erl]
|
||||
|
||||
# Go-lang
|
||||
[*.go]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
# C header files
|
||||
# [*.h]
|
||||
|
||||
# Haskell
|
||||
# [*.hs]
|
||||
|
||||
# Haxe
|
||||
# [*.hx]
|
||||
|
||||
# Java
|
||||
# [*.java]
|
||||
|
||||
# Javascript
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# JSON
|
||||
[*.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Lua
|
||||
# [*.lua]
|
||||
|
||||
[*.markdown]
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.md]
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# OCaml
|
||||
# [*.ml]
|
||||
|
||||
# Delphi Pascal
|
||||
# [*.pas]
|
||||
|
||||
# PHP
|
||||
# [*.php]
|
||||
|
||||
# Perl
|
||||
# [*.pm]
|
||||
|
||||
# Python
|
||||
# [*.py]
|
||||
|
||||
# Ruby
|
||||
# [*.rb]
|
||||
|
||||
# Typescript
|
||||
# [*.ts]
|
||||
|
||||
# XML
|
||||
# [*.xml]
|
9
vendor/git.apache.org/thrift.git/.eslintignore
generated
vendored
9
vendor/git.apache.org/thrift.git/.eslintignore
generated
vendored
|
@ -1,9 +0,0 @@
|
|||
# TODO: Use eslint on js lib and generated code
|
||||
|
||||
# Ignore lib/js for now, which uses jshint currently
|
||||
lib/js/*
|
||||
# Ignore all generated code for now
|
||||
**/gen-*
|
||||
|
||||
# Don't lint nested node_modules
|
||||
**/node_modules
|
24
vendor/git.apache.org/thrift.git/.eslintrc.json
generated
vendored
24
vendor/git.apache.org/thrift.git/.eslintrc.json
generated
vendored
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"no-var": "error",
|
||||
"prefer-const": "error",
|
||||
"no-constant-condition": [
|
||||
"error",
|
||||
{
|
||||
"checkLoops": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
1
vendor/git.apache.org/thrift.git/.gitattributes
generated
vendored
1
vendor/git.apache.org/thrift.git/.gitattributes
generated
vendored
|
@ -1 +0,0 @@
|
|||
* text=auto
|
59
vendor/git.apache.org/thrift.git/.github/stale.yml
generated
vendored
59
vendor/git.apache.org/thrift.git/.github/stale.yml
generated
vendored
|
@ -1,59 +0,0 @@
|
|||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 60
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 7
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- Do Not Merge
|
||||
- blocked
|
||||
- pinned
|
||||
- security
|
||||
- "[Status] Maybe Later"
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: wontfix
|
||||
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed in 7 days if no further activity occurs.
|
||||
Thank you for your contributions.
|
||||
|
||||
# Comment to post when removing the stale label.
|
||||
unmarkComment: >
|
||||
This issue is no longer stale.
|
||||
Thank you for your contributions.
|
||||
|
||||
# Comment to post when closing a stale Issue or Pull Request.
|
||||
closeComment: >
|
||||
This issue has been automatically closed due to inactivity.
|
||||
Thank you for your contributions.
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
# Limit to only `issues` or `pulls`
|
||||
# only: issues
|
||||
|
||||
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
|
||||
# pulls:
|
||||
# daysUntilStale: 30
|
||||
# markComment: >
|
||||
# This pull request has been automatically marked as stale because it has not had
|
||||
# recent activity. It will be closed if no further activity occurs. Thank you
|
||||
# for your contributions.
|
||||
|
||||
# issues:
|
||||
# exemptLabels:
|
||||
# - confirmed
|
395
vendor/git.apache.org/thrift.git/.gitignore
generated
vendored
395
vendor/git.apache.org/thrift.git/.gitignore
generated
vendored
|
@ -1,395 +0,0 @@
|
|||
# generic ignores
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
*.deps
|
||||
*.dirstamp
|
||||
*.libs
|
||||
*.log
|
||||
*.trs
|
||||
*.suo
|
||||
*.pyc
|
||||
*.cache
|
||||
*.user
|
||||
*.ipch
|
||||
*.sdf
|
||||
*.jar
|
||||
*.exe
|
||||
*.dll
|
||||
*_ReSharper*
|
||||
*.opensdf
|
||||
*.swp
|
||||
*.hi
|
||||
*~
|
||||
tags
|
||||
|
||||
.*project
|
||||
.classpath
|
||||
.dub
|
||||
.settings
|
||||
.checkstyle
|
||||
junit*.properties
|
||||
.idea
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
gen-*
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
acinclude.m4
|
||||
apache-thrift-test-library
|
||||
autom4te.cache
|
||||
cmake-*
|
||||
dub.selections.json
|
||||
libapache-thrift.a
|
||||
node_modules
|
||||
compile
|
||||
test-driver
|
||||
erl_crash.dump
|
||||
project.lock.json
|
||||
|
||||
.sonar
|
||||
.DS_Store
|
||||
.svn
|
||||
.vagrant
|
||||
.vscode
|
||||
.vs
|
||||
|
||||
/aclocal/libtool.m4
|
||||
/aclocal/lt*.m4
|
||||
/autoscan.log
|
||||
/autoscan-*.log
|
||||
/cmake_*
|
||||
/compiler/cpp/compiler.VC.db
|
||||
/compiler/cpp/compiler.VC.VC.opendb
|
||||
/compiler/cpp/test/plugin/t_cpp_generator.cc
|
||||
/compiler/cpp/src/thrift/plugin/plugin_constants.cpp
|
||||
/compiler/cpp/src/thrift/plugin/plugin_constants.h
|
||||
/compiler/cpp/src/thrift/plugin/plugin_types.cpp
|
||||
/compiler/cpp/src/thrift/plugin/plugin_types.h
|
||||
/compiler/cpp/test/*test
|
||||
/compiler/cpp/test/thrift-gen-*
|
||||
/compiler/cpp/src/thrift/thrift-bootstrap
|
||||
/compiler/cpp/src/thrift/plugin/gen.stamp
|
||||
/compiler/cpp/Debug
|
||||
/compiler/cpp/Release
|
||||
/compiler/cpp/src/thrift/libparse.a
|
||||
/compiler/cpp/src/thrift/thriftl.cc
|
||||
/compiler/cpp/src/thrift/thrifty.cc
|
||||
/compiler/cpp/src/thrift/thrifty.hh
|
||||
/compiler/cpp/src/thrift/windows/version.h
|
||||
/compiler/cpp/thrift
|
||||
/compiler/cpp/thriftl.cc
|
||||
/compiler/cpp/thrifty.cc
|
||||
/compiler/cpp/lex.yythriftl.cc
|
||||
/compiler/cpp/thrifty.h
|
||||
/compiler/cpp/thrifty.hh
|
||||
/compiler/cpp/src/thrift/version.h
|
||||
/config.*
|
||||
/configure
|
||||
/configure.lineno
|
||||
/configure.scan
|
||||
/contrib/.vagrant/
|
||||
/contrib/fb303/config.cache
|
||||
/contrib/fb303/config.log
|
||||
/contrib/fb303/config.status
|
||||
/contrib/fb303/configure
|
||||
/contrib/fb303/cpp/libfb303.a
|
||||
/contrib/fb303/java/build/
|
||||
/contrib/fb303/py/build/
|
||||
/contrib/fb303/py/fb303/FacebookService-remote
|
||||
/contrib/fb303/py/fb303/FacebookService.py
|
||||
/contrib/fb303/py/fb303/__init__.py
|
||||
/contrib/fb303/py/fb303/constants.py
|
||||
/contrib/fb303/py/fb303/ttypes.py
|
||||
/depcomp
|
||||
/install-sh
|
||||
/lib/cl/backport-update.zip
|
||||
/lib/cl/lib
|
||||
/lib/cl/run-tests
|
||||
/lib/cl/quicklisp.lisp
|
||||
/lib/cl/externals/
|
||||
/lib/cl/run-tests
|
||||
/lib/cl/quicklisp/
|
||||
/lib/cpp/Debug/
|
||||
/lib/cpp/Debug-mt/
|
||||
/lib/cpp/Release/
|
||||
/lib/cpp/Release-mt/
|
||||
/lib/cpp/src/thrift/qt/moc_TQTcpServer.cpp
|
||||
/lib/cpp/src/thrift/qt/moc__TQTcpServer.cpp
|
||||
/lib/cpp/src/thrift/config.h
|
||||
/lib/cpp/src/thrift/stamp-h2
|
||||
/lib/cpp/test/Benchmark
|
||||
/lib/cpp/test/AllProtocolsTest
|
||||
/lib/cpp/test/AnnotationTest
|
||||
/lib/cpp/test/DebugProtoTest
|
||||
/lib/cpp/test/DenseProtoTest
|
||||
/lib/cpp/test/EnumTest
|
||||
/lib/cpp/test/JSONProtoTest
|
||||
/lib/cpp/test/OptionalRequiredTest
|
||||
/lib/cpp/test/SecurityTest
|
||||
/lib/cpp/test/SpecializationTest
|
||||
/lib/cpp/test/RecursiveTest
|
||||
/lib/cpp/test/ReflectionTest
|
||||
/lib/cpp/test/RenderedDoubleConstantsTest
|
||||
/lib/cpp/test/TFDTransportTest
|
||||
/lib/cpp/test/TFileTransportTest
|
||||
/lib/cpp/test/TInterruptTest
|
||||
/lib/cpp/test/TNonblockingServerTest
|
||||
/lib/cpp/test/TNonblockingSSLServerTest
|
||||
/lib/cpp/test/TPipedTransportTest
|
||||
/lib/cpp/test/TServerIntegrationTest
|
||||
/lib/cpp/test/TSocketInterruptTest
|
||||
/lib/cpp/test/TransportTest
|
||||
/lib/cpp/test/UnitTests
|
||||
/lib/cpp/test/ZlibTest
|
||||
/lib/cpp/test/OpenSSLManualInitTest
|
||||
/lib/cpp/test/concurrency_test
|
||||
/lib/cpp/test/link_test
|
||||
/lib/cpp/test/processor_test
|
||||
/lib/cpp/test/tests.xml
|
||||
/lib/cpp/concurrency_test
|
||||
/lib/cpp/*.pc
|
||||
/lib/cpp/x64/Debug/
|
||||
/lib/cpp/x64/Debug-mt/
|
||||
/lib/cpp/x64/Release
|
||||
/lib/cpp/x64/Release-mt
|
||||
/lib/c_glib/*.gcda
|
||||
/lib/c_glib/*.gcno
|
||||
/lib/c_glib/*.loT
|
||||
/lib/c_glib/src/thrift/config.h
|
||||
/lib/c_glib/src/thrift/stamp-h3
|
||||
/lib/c_glib/test/*.gcno
|
||||
/lib/c_glib/test/testwrapper.sh
|
||||
/lib/c_glib/test/testwrapper-test*
|
||||
/lib/c_glib/test/testapplicationexception
|
||||
/lib/c_glib/test/testbinaryprotocol
|
||||
/lib/c_glib/test/testcompactprotocol
|
||||
/lib/c_glib/test/testbufferedtransport
|
||||
/lib/c_glib/test/testcontainertest
|
||||
/lib/c_glib/test/testdebugproto
|
||||
/lib/c_glib/test/testfdtransport
|
||||
/lib/c_glib/test/testframedtransport
|
||||
/lib/c_glib/test/testmemorybuffer
|
||||
/lib/c_glib/test/testoptionalrequired
|
||||
/lib/c_glib/test/testtransportsslsocket
|
||||
/lib/c_glib/test/testsimpleserver
|
||||
/lib/c_glib/test/teststruct
|
||||
/lib/c_glib/test/testthrifttest
|
||||
/lib/c_glib/test/testthrifttestclient
|
||||
/lib/c_glib/test/testtransportsocket
|
||||
/lib/c_glib/test/testserialization
|
||||
/lib/c_glib/thriftc.pc
|
||||
/lib/c_glib/thrift_c_glib.pc
|
||||
/lib/csharp/**/bin/
|
||||
/lib/csharp/**/obj/
|
||||
/lib/csharp/src/packages
|
||||
/lib/d/test/*.pem
|
||||
/lib/d/libthriftd*.a
|
||||
/lib/d/test/async_test
|
||||
/lib/d/test/client_pool_test
|
||||
/lib/d/test/serialization_benchmark
|
||||
/lib/d/test/stress_test_server
|
||||
/lib/d/test/thrift_test_client
|
||||
/lib/d/test/thrift_test_server
|
||||
/lib/d/test/transport_test
|
||||
/lib/d/unittest/
|
||||
/lib/dart/coverage
|
||||
/lib/dart/**/.packages
|
||||
/lib/dart/**/packages
|
||||
/lib/dart/**/.pub/
|
||||
/lib/dart/**/pubspec.lock
|
||||
/lib/delphi/test/skip/*.request
|
||||
/lib/delphi/test/skip/*.response
|
||||
/lib/delphi/**/*.identcache
|
||||
/lib/delphi/**/*.local
|
||||
/lib/delphi/**/*.dcu
|
||||
/lib/delphi/**/*.2007
|
||||
/lib/delphi/**/*.dproj
|
||||
/lib/delphi/**/codegen/*.bat
|
||||
/lib/erl/.eunit
|
||||
/lib/erl/.generated
|
||||
/lib/erl/.rebar/
|
||||
/lib/erl/deps/
|
||||
/lib/erl/ebin
|
||||
/lib/erl/src/thrift.app.src
|
||||
/lib/erl/test/*.beam
|
||||
/lib/erl/test/*.hrl
|
||||
/lib/erl/test/Thrift_omit_without.thrift
|
||||
/lib/haxe/test/bin
|
||||
/lib/haxe/test/data.tmp
|
||||
/lib/hs/dist
|
||||
/lib/java/.gradle
|
||||
/lib/java/android/.gradle
|
||||
/lib/java/build
|
||||
/lib/java/target
|
||||
/lib/js/dist
|
||||
/lib/js/doc
|
||||
/lib/js/test/build
|
||||
/lib/netcore/**/bin
|
||||
/lib/netcore/**/obj
|
||||
/lib/nodejs/coverage
|
||||
/lib/nodejs/node_modules/
|
||||
/lib/perl/MANIFEST
|
||||
/lib/perl/MYMETA.json
|
||||
/lib/perl/MYMETA.yml
|
||||
/lib/perl/Makefile-perl.mk
|
||||
/lib/perl/blib
|
||||
/lib/perl/pm_to_blib
|
||||
/lib/py/build
|
||||
/lib/py/thrift.egg-info/
|
||||
/lib/rb/Gemfile.lock
|
||||
/lib/rb/debug_proto_test
|
||||
/lib/rb/.config
|
||||
/lib/rb/ext/conftest.dSYM/
|
||||
/lib/rb/ext/mkmf.log
|
||||
/lib/rb/ext/thrift_native.bundle
|
||||
/lib/rb/ext/thrift_native.so
|
||||
/lib/rb/test/
|
||||
/lib/rb/thrift-*.gem
|
||||
/lib/php/src/ext/thrift_protocol/Makefile.*
|
||||
/lib/php/src/ext/thrift_protocol/build/
|
||||
/lib/php/src/ext/thrift_protocol/config.*
|
||||
/lib/php/src/ext/thrift_protocol/configure
|
||||
/lib/php/src/ext/thrift_protocol/configure.ac
|
||||
/lib/php/src/ext/thrift_protocol/configure.in
|
||||
/lib/php/src/ext/thrift_protocol/install-sh
|
||||
/lib/php/src/ext/thrift_protocol/libtool
|
||||
/lib/php/src/ext/thrift_protocol/ltmain.sh
|
||||
/lib/php/src/ext/thrift_protocol/missing
|
||||
/lib/php/src/ext/thrift_protocol/mkinstalldirs
|
||||
/lib/php/src/ext/thrift_protocol/modules/
|
||||
/lib/php/src/ext/thrift_protocol/php_thrift_protocol.lo
|
||||
/lib/php/src/ext/thrift_protocol/run-tests.php
|
||||
/lib/php/src/ext/thrift_protocol/thrift_protocol.la
|
||||
/lib/php/src/ext/thrift_protocol/tmp-php.ini
|
||||
/lib/php/src/packages/
|
||||
/lib/php/test/TEST-*.xml
|
||||
/lib/php/test/packages/
|
||||
/lib/py/dist/
|
||||
/lib/erl/logs/
|
||||
/lib/go/pkg
|
||||
/lib/go/src
|
||||
/lib/go/test/gopath/
|
||||
/lib/go/test/ThriftTest.thrift
|
||||
/lib/rs/target/
|
||||
/lib/rs/Cargo.lock
|
||||
/lib/rs/test/Cargo.lock
|
||||
/lib/rs/test/target/
|
||||
/lib/rs/test/bin/
|
||||
/lib/rs/test/src/base_one.rs
|
||||
/lib/rs/test/src/base_two.rs
|
||||
/lib/rs/test/src/midlayer.rs
|
||||
/lib/rs/test/src/recursive.rs
|
||||
/lib/rs/test/src/ultimate.rs
|
||||
/lib/rs/*.iml
|
||||
/lib/rs/**/*.iml
|
||||
/libtool
|
||||
/ltmain.sh
|
||||
/missing
|
||||
/node_modules/
|
||||
/vendor/
|
||||
/composer.lock
|
||||
/stamp-h1
|
||||
/test/features/results.json
|
||||
/test/results.json
|
||||
/test/c_glib/test_client
|
||||
/test/c_glib/test_server
|
||||
/test/cl/TestServer
|
||||
/test/cl/TestClient
|
||||
/test/cpp/StressTest
|
||||
/test/cpp/StressTestNonBlocking
|
||||
/test/cpp/TestClient
|
||||
/test/cpp/TestServer
|
||||
/test/csharp/obj
|
||||
/test/csharp/bin
|
||||
/test/dart/**/.packages
|
||||
/test/dart/**/packages
|
||||
/test/dart/**/.pub/
|
||||
/test/dart/**/pubspec.lock
|
||||
/test/log/
|
||||
/test/test.log
|
||||
/test/erl/.generated
|
||||
/test/erl/.rebar
|
||||
/test/erl/ebin
|
||||
/test/go/bin/
|
||||
/test/go/ThriftTest.thrift
|
||||
/test/go/gopath
|
||||
/test/go/pkg/
|
||||
/test/go/src/code.google.com/
|
||||
/test/go/src/common/mock_handler.go
|
||||
/test/go/src/github.com/golang/
|
||||
/test/go/src/golang.org/
|
||||
/test/go/src/gen/
|
||||
/test/go/src/thrift
|
||||
/test/haxe/bin
|
||||
/test/hs/TestClient
|
||||
/test/hs/TestServer
|
||||
/test/php/php_ext_dir/
|
||||
/test/py.twisted/_trial_temp/
|
||||
/test/rb/Gemfile.lock
|
||||
/test/netcore/**/bin
|
||||
/test/netcore/**/obj
|
||||
/test/netcore/Thrift
|
||||
/test/php/php_ext_dir/
|
||||
/test/rs/Cargo.lock
|
||||
/test/rs/src/thrift_test.rs
|
||||
/test/rs/bin/
|
||||
/test/rs/target/
|
||||
/test/rs/*.iml
|
||||
/test/rs/**/*.iml
|
||||
/lib/cl/backport-update.zip
|
||||
/lib/cl/lib
|
||||
/tutorial/cl/quicklisp.lisp
|
||||
/tutorial/cl/externals/
|
||||
/tutorial/cl/quicklisp/
|
||||
/tutorial/cl/TutorialClient
|
||||
/tutorial/cl/TutorialServer
|
||||
/tutorial/cl/backport-update.zip
|
||||
/tutorial/cl/lib/
|
||||
/tutorial/cl/shared-implementation.fasl
|
||||
/tutorial/cl/tutorial-implementation.fasl
|
||||
/tutorial/cpp/TutorialClient
|
||||
/tutorial/cpp/TutorialServer
|
||||
/tutorial/c_glib/tutorial_client
|
||||
/tutorial/c_glib/tutorial_server
|
||||
/tutorial/csharp/CsharpServer/obj
|
||||
/tutorial/csharp/CsharpServer/bin
|
||||
/tutorial/csharp/CsharpClient/obj
|
||||
/tutorial/csharp/CsharpClient/bin
|
||||
/tutorial/d/async_client
|
||||
/tutorial/d/client
|
||||
/tutorial/d/server
|
||||
/tutorial/dart/**/.packages
|
||||
/tutorial/dart/**/packages
|
||||
/tutorial/dart/**/.pub/
|
||||
/tutorial/dart/**/pubspec.lock
|
||||
/tutorial/delphi/**/*.dsk
|
||||
/tutorial/delphi/**/*.local
|
||||
/tutorial/delphi/**/*.tvsconfig
|
||||
/tutorial/delphi/**/dcu
|
||||
/tutorial/delphi/**/*.local
|
||||
/tutorial/delphi/**/*.identcache
|
||||
/tutorial/go/gopath
|
||||
/tutorial/go/go-tutorial
|
||||
/tutorial/go/calculator-remote
|
||||
/tutorial/go/src/shared
|
||||
/tutorial/go/src/tutorial
|
||||
/tutorial/go/src/git.apache.org
|
||||
/tutorial/go/src/golang.org
|
||||
/tutorial/haxe/bin
|
||||
/tutorial/hs/dist/
|
||||
/tutorial/java/build/
|
||||
/tutorial/js/build/
|
||||
/tutorial/netcore/**/bin
|
||||
/tutorial/netcore/**/obj
|
||||
/tutorial/netcore/Thrift
|
||||
/tutorial/rs/*.iml
|
||||
/tutorial/rs/src/shared.rs
|
||||
/tutorial/rs/src/tutorial.rs
|
||||
/tutorial/rs/bin
|
||||
/tutorial/rs/target
|
||||
/tutorial/rs/Cargo.lock
|
||||
/ylwrap
|
||||
|
64
vendor/git.apache.org/thrift.git/.rustfmt.toml
generated
vendored
64
vendor/git.apache.org/thrift.git/.rustfmt.toml
generated
vendored
|
@ -1,64 +0,0 @@
|
|||
max_width = 100
|
||||
hard_tabs = false
|
||||
tab_spaces = 4
|
||||
newline_style = "Auto"
|
||||
use_small_heuristics = "Default"
|
||||
indent_style = "Block"
|
||||
wrap_comments = false
|
||||
format_doc_comments = false
|
||||
comment_width = 80
|
||||
normalize_comments = false
|
||||
normalize_doc_attributes = false
|
||||
license_template_path = ""
|
||||
format_strings = false
|
||||
format_macro_matchers = false
|
||||
format_macro_bodies = true
|
||||
empty_item_single_line = true
|
||||
struct_lit_single_line = true
|
||||
fn_single_line = false
|
||||
where_single_line = false
|
||||
imports_indent = "Block"
|
||||
imports_layout = "Mixed"
|
||||
merge_imports = false
|
||||
reorder_imports = true
|
||||
reorder_modules = true
|
||||
reorder_impl_items = false
|
||||
type_punctuation_density = "Wide"
|
||||
space_before_colon = false
|
||||
space_after_colon = true
|
||||
spaces_around_ranges = false
|
||||
binop_separator = "Front"
|
||||
remove_nested_parens = true
|
||||
combine_control_expr = true
|
||||
overflow_delimited_expr = false
|
||||
struct_field_align_threshold = 0
|
||||
enum_discrim_align_threshold = 0
|
||||
match_arm_blocks = true
|
||||
force_multiline_blocks = false
|
||||
fn_args_density = "Tall"
|
||||
brace_style = "SameLineWhere"
|
||||
control_brace_style = "AlwaysSameLine"
|
||||
trailing_semicolon = true
|
||||
trailing_comma = "Vertical"
|
||||
match_block_trailing_comma = false
|
||||
blank_lines_upper_bound = 1
|
||||
blank_lines_lower_bound = 0
|
||||
edition = "2015"
|
||||
merge_derives = true
|
||||
use_try_shorthand = false
|
||||
use_field_init_shorthand = false
|
||||
force_explicit_abi = true
|
||||
condense_wildcard_suffixes = false
|
||||
color = "Auto"
|
||||
required_version = "1.0.0"
|
||||
unstable_features = false
|
||||
disable_all_formatting = false
|
||||
skip_children = false
|
||||
hide_parse_errors = false
|
||||
error_on_line_overflow = false
|
||||
error_on_unformatted = false
|
||||
report_todo = "Never"
|
||||
report_fixme = "Never"
|
||||
ignore = []
|
||||
emit_mode = "Files"
|
||||
make_backup = false
|
181
vendor/git.apache.org/thrift.git/.travis.yml
generated
vendored
181
vendor/git.apache.org/thrift.git/.travis.yml
generated
vendored
|
@ -1,181 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# build Apache Thrift on Travis CI - https://travis-ci.org/
|
||||
|
||||
#
|
||||
# Docker Integration
|
||||
# see: build/docker/README.md
|
||||
#
|
||||
|
||||
sudo: required
|
||||
dist: trusty
|
||||
language: cpp
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
install:
|
||||
- if [[ `uname` == "Linux" ]]; then build/docker/refresh.sh; fi
|
||||
|
||||
stages:
|
||||
- docker # docker images
|
||||
- thrift # thrift build jobs
|
||||
|
||||
env:
|
||||
global:
|
||||
- SCRIPT="cmake.sh"
|
||||
- BUILD_ARG=""
|
||||
- BUILD_ENV="-e CC=gcc -e CXX=g++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
||||
- DISTRO=ubuntu-bionic
|
||||
- BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
|
||||
- TRAVIS_BUILD_STAGE=test
|
||||
# DOCKER_REPO (this works for all builds as a source for docker images - you can override for fork builds in your Travis settings)
|
||||
- DOCKER_REPO="thrift/thrift-build"
|
||||
# DOCKER_USER (provide in your Travis settings if you want to build and update docker images once, instead of on every job)
|
||||
# DOCKER_PASS (same)
|
||||
|
||||
jobs:
|
||||
include:
|
||||
# ========================= stage: docker =========================
|
||||
- stage: docker
|
||||
script: true
|
||||
env:
|
||||
- JOB="Docker Build ubuntu-xenial 16.04 LTS"
|
||||
- DISTRO=ubuntu-xenial
|
||||
- TRAVIS_BUILD_STAGE=docker
|
||||
- script: true
|
||||
env:
|
||||
- JOB="Docker Build ubuntu-bionic 18.04 LTS"
|
||||
- DISTRO=ubuntu-bionic
|
||||
- TRAVIS_BUILD_STAGE=docker
|
||||
|
||||
# ========================= stage: thrift =======================
|
||||
# ------------------------- phase: cross ------------------------
|
||||
# apache/thrift official PR builds can exceed 50 minutes per job so combine all cross tests
|
||||
- stage: thrift
|
||||
script: build/docker/run.sh
|
||||
if: repo = apache/thrift
|
||||
env:
|
||||
- JOB="Cross Language Tests"
|
||||
- SCRIPT="cross-test.sh"
|
||||
|
||||
# fork based PR builds cannot exceed 50 minutes per job
|
||||
- stage: thrift
|
||||
script: build/docker/run.sh
|
||||
if: repo != apache/thrift
|
||||
env:
|
||||
- JOB="Cross Language Tests (Binary Protocol)"
|
||||
- SCRIPT="cross-test.sh"
|
||||
- BUILD_ARG="-'(binary)'"
|
||||
|
||||
- stage: thrift
|
||||
script: build/docker/run.sh
|
||||
if: repo != apache/thrift
|
||||
env:
|
||||
- JOB="Cross Language Tests (Header, JSON Protocols)"
|
||||
- SCRIPT="cross-test.sh"
|
||||
- BUILD_ARG="-'(header|json)'"
|
||||
|
||||
- stage: thrift
|
||||
script: build/docker/run.sh
|
||||
if: repo != apache/thrift
|
||||
env:
|
||||
- JOB="Cross Language Tests (Compact and Multiplexed Protocols)"
|
||||
- SCRIPT="cross-test.sh"
|
||||
- BUILD_ARG="-'(compact|multiplexed)'"
|
||||
|
||||
# ------------------------- phase: sca --------------------------
|
||||
# QA jobs for code analytics and metrics
|
||||
- stage: thrift
|
||||
script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="Static Code Analysis"
|
||||
- SCRIPT="sca.sh"
|
||||
|
||||
# C and C++ undefined behavior.
|
||||
# A binary crashes if undefined behavior occurs and produces a stack trace.
|
||||
# python is disabled, see: THRIFT-4360
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="UBSan"
|
||||
- SCRIPT="ubsan.sh"
|
||||
- BUILD_ARG="--without-python --without-py3"
|
||||
|
||||
# ------------------------- phase: autotools --------------------
|
||||
# TODO: Remove them once migrated to CMake
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="Autotools (Ubuntu Bionic)"
|
||||
- SCRIPT="autotools.sh"
|
||||
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="Autotools (Ubuntu Xenial)"
|
||||
- DISTRO=ubuntu-xenial
|
||||
- SCRIPT="autotools.sh"
|
||||
|
||||
# ------------------------- phase: cmake ------------------------
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="CMake"
|
||||
|
||||
# C++ specific options: compiler plug-in, threading model
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="C++98 (Boost Thread)"
|
||||
- SCRIPT="cmake.sh"
|
||||
- BUILD_LIBS="CPP TESTING TUTORIALS"
|
||||
- BUILD_ARG="-DCMAKE_CXX_STANDARD=98 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF --DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
||||
- BUILD_ENV="-e CC=clang -e CXX=clang++"
|
||||
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="C++ (Std Thread) and Plugin"
|
||||
- SCRIPT="cmake.sh"
|
||||
- BUILD_LIBS="CPP TESTING TUTORIALS"
|
||||
- BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
||||
- BUILD_ENV="-e CC=clang -e CXX=clang++"
|
||||
|
||||
# ------------------------- phase: dist -------------------------
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="make dist"
|
||||
- SCRIPT="make-dist.sh"
|
||||
|
||||
- script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="Debian Packages"
|
||||
- SCRIPT="dpkg.sh"
|
||||
|
||||
# ------------------------- phase: coverity ---------------------
|
||||
# We build the coverity scan build once monthly using a travis cron job
|
||||
- if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (master)) AND (type IN (cron))
|
||||
script: build/docker/run.sh
|
||||
env:
|
||||
- JOB="Coverity Scan"
|
||||
- SCRIPT="covscan.sh"
|
||||
|
||||
|
||||
### ------------------------- phase: osx --------------------------
|
||||
# disabled due to the time delays it imposes on build jobs
|
||||
# - os: osx
|
||||
# osx_image: xcode9
|
||||
# script: build/docker/scripts/autotools.sh
|
||||
|
2913
vendor/git.apache.org/thrift.git/CHANGES
generated
vendored
2913
vendor/git.apache.org/thrift.git/CHANGES
generated
vendored
File diff suppressed because it is too large
Load diff
124
vendor/git.apache.org/thrift.git/CMakeLists.txt
generated
vendored
124
vendor/git.apache.org/thrift.git/CMakeLists.txt
generated
vendored
|
@ -1,124 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
# CMake 3.1 supports C++ standards selection with CMAKE_CXX_STANDARD
|
||||
# If you need CMake 3.1+ for Ubuntu 14.04, try
|
||||
# https://launchpad.net/~george-edison55/+archive/ubuntu/cmake-3.x
|
||||
# If you need CMake 3.1+ for debian "jessie", get it from jessie-backports
|
||||
# Otherwise
|
||||
# http://cmake.org
|
||||
|
||||
project("Apache Thrift")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
|
||||
|
||||
# TODO: add `git rev-parse --short HEAD`
|
||||
# Read the version information from the Autoconf file
|
||||
file (STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" CONFIGURE_AC REGEX "AC_INIT\\(.*\\)" )
|
||||
|
||||
# The following variable is used in the version.h.in file
|
||||
string(REGEX REPLACE "AC_INIT\\(\\[.*\\], \\[([0-9]+\\.[0-9]+\\.[0-9]+(-dev)?)\\]\\)" "\\1" PACKAGE_VERSION ${CONFIGURE_AC})
|
||||
message(STATUS "Parsed Thrift package version: ${PACKAGE_VERSION}")
|
||||
|
||||
# These are internal to CMake
|
||||
string(REGEX REPLACE "([0-9]+\\.[0-9]+\\.[0-9]+)(-dev)?" "\\1" thrift_VERSION ${PACKAGE_VERSION})
|
||||
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" thrift_VERSION_MAJOR ${thrift_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" thrift_VERSION_MINOR ${thrift_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" thrift_VERSION_PATCH ${thrift_VERSION})
|
||||
message(STATUS "Parsed Thrift version: ${thrift_VERSION} (${thrift_VERSION_MAJOR}.${thrift_VERSION_MINOR}.${thrift_VERSION_PATCH})")
|
||||
|
||||
# Some default settings
|
||||
include(DefineCMakeDefaults)
|
||||
|
||||
# Build time options are defined here
|
||||
include(DefineOptions)
|
||||
include(DefineInstallationPaths)
|
||||
|
||||
# Based on the options set some platform specifics
|
||||
include(DefinePlatformSpecifc)
|
||||
|
||||
# Generate the config.h file
|
||||
include(ConfigureChecks)
|
||||
|
||||
# Package it
|
||||
include(CPackConfig)
|
||||
|
||||
|
||||
find_package(Threads)
|
||||
|
||||
include(CTest)
|
||||
if(BUILD_TESTING)
|
||||
message(STATUS "Building with unittests")
|
||||
|
||||
enable_testing()
|
||||
# Define "make check" as alias for "make test"
|
||||
add_custom_target(check COMMAND ctest)
|
||||
else ()
|
||||
message(STATUS "Building without tests")
|
||||
endif ()
|
||||
|
||||
if(BUILD_COMPILER)
|
||||
if(NOT EXISTS ${THRIFT_COMPILER})
|
||||
set(THRIFT_COMPILER $<TARGET_FILE:thrift-compiler>)
|
||||
endif()
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/compiler/cpp)
|
||||
elseif(EXISTS ${THRIFT_COMPILER})
|
||||
add_executable(thrift-compiler IMPORTED)
|
||||
set_property(TARGET thrift-compiler PROPERTY IMPORTED_LOCATION ${THRIFT_COMPILER})
|
||||
endif()
|
||||
|
||||
if(BUILD_CPP)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/cpp)
|
||||
if(BUILD_TUTORIALS)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tutorial/cpp)
|
||||
endif()
|
||||
if(BUILD_TESTING)
|
||||
if(WITH_LIBEVENT AND WITH_ZLIB AND WITH_OPENSSL)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/cpp)
|
||||
else()
|
||||
message(WARNING "libevent and/or ZLIB and/or OpenSSL not found or disabled; will not build some tests")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_C_GLIB)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/c_glib)
|
||||
endif()
|
||||
|
||||
if(BUILD_JAVA)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/java)
|
||||
endif()
|
||||
|
||||
if(BUILD_PYTHON)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/py)
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/py)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_HASKELL)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/hs)
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/hs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
PRINT_CONFIG_SUMMARY()
|
116
vendor/git.apache.org/thrift.git/CONTRIBUTING.md
generated
vendored
116
vendor/git.apache.org/thrift.git/CONTRIBUTING.md
generated
vendored
|
@ -1,116 +0,0 @@
|
|||
# How to Contribute #
|
||||
|
||||
Thank you for your interest in contributing to the Apache Thrift project! Information on why and how to contribute is available on the Apache Software Foundation (ASF) web site. In particular, we recommend the following to become acquainted with Apache Contributions:
|
||||
|
||||
* [Contributors Tech Guide](http://www.apache.org/dev/contributors)
|
||||
* [Get involved!](http://www.apache.org/foundation/getinvolved.html)
|
||||
* [Legal aspects on Submission of Contributions (Patches)](http://www.apache.org/licenses/LICENSE-2.0.html#contributions)
|
||||
|
||||
## GitHub pull requests ##
|
||||
|
||||
This is the preferred method of submitting changes. When you submit a pull request through github,
|
||||
it activates the continuous integration (CI) build systems at Appveyor and Travis to build your changesxi
|
||||
on a variety of Linux and Windows configurations and run all the test suites. Follow these requirements
|
||||
for a successful pull request:
|
||||
|
||||
1. All code changes require an [Apache Jira THRIFT Issue](http://issues.apache.org/jira/browse/THRIFT) ticket.
|
||||
|
||||
1. All pull requests should contain a single commit per issue, or we will ask you to squash it.
|
||||
1. The pull request title must begin with the Jira THRIFT ticket identifier, for example:
|
||||
|
||||
THRIFT-9999: an example pull request title
|
||||
|
||||
1. Commit messages must follow this pattern for code changes (deviations will not be merged):
|
||||
|
||||
THRIFT-9999: [summary of fix, one line if possible]
|
||||
Client: [language(s) affected, comma separated, use lib/ directory names please]
|
||||
|
||||
Instructions:
|
||||
|
||||
1. Create a fork in your GitHub account of http://github.com/apache/thrift
|
||||
1. Clone the fork to your development system.
|
||||
1. Create a branch for your changes (best practice is issue as branch name, e.g. THRIFT-9999).
|
||||
1. Modify the source to include the improvement/bugfix, and:
|
||||
|
||||
* Remember to provide *tests* for all submitted changes!
|
||||
* Use test-driven development (TDD): add a test that will isolate the bug *before* applying the change that fixes it.
|
||||
* Verify that you follow [Thrift Coding Standards](/docs/coding_standards) (you can run 'make style', which ensures proper format for some languages).
|
||||
* [*optional*] Verify that your change works on other platforms by adding a GitHub service hook to [Travis CI](http://docs.travis-ci.com/user/getting-started/#Step-one%3A-Sign-in) and [AppVeyor](http://www.appveyor.com/docs). You can use this technique to run the Thrift CI jobs in your account to check your changes before they are made public. Every GitHub pull request into Thrift will run the full CI build and test suite on your changes.
|
||||
|
||||
1. Squash your changes to a single commit. This maintains clean change history.
|
||||
1. Commit and push changes to your branch (please use issue name and description as commit title, e.g. "THRIFT-9999: make it perfect"), with the affected languages on the next line of the description.
|
||||
1. Use GitHub to create a pull request going from your branch to apache:master. Ensure that the Jira ticket number is at the beginning of the title of your pull request, same as the commit title.
|
||||
1. Wait for other contributors or committers to review your new addition, and for a CI build to complete.
|
||||
1. Wait for a committer to commit your patch. You can nudge the committers if necessary by sending a message to the [Apache Thrift mailing list](https://thrift.apache.org/mailing).
|
||||
|
||||
## If you want to build the project locally ##
|
||||
|
||||
For Windows systems, see our detailed instructions on the [CMake README](/build/cmake/README.md).
|
||||
|
||||
For Windows Native C++ builds, see our detailed instructions on the [WinCPP README](/build/wincpp/README.md).
|
||||
|
||||
For unix systems, see our detailed instructions on the [Docker README](/build/docker/README.md).
|
||||
|
||||
## If you want to review open issues... ##
|
||||
|
||||
1. Review the [GitHub Pull Request Backlog](https://github.com/apache/thrift/pulls). Code reviews are open to all.
|
||||
2. Review the [Jira issue tracker](http://issues.apache.org/jira/browse/THRIFT). You can search for tickets relating to languages you are interested in or currently using with thrift, for example a Jira search (Issues -> Search For Issues) query of ``project = THRIFT AND component in ("Erlang - Library") and status not in (resolved, closed)`` will locate all the open Erlang Library issues.
|
||||
|
||||
## If you discovered a defect... ##
|
||||
|
||||
1. Check to see if the issue is already in the [Jira issue tracker](http://issues.apache.org/jira/browse/THRIFT).
|
||||
1. If not, create a ticket describing the change you're proposing in the Jira issue tracker.
|
||||
1. Contribute your code changes using the GitHub pull request method:
|
||||
|
||||
## Contributing via Patch ##
|
||||
|
||||
Some changes do not require a build, for example in documentation. For changes that are not code or build related, you can submit a patch on Jira for review. To create a patch from changes in your local directory:
|
||||
|
||||
git diff > ../THRIFT-NNNN.patch
|
||||
|
||||
then wait for contributors or committers to review your changes, and then for a committer to apply your patch.
|
||||
|
||||
## GitHub recipes for Pull Requests ##
|
||||
|
||||
Sometimes commmitters may ask you to take actions in your pull requests. Here are some recipes that will help you accomplish those requests. These examples assume you are working on Jira issue THRIFT-9999. You should also be familiar with the [upstream](https://help.github.com/articles/syncing-a-fork/) repository concept.
|
||||
|
||||
### Squash your changes ###
|
||||
|
||||
If you have not submitted a pull request yet, or if you have not yet rebased your existing pull request, you can squash all your commits down to a single commit. This makes life easier for the committers. If your pull request on GitHub has more than one commit, you should do this.
|
||||
|
||||
1. Use the command ``git log`` to identify how many commits you made since you began.
|
||||
2. Use the command ``git rebase -i HEAD~N`` where N is the number of commits.
|
||||
3. Leave "pull" in the first line.
|
||||
4. Change all other lines from "pull" to "fixup".
|
||||
5. All your changes are now in a single commit.
|
||||
|
||||
If you already have a pull request outstanding, you will need to do a "force push" to overwrite it since you changed your commit history:
|
||||
|
||||
git push -u origin THRIFT-9999 --force
|
||||
|
||||
A more detailed walkthrough of a squash can be found at [Git Ready](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html).
|
||||
|
||||
### Rebase your pull request ###
|
||||
|
||||
If your pull request has a conflict with master, it needs to be rebased:
|
||||
|
||||
git checkout THRIFT-9999
|
||||
git rebase upstream master
|
||||
(resolve any conflicts, make sure it builds)
|
||||
git push -u origin THRIFT-9999 --force
|
||||
|
||||
### Fix a bad merge ###
|
||||
|
||||
If your pull request contains commits that are not yours, then you should use the following technique to fix the bad merge in your branch:
|
||||
|
||||
git checkout master
|
||||
git pull upstream master
|
||||
git checkout -b THRIFT-9999-take-2
|
||||
git cherry-pick ...
|
||||
(pick only your commits from your original pull request in ascending chronological order)
|
||||
squash your changes to a single commit if there is more than one (see above)
|
||||
git push -u origin THRIFT-9999-take-2:THRIFT-9999
|
||||
|
||||
This procedure will apply only your commits in order to the current master, then you will squash them to a single commit, and then you force push your local THRIFT-9999-take-2 into remote THRIFT-9999 which represents your pull request, replacing all the commits with the new one.
|
||||
|
||||
|
355
vendor/git.apache.org/thrift.git/LANGUAGES.md
generated
vendored
355
vendor/git.apache.org/thrift.git/LANGUAGES.md
generated
vendored
|
@ -1,355 +0,0 @@
|
|||
# Apache Thrift Language Support #
|
||||
|
||||
Last Modified: 2018-12-17
|
||||
|
||||
Guidance For: 0.12.0 or later
|
||||
|
||||
Thrift supports many programming languages and has an impressive test suite that exercises most of the languages, protocols, and transports that represents a matrix of thousands of possible combinations. Each language typically has a minimum required version as well as support libraries - some mandatory and some optional. All of this information is provided below to help you assess whether you can use Apache Thrift with your project. Obviously this is a complex matrix to maintain and may not be correct in all cases - if you spot an error please inform the developers using the mailing list.
|
||||
|
||||
Apache Thrift has a choice of two build systems. The `autoconf` build system is the most complete build and is used to build all supported languages. The `cmake` build system has been designated by the project to replace `autoconf` however this transition will take quite some time to complete.
|
||||
|
||||
The Language/Library Levels indicate the minimum and maximum versions that are used in the [continuous integration environments](build/docker/README.md) (Appveyor, Travis) for Apache Thrift. Other language levels may be supported for each language, however tested less thoroughly; check the README file inside each lib directory for additional details. Note that while a language may contain support for protocols, transports, and servers, the extent to which each is tested as part of the overall build process varies. The definitive integration test for the project is called the "cross" test which executes a test matrix with clients and servers communicating across languages.
|
||||
|
||||
<table style="font-size: 60%; padding: 1px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan=2>Language</th>
|
||||
<th rowspan=2 align=center>Since</th>
|
||||
<th colspan=2 align=center>Build Systems</th>
|
||||
<th colspan=2 align=center>Lang/Lib Levels (Tested)</th>
|
||||
<th colspan=6 align=center>Low-Level Transports</th>
|
||||
<th colspan=3 align=center>Transport Wrappers</th>
|
||||
<th colspan=4 align=center>Protocols</th>
|
||||
<th colspan=5 align=center>Servers</th>
|
||||
<th rowspan=2>Open Issues</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- Build Systems ---------><th>autoconf</th><th>cmake</th>
|
||||
<!-- Lang/Lib Levels -------><th>Min</th><th>Max</th>
|
||||
<!-- Low-Level Transports --><th><a href="https://en.wikipedia.org/wiki/Unix_domain_socket">Domain</a></th><th> File </th><th>Memory</th><th> Pipe </th><th>Socket</th><th> TLS </th>
|
||||
<!-- Transport Wrappers ----><th>Framed</th><th> http </th><th> zlib </th>
|
||||
<!-- Protocols -------------><th><a href="doc/specs/thrift-binary-protocol.md">Binary</a></th><th><a href="doc/specs/thrift-compact-protocol.md">Compact</a></th><th> JSON </th><th>Multiplex</th>
|
||||
<!-- Servers ---------------><th>Forking</th><th>Nonblocking</th><th>Simple</th><th>Threaded</th><th>ThreadPool</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/as3/README.md">ActionScript</a></td>
|
||||
<!-- Since -----------------><td>0.3.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>ActionScript 3</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12313722">ActionScript</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/c_glib/README.md">C (glib)</a></td>
|
||||
<!-- Since -----------------><td>0.6.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Language Levels -------><td>2.48.2</td><td>2.54.0</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12313854">C (glib)</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/cpp/README.md">C++</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Language Levels -------><td colspan=2>C++98</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312313">C++</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/csharp/README.md">C#</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>.NET 3.5 / mono 3.2.8.0</td><td>.NET 4.6.1 / mono 4.6.2.7</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312362">C# (.NET)</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/cocoa/README.md">Cocoa</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>unknown</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312398">Cocoa</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/cl/README.md">Common Lisp</a></td>
|
||||
<!-- Since -----------------><td>0.12.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>SBCL 1.4.5</td><td>SBCL 1.4.9</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT-82">Common Lisp</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/d/README.md">Dlang</a></td>
|
||||
<!-- Since -----------------><td>0.9.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>2.075.1</td><td>2.081.0</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12317904">D</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/dart/README.md">Dart</a></td>
|
||||
<!-- Since -----------------><td>0.10.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>1.22.1</td><td>1.24.3</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12328006">Dart</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/delphi/README.md">Delphi</a></td>
|
||||
<!-- Since -----------------><td>0.8.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>2010</td><td>unknown</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12316601">Delphi</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/netcore/README.md">.NET Core</a></td>
|
||||
<!-- Since -----------------><td>0.11.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>2.1.4</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12331176">.NET Core</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/erl/README.md">Erlang</a></td>
|
||||
<!-- Since -----------------><td>0.3.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>18.3</td><td>20.0.4</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312390">Erlang</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/go/README.md">Go</a></td>
|
||||
<!-- Since -----------------><td>0.7.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>1.7.6</td><td>1.10.3</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12314307">Go</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/hs/README.md">Haskell</a></td>
|
||||
<!-- Since -----------------><td>0.5.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Language Levels -------><td>7.10.3</td><td>8.0.2</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312704">Haskell</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/haxe/README.md">Haxe</a></td>
|
||||
<!-- Since -----------------><td>0.9.3</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>3.2.1</td><td>3.4.4</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12324347">Haxe</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/java/README.md">Java (SE)</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Language Levels -------><td colspan=2>1.8.0_151</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312314">Java SE</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/javame/README.md">Java (ME)</a></td>
|
||||
<!-- Since -----------------><td>0.5.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>unknown</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12313759">Java ME</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/js/README.md">Javascript</a></td>
|
||||
<!-- Since -----------------><td>0.3.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>unknown</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12313418">Javascript</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/lua/README.md">Lua</a></td>
|
||||
<!-- Since -----------------><td>0.9.2</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>5.1.5</td><td>5.2.4</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12322659">Lua</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/nodejs/README.md">node.js</a></td>
|
||||
<!-- Since -----------------><td>0.6.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>6.x</td><td>8.11.3</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12314320">node.js</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/nodets/README.md">node.ts</a></td>
|
||||
<!-- Since -----------------><td>0.12.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>3.1.6</td><td></td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20THRIFT%20AND%20resolution%20%3D%20Unresolved%20and%20Component%20in%20(%22TypeScript%20-%20Library%22)%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC">node.ts</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/ocaml/README.md">OCaml</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>4.04.0</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12313660">OCaml</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/perl/README.md">Perl</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>5.22.1</td><td>5.26.0</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312312">Perl</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/php/README.md">PHP</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>7.0.22</td><td>7.1.8</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312431">PHP</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/py/README.md">Python</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Language Levels -------><td>2.7.12, 3.5.2</td><td>2.7.14, 3.6.3</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312315">Python</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/rb/README.md">Ruby</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>2.3.1p112</td><td>2.3.3p222</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12312316">Ruby</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/rs/README.md">Rust</a></td>
|
||||
<!-- Since -----------------><td>0.11.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td>1.17.0</td><td>1.21.0</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12331420">Rust</a></td>
|
||||
</tr>
|
||||
<tr align=center>
|
||||
<td align=left><a href="lib/st/README.md">Smalltalk</a></td>
|
||||
<!-- Since -----------------><td>0.2.0</td>
|
||||
<!-- Build Systems ---------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Language Levels -------><td colspan=2>unknown</td>
|
||||
<!-- Low-Level Transports --><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Transport Wrappers ----><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Protocols -------------><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<!-- Servers ---------------><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td><td><img src="doc/images/cred.png" alt=""/></td>
|
||||
<td align=left><a href="https://issues.apache.org/jira/browse/THRIFT/component/12313861">Smalltalk</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th rowspan=2>Language</th>
|
||||
<th rowspan=2 align=center>Since</th>
|
||||
<!-- Build Systems ---------><th>autoconf</th><th>cmake</th>
|
||||
<!-- Lang/Lib Levels -------><th>Min</th><th>Max</th>
|
||||
<!-- Low-Level Transports --><th><a href="https://en.wikipedia.org/wiki/Unix_domain_socket">Domain</a></th></th><th> File </th><th>Memory</th><th> Pipe </th><th>Socket</th><th> TLS </th>
|
||||
<!-- Transport Wrappers ----><th>Framed</th><th> http </th><th> zlib </th>
|
||||
<!-- Protocols -------------><th><a href="doc/specs/thrift-binary-protocol.md">Binary</a></th><th><a href="doc/specs/thrift-compact-protocol.md">Compact</a></th><th> JSON </th><th>Multiplex</th>
|
||||
<!-- Servers ---------------><th>Forking</th><th>Nonblocking</th><th>Simple</th><th>Threaded</th><th>ThreadPool</th>
|
||||
<th rowspan=2>Open Issues</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=2 align=center>Build Systems</th>
|
||||
<th colspan=2 align=center>Lang/Lib Levels (Tested)</th>
|
||||
<th colspan=6 align=center>Low-Level Transports</th>
|
||||
<th colspan=3 align=center>Transport Wrappers</th>
|
||||
<th colspan=4 align=center>Protocols</th>
|
||||
<th colspan=5 align=center>Servers</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
239
vendor/git.apache.org/thrift.git/LICENSE
generated
vendored
239
vendor/git.apache.org/thrift.git/LICENSE
generated
vendored
|
@ -1,239 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
|
||||
--------------------------------------------------
|
||||
SOFTWARE DISTRIBUTED WITH THRIFT:
|
||||
|
||||
The Apache Thrift software includes a number of subcomponents with
|
||||
separate copyright notices and license terms. Your use of the source
|
||||
code for the these subcomponents is subject to the terms and
|
||||
conditions of the following licenses.
|
||||
|
||||
--------------------------------------------------
|
||||
Portions of the following files are licensed under the MIT License:
|
||||
|
||||
lib/erl/src/Makefile.am
|
||||
|
||||
Please see doc/otp-base-license.txt for the full terms of this license.
|
||||
|
||||
--------------------------------------------------
|
||||
For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
|
||||
|
||||
# Copyright (c) 2007 Thomas Porschberg <thomas@randspringer.de>
|
||||
#
|
||||
# Copying and distribution of this file, with or without
|
||||
# modification, are permitted in any medium without royalty provided
|
||||
# the copyright notice and this notice are preserved.
|
||||
|
||||
--------------------------------------------------
|
||||
For the lib/nodejs/lib/thrift/json_parse.js:
|
||||
|
||||
/*
|
||||
json_parse.js
|
||||
2015-05-02
|
||||
Public Domain.
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
*/
|
||||
(By Douglas Crockford <douglas@crockford.com>)
|
||||
--------------------------------------------------
|
135
vendor/git.apache.org/thrift.git/Makefile.am
generated
vendored
135
vendor/git.apache.org/thrift.git/Makefile.am
generated
vendored
|
@ -1,135 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
ACLOCAL_AMFLAGS = -I ./aclocal
|
||||
|
||||
if WITH_PLUGIN
|
||||
# To enable bootstrap, build order is lib/cpp -> compiler -> others
|
||||
SUBDIRS = lib/cpp compiler/cpp lib
|
||||
if WITH_TESTS
|
||||
SUBDIRS += lib/cpp/test
|
||||
endif
|
||||
else
|
||||
SUBDIRS = compiler/cpp lib
|
||||
endif
|
||||
|
||||
if WITH_TESTS
|
||||
SUBDIRS += test
|
||||
endif
|
||||
|
||||
if WITH_TUTORIAL
|
||||
SUBDIRS += tutorial
|
||||
endif
|
||||
|
||||
dist-hook:
|
||||
find $(distdir) -type f \( -iname ".DS_Store" -or -iname "._*" -or -iname ".gitignore" \) | xargs rm -rf
|
||||
find $(distdir) -type d \( -iname ".deps" -or -iname ".libs" \) | xargs rm -rf
|
||||
find $(distdir) -type d \( -iname ".svn" -or -iname ".git" \) | xargs rm -rf
|
||||
|
||||
print-version:
|
||||
@echo $(PACKAGE_VERSION)
|
||||
|
||||
.PHONY: precross cross
|
||||
precross-%: all
|
||||
$(MAKE) -C $* precross
|
||||
precross: all precross-test precross-lib
|
||||
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
comma := ,
|
||||
|
||||
CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_DOTNETCORE@ @MAYBE_NODETS@
|
||||
CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))
|
||||
|
||||
if WITH_PY3
|
||||
CROSS_PY=$(PYTHON3)
|
||||
else
|
||||
CROSS_PY=$(PYTHON)
|
||||
endif
|
||||
|
||||
if WITH_PYTHON
|
||||
crossfeature: precross
|
||||
$(CROSS_PY) test/test.py --retry-count 5 --features .* --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED)
|
||||
else
|
||||
# feature test needs python build
|
||||
crossfeature:
|
||||
endif
|
||||
|
||||
cross-%: precross crossfeature
|
||||
$(CROSS_PY) test/test.py --retry-count 5 --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED) --regex "$*"
|
||||
|
||||
cross: cross-.*
|
||||
|
||||
TIMES = 1 2 3
|
||||
fail: precross
|
||||
$(CROSS_PY) test/test.py || true
|
||||
$(CROSS_PY) test/test.py --update-expected-failures=overwrite
|
||||
$(foreach var,$(TIMES),test/test.py -s || true;test/test.py --update-expected-failures=merge;)
|
||||
|
||||
codespell_skip_files = \
|
||||
*.jar \
|
||||
*.class \
|
||||
*.so \
|
||||
*.a \
|
||||
*.la \
|
||||
*.o \
|
||||
*.p12 \
|
||||
*OCamlMakefile \
|
||||
.keystore \
|
||||
.truststore \
|
||||
CHANGES \
|
||||
config.sub \
|
||||
configure \
|
||||
depcomp \
|
||||
libtool.m4 \
|
||||
output.* \
|
||||
rebar \
|
||||
thrift
|
||||
|
||||
skipped_files = $(subst $(space),$(comma),$(codespell_skip_files))
|
||||
|
||||
style-local:
|
||||
codespell --write-changes --skip=$(skipped_files) --disable-colors
|
||||
|
||||
EXTRA_DIST = \
|
||||
.clang-format \
|
||||
.editorconfig \
|
||||
.travis.yml \
|
||||
.rustfmt.toml \
|
||||
.dockerignore \
|
||||
appveyor.yml \
|
||||
bower.json \
|
||||
build \
|
||||
bootstrap.sh \
|
||||
cleanup.sh \
|
||||
CMakeLists.txt \
|
||||
composer.json \
|
||||
contrib \
|
||||
CONTRIBUTING.md \
|
||||
debian \
|
||||
doc \
|
||||
doap.rdf \
|
||||
package.json \
|
||||
sonar-project.properties \
|
||||
LANGUAGES.md \
|
||||
LICENSE \
|
||||
CHANGES \
|
||||
NOTICE \
|
||||
README.md \
|
||||
Thrift.podspec
|
5
vendor/git.apache.org/thrift.git/NOTICE
generated
vendored
5
vendor/git.apache.org/thrift.git/NOTICE
generated
vendored
|
@ -1,5 +0,0 @@
|
|||
Apache Thrift
|
||||
Copyright 2006-2017 The Apache Software Foundation.
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
192
vendor/git.apache.org/thrift.git/README.md
generated
vendored
192
vendor/git.apache.org/thrift.git/README.md
generated
vendored
|
@ -1,192 +0,0 @@
|
|||
Apache Thrift
|
||||
=============
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Thrift is a lightweight, language-independent software stack with an
|
||||
associated code generation mechanism for point-to-point RPC. Thrift provides
|
||||
clean abstractions for data transport, data serialization, and application
|
||||
level processing. The code generation system takes a simple definition
|
||||
language as input and generates code across programming languages that
|
||||
uses the abstracted stack to build interoperable RPC clients and servers.
|
||||
|
||||

|
||||
|
||||
Thrift makes it easy for programs written in different programming
|
||||
languages to share data and call remote procedures. With support
|
||||
for [25 programming languages](LANGUAGES.md), chances are Thrift
|
||||
supports the languages that you currently use.
|
||||
|
||||
Thrift is specifically designed to support non-atomic version changes
|
||||
across client and server code.
|
||||
|
||||
For more details on Thrift's design and implementation, see the Thrift
|
||||
whitepaper included in this distribution, or at the README.md file
|
||||
in your particular subdirectory of interest.
|
||||
|
||||
Status
|
||||
======
|
||||
|
||||
| Branch | Travis | Appveyor | Coverity Scan | codecov.io | Website |
|
||||
| :----- | :----- | :------- | :------------ | :--------- | :------ |
|
||||
| [`master`](https://github.com/apache/thrift/tree/master) | [](https://travis-ci.org/apache/thrift) | [](https://ci.appveyor.com/project/ApacheSoftwareFoundation/thrift/history) | [](https://scan.coverity.com/projects/thrift) | | [](https://thrift.apache.org/) |
|
||||
|
||||
Releases
|
||||
========
|
||||
|
||||
Thrift does not maintain a specific release calendar at this time.
|
||||
|
||||
We strive to release twice yearly. Download the [current release](http://thrift.apache.org/download).
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
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.
|
||||
|
||||
Project Hierarchy
|
||||
=================
|
||||
|
||||
thrift/
|
||||
|
||||
compiler/
|
||||
|
||||
Contains the Thrift compiler, implemented in C++.
|
||||
|
||||
lib/
|
||||
|
||||
Contains the Thrift software library implementation, subdivided by
|
||||
language of implementation.
|
||||
|
||||
cpp/
|
||||
go/
|
||||
java/
|
||||
php/
|
||||
py/
|
||||
rb/
|
||||
...
|
||||
|
||||
test/
|
||||
|
||||
Contains sample Thrift files and test code across the target programming
|
||||
languages.
|
||||
|
||||
tutorial/
|
||||
|
||||
Contains a basic tutorial that will teach you how to develop software
|
||||
using Thrift.
|
||||
|
||||
Development
|
||||
===========
|
||||
|
||||
To build the same way Travis CI builds the project you should use docker.
|
||||
We have [comprehensive building instructions for docker](build/docker/README.md).
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
See http://thrift.apache.org/docs/install for a list of build requirements (may be stale). Alternatively see the docker build environments for a list of prerequisites.
|
||||
|
||||
Resources
|
||||
=========
|
||||
|
||||
More information about Thrift can be obtained on the Thrift webpage at:
|
||||
|
||||
http://thrift.apache.org
|
||||
|
||||
Acknowledgments
|
||||
===============
|
||||
|
||||
Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo,
|
||||
and also by Google's protocol buffers.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
If you are building from the first time out of the source repository, you will
|
||||
need to generate the configure scripts. (This is not necessary if you
|
||||
downloaded a tarball.) From the top directory, do:
|
||||
|
||||
./bootstrap.sh
|
||||
|
||||
Once the configure scripts are generated, thrift can be configured.
|
||||
From the top directory, do:
|
||||
|
||||
./configure
|
||||
|
||||
You may need to specify the location of the boost files explicitly.
|
||||
If you installed boost in /usr/local, you would run configure as follows:
|
||||
|
||||
./configure --with-boost=/usr/local
|
||||
|
||||
Note that by default the thrift C++ library is typically built with debugging
|
||||
symbols included. If you want to customize these options you should use the
|
||||
CXXFLAGS option in configure, as such:
|
||||
|
||||
./configure CXXFLAGS='-g -O2'
|
||||
./configure CFLAGS='-g -O2'
|
||||
./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
|
||||
|
||||
To enable gcov required options -fprofile-arcs -ftest-coverage enable them:
|
||||
|
||||
./configure --enable-coverage
|
||||
|
||||
Run ./configure --help to see other configuration options
|
||||
|
||||
Please be aware that the Python library will ignore the --prefix option
|
||||
and just install wherever Python's distutils puts it (usually along
|
||||
the lines of /usr/lib/pythonX.Y/site-packages/). If you need to control
|
||||
where the Python modules are installed, set the PY_PREFIX variable.
|
||||
(DESTDIR is respected for Python and C++.)
|
||||
|
||||
Make thrift:
|
||||
|
||||
make
|
||||
|
||||
From the top directory, become superuser and do:
|
||||
|
||||
make install
|
||||
|
||||
Note that some language packages must be installed manually using build tools
|
||||
better suited to those languages (at the time of this writing, this applies
|
||||
to Java, Ruby, PHP).
|
||||
|
||||
Look for the README.md file in the lib/<language>/ folder for more details on the
|
||||
installation of each language library package.
|
||||
|
||||
Testing
|
||||
=======
|
||||
|
||||
There are a large number of client library tests that can all be run
|
||||
from the top-level directory.
|
||||
|
||||
make -k check
|
||||
|
||||
This will make all of the libraries (as necessary), and run through
|
||||
the unit tests defined in each of the client libraries. If a single
|
||||
language fails, the make check will continue on and provide a synopsis
|
||||
at the end.
|
||||
|
||||
To run the cross-language test suite, please run:
|
||||
|
||||
make cross
|
||||
|
||||
This will run a set of tests that use different language clients and
|
||||
servers.
|
||||
|
||||
|
16
vendor/git.apache.org/thrift.git/Thrift-swift3.podspec
generated
vendored
16
vendor/git.apache.org/thrift.git/Thrift-swift3.podspec
generated
vendored
|
@ -1,16 +0,0 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "Thrift-swift3"
|
||||
s.version = "0.12.0"
|
||||
s.summary = "Apache Thrift is a lightweight, language-independent software stack with an associated code generation mechanism for RPC."
|
||||
s.description = <<-DESC
|
||||
The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.
|
||||
DESC
|
||||
s.homepage = "http://thrift.apache.org"
|
||||
s.license = { :type => 'Apache License, Version 2.0', :url => 'https://www.apache.org/licenses/LICENSE-2.0' }
|
||||
s.author = { "Apache Thrift Developers" => "dev@thrift.apache.org" }
|
||||
s.ios.deployment_target = '9.0'
|
||||
s.osx.deployment_target = '10.10'
|
||||
s.requires_arc = true
|
||||
s.source = { :git => "https://github.com/apache/thrift.git", :tag => "0.12.0" }
|
||||
s.source_files = "lib/swift/Sources/*.swift"
|
||||
end
|
18
vendor/git.apache.org/thrift.git/Thrift.podspec
generated
vendored
18
vendor/git.apache.org/thrift.git/Thrift.podspec
generated
vendored
|
@ -1,18 +0,0 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "Thrift"
|
||||
s.version = "0.12.0"
|
||||
s.summary = "Apache Thrift is a lightweight, language-independent software stack with an associated code generation mechanism for RPC."
|
||||
s.description = <<-DESC
|
||||
The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.
|
||||
DESC
|
||||
s.homepage = "http://thrift.apache.org"
|
||||
s.license = { :type => 'Apache License, Version 2.0', :url => 'https://www.apache.org/licenses/LICENSE-2.0' }
|
||||
s.author = { "Apache Thrift Developers" => "dev@thrift.apache.org" }
|
||||
s.requires_arc = true
|
||||
s.ios.deployment_target = '7.0'
|
||||
s.osx.deployment_target = '10.8'
|
||||
s.ios.framework = 'CFNetwork'
|
||||
s.osx.framework = 'CoreServices'
|
||||
s.source = { :git => "https://github.com/apache/thrift.git", :tag => "0.12.0" }
|
||||
s.source_files = 'lib/cocoa/src/**/*.{h,m,swift}'
|
||||
end
|
54
vendor/git.apache.org/thrift.git/aclocal/ac_prog_bison.m4
generated
vendored
54
vendor/git.apache.org/thrift.git/aclocal/ac_prog_bison.m4
generated
vendored
|
@ -1,54 +0,0 @@
|
|||
dnl
|
||||
dnl Check Bison version
|
||||
dnl AC_PROG_BISON([MIN_VERSION=2.4])
|
||||
dnl
|
||||
dnl Will define BISON_USE_PARSER_H_EXTENSION if Automake is < 1.11
|
||||
dnl for use with .h includes.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AC_PROG_BISON], [
|
||||
if test "x$1" = "x" ; then
|
||||
bison_required_version="2.4"
|
||||
else
|
||||
bison_required_version="$1"
|
||||
fi
|
||||
|
||||
AC_CHECK_PROG(have_prog_bison, [bison], [yes],[no])
|
||||
|
||||
AC_DEFINE_UNQUOTED([BISON_VERSION], [0.0], [Bison version if bison is not available])
|
||||
|
||||
#Do not use *.h extension for parser header files, use newer *.hh
|
||||
bison_use_parser_h_extension=false
|
||||
|
||||
if test "$have_prog_bison" = "yes" ; then
|
||||
AC_MSG_CHECKING([for bison version >= $bison_required_version])
|
||||
bison_version=`bison --version | head -n 1 | cut '-d ' -f 4`
|
||||
AC_DEFINE_UNQUOTED([BISON_VERSION], [$bison_version], [Defines bison version])
|
||||
if test "$bison_version" \< "$bison_required_version" ; then
|
||||
BISON=:
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Bison version $bison_required_version or higher must be installed on the system!])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
BISON=bison
|
||||
AC_SUBST(BISON)
|
||||
|
||||
#Verify automake version 1.11 headers for yy files are .h, > 1.12 uses .hh
|
||||
automake_version=`automake --version | head -n 1 | cut '-d ' -f 4`
|
||||
AC_DEFINE_UNQUOTED([AUTOMAKE_VERSION], [$automake_version], [Defines automake version])
|
||||
|
||||
if test "$automake_version" \< "1.12" ; then
|
||||
#Use *.h extension for parser header file
|
||||
bison_use_parser_h_extension=true
|
||||
echo "Automake version < 1.12"
|
||||
AC_DEFINE([BISON_USE_PARSER_H_EXTENSION], [1], [Use *.h extension for parser header file])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
BISON=:
|
||||
AC_MSG_RESULT([NO])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BISON_USE_PARSER_H_EXTENSION], [test x$bison_use_parser_h_extension = xtrue])
|
||||
AC_SUBST(BISON)
|
||||
])
|
301
vendor/git.apache.org/thrift.git/aclocal/ax_boost_base.m4
generated
vendored
301
vendor/git.apache.org/thrift.git/aclocal/ax_boost_base.m4
generated
vendored
|
@ -1,301 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_base.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for the Boost C++ libraries of a particular version (or newer)
|
||||
#
|
||||
# If no path to the installed boost library is given the macro searchs
|
||||
# under /usr, /usr/local, /opt and /opt/local and evaluates the
|
||||
# $BOOST_ROOT environment variable. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2009 Peter Adolphs
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 45
|
||||
|
||||
# example boost program (need to pass version)
|
||||
m4_define([_AX_BOOST_BASE_PROGRAM],
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <boost/version.hpp>
|
||||
]],[[
|
||||
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));
|
||||
]])])
|
||||
|
||||
AC_DEFUN([AX_BOOST_BASE],
|
||||
[
|
||||
AC_ARG_WITH([boost],
|
||||
[AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
|
||||
[use Boost library from a standard location (ARG=yes),
|
||||
from the specified location (ARG=<path>),
|
||||
or disable it (ARG=no)
|
||||
@<:@ARG=yes@:>@ ])],
|
||||
[
|
||||
AS_CASE([$withval],
|
||||
[no],[want_boost="no";_AX_BOOST_BASE_boost_path=""],
|
||||
[yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""],
|
||||
[want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"])
|
||||
],
|
||||
[want_boost="yes"])
|
||||
|
||||
|
||||
AC_ARG_WITH([boost-libdir],
|
||||
[AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
|
||||
[Force given directory for boost libraries.
|
||||
Note that this will override library path detection,
|
||||
so use this parameter only if default library detection fails
|
||||
and you know exactly where your boost libraries are located.])],
|
||||
[
|
||||
AS_IF([test -d "$withval"],
|
||||
[_AX_BOOST_BASE_boost_lib_path="$withval"],
|
||||
[AC_MSG_ERROR([--with-boost-libdir expected directory name])])
|
||||
],
|
||||
[_AX_BOOST_BASE_boost_lib_path=""])
|
||||
|
||||
BOOST_LDFLAGS=""
|
||||
BOOST_CPPFLAGS=""
|
||||
AS_IF([test "x$want_boost" = "xyes"],
|
||||
[_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])])
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
AC_SUBST(BOOST_LDFLAGS)
|
||||
])
|
||||
|
||||
|
||||
# convert a version string in $2 to numeric and affect to polymorphic var $1
|
||||
AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[
|
||||
AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'`
|
||||
AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"],
|
||||
[AC_MSG_ERROR([You should at least specify libboost major version])])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'`
|
||||
AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"],
|
||||
[_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
|
||||
AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"],
|
||||
[_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor`
|
||||
AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET)
|
||||
])
|
||||
|
||||
dnl Run the detection of boost should be run only if $want_boost
|
||||
AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
|
||||
_AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1])
|
||||
succeeded=no
|
||||
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
dnl On 64-bit systems check for system libraries in both lib64 and lib.
|
||||
dnl The former is specified by FHS, but e.g. Debian does not adhere to
|
||||
dnl this (as it rises problems for generic multi-arch support).
|
||||
dnl The last entry in the list is chosen by default when no libraries
|
||||
dnl are found, e.g. when only header-only libraries are installed!
|
||||
AS_CASE([${host_cpu}],
|
||||
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
|
||||
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
|
||||
[libsubdirs="lib"]
|
||||
)
|
||||
|
||||
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
|
||||
dnl them priority over the other paths since, if libs are found there, they
|
||||
dnl are almost assuredly the ones desired.
|
||||
AS_CASE([${host_cpu}],
|
||||
[i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
|
||||
[multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
|
||||
)
|
||||
|
||||
dnl first we check the system location for boost libraries
|
||||
dnl this location ist chosen if boost libraries are installed with the --layout=system option
|
||||
dnl or if you install boost with RPM
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
|
||||
AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[
|
||||
AC_MSG_RESULT([yes])
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
|
||||
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"])
|
||||
AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[
|
||||
AC_MSG_RESULT([yes])
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
|
||||
break;
|
||||
],
|
||||
[AC_MSG_RESULT([no])])
|
||||
done],[
|
||||
AC_MSG_RESULT([no])])
|
||||
],[
|
||||
if test X"$cross_compiling" = Xyes; then
|
||||
search_libsubdirs=$multiarch_libsubdir
|
||||
else
|
||||
search_libsubdirs="$multiarch_libsubdir $libsubdirs"
|
||||
fi
|
||||
for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
|
||||
for libsubdir in $search_libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
dnl overwrite ld flags if we have required special directory with
|
||||
dnl --with-boost-libdir parameter
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_lib_path" != "x"],
|
||||
[BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"])
|
||||
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION)])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
found_system=yes
|
||||
],[
|
||||
])
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
|
||||
|
||||
dnl if we found no boost with system layout we search for boost libraries
|
||||
dnl built and installed without the --layout=system option or for a staged(not installed) version
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
BOOST_CPPFLAGS=
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
BOOST_LDFLAGS=
|
||||
fi
|
||||
_version=0
|
||||
if test -n "$_AX_BOOST_BASE_boost_path" ; then
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
fi
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
done
|
||||
dnl if nothing found search for layout used in Windows distributions
|
||||
if test -z "$BOOST_CPPFLAGS"; then
|
||||
if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
|
||||
fi
|
||||
fi
|
||||
dnl if we found something and BOOST_LDFLAGS was unset before
|
||||
dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here.
|
||||
if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "x$cross_compiling" != "xyes" ; then
|
||||
for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
best_path=$_AX_BOOST_BASE_boost_path
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$best_path/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$BOOST_ROOT" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
|
||||
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
|
||||
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
|
||||
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
||||
if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
|
||||
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
||||
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
found_system=yes
|
||||
],[
|
||||
])
|
||||
AC_LANG_POP([C++])
|
||||
fi
|
||||
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
if test "x$_version" = "x0" ; then
|
||||
AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
|
||||
else
|
||||
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
|
||||
fi
|
||||
# execute ACTION-IF-NOT-FOUND (if present):
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
|
||||
# execute ACTION-IF-FOUND (if present):
|
||||
ifelse([$2], , :, [$2])
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
|
||||
])
|
124
vendor/git.apache.org/thrift.git/aclocal/ax_check_openssl.m4
generated
vendored
124
vendor/git.apache.org/thrift.git/aclocal/ax_check_openssl.m4
generated
vendored
|
@ -1,124 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Look for OpenSSL in a number of default spots, or in a user-selected
|
||||
# spot (via --with-openssl). Sets
|
||||
#
|
||||
# OPENSSL_INCLUDES to the include directives required
|
||||
# OPENSSL_LIBS to the -l directives required
|
||||
# OPENSSL_LDFLAGS to the -L or -R flags required
|
||||
#
|
||||
# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
|
||||
#
|
||||
# This macro sets OPENSSL_INCLUDES such that source files should use the
|
||||
# openssl/ directory in include directives:
|
||||
#
|
||||
# #include <openssl/hmac.h>
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
|
||||
# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 10
|
||||
|
||||
AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
|
||||
AC_DEFUN([AX_CHECK_OPENSSL], [
|
||||
found=false
|
||||
AC_ARG_WITH([openssl],
|
||||
[AS_HELP_STRING([--with-openssl=DIR],
|
||||
[root of the OpenSSL directory])],
|
||||
[
|
||||
case "$withval" in
|
||||
"" | y | ye | yes | n | no)
|
||||
AC_MSG_ERROR([Invalid --with-openssl value])
|
||||
;;
|
||||
*) ssldirs="$withval"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
# if pkg-config is installed and openssl has installed a .pc file,
|
||||
# then use that information and don't search ssldirs
|
||||
AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
|
||||
if test x"$PKG_CONFIG" != x""; then
|
||||
OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
|
||||
if test $? = 0; then
|
||||
OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
|
||||
OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
|
||||
found=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# no such luck; use some default ssldirs
|
||||
if ! $found; then
|
||||
ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
|
||||
# an 'openssl' subdirectory
|
||||
|
||||
if ! $found; then
|
||||
OPENSSL_INCLUDES=
|
||||
for ssldir in $ssldirs; do
|
||||
AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
|
||||
if test -f "$ssldir/include/openssl/ssl.h"; then
|
||||
OPENSSL_INCLUDES="-I$ssldir/include"
|
||||
OPENSSL_LDFLAGS="-L$ssldir/lib"
|
||||
OPENSSL_LIBS="-lssl -lcrypto"
|
||||
found=true
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
done
|
||||
|
||||
# if the file wasn't found, well, go ahead and try the link anyway -- maybe
|
||||
# it will just work!
|
||||
fi
|
||||
|
||||
# try the preprocessor and linker with our new flags,
|
||||
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
|
||||
|
||||
AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
|
||||
echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
|
||||
"OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
|
||||
LIBS="$OPENSSL_LIBS $LIBS"
|
||||
CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
$1
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
$2
|
||||
])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
|
||||
AC_SUBST([OPENSSL_INCLUDES])
|
||||
AC_SUBST([OPENSSL_LIBS])
|
||||
AC_SUBST([OPENSSL_LDFLAGS])
|
||||
])
|
177
vendor/git.apache.org/thrift.git/aclocal/ax_compare_version.m4
generated
vendored
177
vendor/git.apache.org/thrift.git/aclocal/ax_compare_version.m4
generated
vendored
|
@ -1,177 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro compares two version strings. Due to the various number of
|
||||
# minor-version numbers that can exist, and the fact that string
|
||||
# comparisons are not compatible with numeric comparisons, this is not
|
||||
# necessarily trivial to do in a autoconf script. This macro makes doing
|
||||
# these comparisons easy.
|
||||
#
|
||||
# The six basic comparisons are available, as well as checking equality
|
||||
# limited to a certain number of minor-version levels.
|
||||
#
|
||||
# The operator OP determines what type of comparison to do, and can be one
|
||||
# of:
|
||||
#
|
||||
# eq - equal (test A == B)
|
||||
# ne - not equal (test A != B)
|
||||
# le - less than or equal (test A <= B)
|
||||
# ge - greater than or equal (test A >= B)
|
||||
# lt - less than (test A < B)
|
||||
# gt - greater than (test A > B)
|
||||
#
|
||||
# Additionally, the eq and ne operator can have a number after it to limit
|
||||
# the test to that number of minor versions.
|
||||
#
|
||||
# eq0 - equal up to the length of the shorter version
|
||||
# ne0 - not equal up to the length of the shorter version
|
||||
# eqN - equal up to N sub-version levels
|
||||
# neN - not equal up to N sub-version levels
|
||||
#
|
||||
# When the condition is true, shell commands ACTION-IF-TRUE are run,
|
||||
# otherwise shell commands ACTION-IF-FALSE are run. The environment
|
||||
# variable 'ax_compare_version' is always set to either 'true' or 'false'
|
||||
# as well.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
|
||||
#
|
||||
# would both be true.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
|
||||
#
|
||||
# would both be false.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
|
||||
#
|
||||
# would be true because it is only comparing two minor versions.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
|
||||
#
|
||||
# would be true because it is only comparing the lesser number of minor
|
||||
# versions of the two values.
|
||||
#
|
||||
# Note: The characters that separate the version numbers do not matter. An
|
||||
# empty string is the same as version 0. OP is evaluated by autoconf, not
|
||||
# configure, so must be a string, not a variable.
|
||||
#
|
||||
# The author would like to acknowledge Guido Draheim whose advice about
|
||||
# the m4_case and m4_ifvaln functions make this macro only include the
|
||||
# portions necessary to perform the specific comparison specified by the
|
||||
# OP argument in the final configure script.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 12
|
||||
|
||||
dnl #########################################################################
|
||||
AC_DEFUN([AX_COMPARE_VERSION], [
|
||||
AC_REQUIRE([AC_PROG_AWK])
|
||||
|
||||
# Used to indicate true or false condition
|
||||
ax_compare_version=false
|
||||
|
||||
# Convert the two version strings to be compared into a format that
|
||||
# allows a simple string comparison. The end result is that a version
|
||||
# string of the form 1.12.5-r617 will be converted to the form
|
||||
# 0001001200050617. In other words, each number is zero padded to four
|
||||
# digits, and non digits are removed.
|
||||
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
|
||||
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
|
||||
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
|
||||
dnl # then the first line is used to determine if the condition is true.
|
||||
dnl # The sed right after the echo is to remove any indented white space.
|
||||
m4_case(m4_tolower($2),
|
||||
[lt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[gt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[le],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],
|
||||
[ge],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],[
|
||||
dnl Split the operator from the subversion count if present.
|
||||
m4_bmatch(m4_substr($2,2),
|
||||
[0],[
|
||||
# A count of zero means use the length of the shorter version.
|
||||
# Determine the number of characters in A and B.
|
||||
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
|
||||
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
|
||||
|
||||
# Set A to no more than B's length and B to no more than A's length.
|
||||
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
|
||||
],
|
||||
[[0-9]+],[
|
||||
# A count greater than zero means use only that many subversions
|
||||
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
],
|
||||
[.+],[
|
||||
AC_WARNING(
|
||||
[illegal OP numeric parameter: $2])
|
||||
],[])
|
||||
|
||||
# Pad zeros at end of numbers to make same length.
|
||||
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
|
||||
B="$B`echo $A | sed 's/./0/g'`"
|
||||
A="$ax_compare_version_tmp_A"
|
||||
|
||||
# Check for equality or inequality as necessary.
|
||||
m4_case(m4_tolower(m4_substr($2,0,2)),
|
||||
[eq],[
|
||||
test "x$A" = "x$B" && ax_compare_version=true
|
||||
],
|
||||
[ne],[
|
||||
test "x$A" != "x$B" && ax_compare_version=true
|
||||
],[
|
||||
AC_WARNING([illegal OP parameter: $2])
|
||||
])
|
||||
])
|
||||
|
||||
AS_VAR_POPDEF([A])dnl
|
||||
AS_VAR_POPDEF([B])dnl
|
||||
|
||||
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
|
||||
if test "$ax_compare_version" = "true" ; then
|
||||
m4_ifvaln([$4],[$4],[:])dnl
|
||||
m4_ifvaln([$5],[else $5])dnl
|
||||
fi
|
||||
]) dnl AX_COMPARE_VERSION
|
948
vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx.m4
generated
vendored
948
vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx.m4
generated
vendored
|
@ -1,948 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check for baseline language coverage in the compiler for the specified
|
||||
# version of the C++ standard. If necessary, add switches to CXX and
|
||||
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
|
||||
# or '14' (for the C++14 standard).
|
||||
#
|
||||
# The second argument, if specified, indicates whether you insist on an
|
||||
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
|
||||
# -std=c++11). If neither is specified, you get whatever works, with
|
||||
# preference for an extended mode.
|
||||
#
|
||||
# The third argument, if specified 'mandatory' or if left unspecified,
|
||||
# indicates that baseline support for the specified C++ standard is
|
||||
# required and that the macro should error out if no mode with that
|
||||
# support is found. If specified 'optional', then configuration proceeds
|
||||
# regardless, after defining HAVE_CXX${VERSION} if and only if a
|
||||
# supporting mode is found.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
||||
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
|
||||
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
|
||||
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
||||
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
|
||||
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
|
||||
# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 10
|
||||
|
||||
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
|
||||
dnl (serial version number 13).
|
||||
|
||||
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
|
||||
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
|
||||
[$1], [14], [ax_cxx_compile_alternatives="14 1y"],
|
||||
[$1], [17], [ax_cxx_compile_alternatives="17 1z"],
|
||||
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
|
||||
m4_if([$2], [], [],
|
||||
[$2], [ext], [],
|
||||
[$2], [noext], [],
|
||||
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
|
||||
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
|
||||
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
|
||||
[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
|
||||
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
|
||||
AC_LANG_PUSH([C++])dnl
|
||||
ac_success=no
|
||||
|
||||
m4_if([$2], [noext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
for alternative in ${ax_cxx_compile_alternatives}; do
|
||||
switch="-std=gnu++${alternative}"
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXX="$CXX"
|
||||
CXX="$CXX $switch"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[eval $cachevar=yes],
|
||||
[eval $cachevar=no])
|
||||
CXX="$ac_save_CXX"])
|
||||
if eval test x\$$cachevar = xyes; then
|
||||
CXX="$CXX $switch"
|
||||
if test -n "$CXXCPP" ; then
|
||||
CXXCPP="$CXXCPP $switch"
|
||||
fi
|
||||
ac_success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi])
|
||||
|
||||
m4_if([$2], [ext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
dnl HP's aCC needs +std=c++11 according to:
|
||||
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
|
||||
dnl Cray's crayCC needs "-h std=c++11"
|
||||
for alternative in ${ax_cxx_compile_alternatives}; do
|
||||
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXX="$CXX"
|
||||
CXX="$CXX $switch"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[eval $cachevar=yes],
|
||||
[eval $cachevar=no])
|
||||
CXX="$ac_save_CXX"])
|
||||
if eval test x\$$cachevar = xyes; then
|
||||
CXX="$CXX $switch"
|
||||
if test -n "$CXXCPP" ; then
|
||||
CXXCPP="$CXXCPP $switch"
|
||||
fi
|
||||
ac_success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$ac_success = xyes; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi])
|
||||
AC_LANG_POP([C++])
|
||||
if test x$ax_cxx_compile_cxx$1_required = xtrue; then
|
||||
if test x$ac_success = xno; then
|
||||
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
|
||||
fi
|
||||
fi
|
||||
if test x$ac_success = xno; then
|
||||
HAVE_CXX$1=0
|
||||
AC_MSG_NOTICE([No compiler with C++$1 support was found])
|
||||
else
|
||||
HAVE_CXX$1=1
|
||||
AC_DEFINE(HAVE_CXX$1,1,
|
||||
[define if the compiler supports basic C++$1 syntax])
|
||||
fi
|
||||
AC_SUBST(HAVE_CXX$1)
|
||||
])
|
||||
|
||||
|
||||
dnl Test body for checking C++11 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
)
|
||||
|
||||
|
||||
dnl Test body for checking C++14 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
)
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
|
||||
)
|
||||
|
||||
dnl Tests for new features in C++11
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
|
||||
|
||||
// If the compiler admits that it is not ready for C++11, why torture it?
|
||||
// Hopefully, this will speed up the test.
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201103L
|
||||
|
||||
#error "This is not a C++11 compiler"
|
||||
|
||||
#else
|
||||
|
||||
namespace cxx11
|
||||
{
|
||||
|
||||
namespace test_static_assert
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
struct check
|
||||
{
|
||||
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace test_final_override
|
||||
{
|
||||
|
||||
struct Base
|
||||
{
|
||||
virtual void f() {}
|
||||
};
|
||||
|
||||
struct Derived : public Base
|
||||
{
|
||||
virtual void f() override {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace test_double_right_angle_brackets
|
||||
{
|
||||
|
||||
template < typename T >
|
||||
struct check {};
|
||||
|
||||
typedef check<void> single_type;
|
||||
typedef check<check<void>> double_type;
|
||||
typedef check<check<check<void>>> triple_type;
|
||||
typedef check<check<check<check<void>>>> quadruple_type;
|
||||
|
||||
}
|
||||
|
||||
namespace test_decltype
|
||||
{
|
||||
|
||||
int
|
||||
f()
|
||||
{
|
||||
int a = 1;
|
||||
decltype(a) b = 2;
|
||||
return a + b;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_type_deduction
|
||||
{
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
struct is_same
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
struct is_same<T, T>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
auto
|
||||
add(T1 a1, T2 a2) -> decltype(a1 + a2)
|
||||
{
|
||||
return a1 + a2;
|
||||
}
|
||||
|
||||
int
|
||||
test(const int c, volatile int v)
|
||||
{
|
||||
static_assert(is_same<int, decltype(0)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(c)>::value == false, "");
|
||||
static_assert(is_same<int, decltype(v)>::value == false, "");
|
||||
auto ac = c;
|
||||
auto av = v;
|
||||
auto sumi = ac + av + 'x';
|
||||
auto sumf = ac + av + 1.0;
|
||||
static_assert(is_same<int, decltype(ac)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(av)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(sumi)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(sumf)>::value == false, "");
|
||||
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
|
||||
return (sumf > 0.0) ? sumi : add(c, v);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_noexcept
|
||||
{
|
||||
|
||||
int f() { return 0; }
|
||||
int g() noexcept { return 0; }
|
||||
|
||||
static_assert(noexcept(f()) == false, "");
|
||||
static_assert(noexcept(g()) == true, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_constexpr
|
||||
{
|
||||
|
||||
template < typename CharT >
|
||||
unsigned long constexpr
|
||||
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
|
||||
{
|
||||
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
|
||||
}
|
||||
|
||||
template < typename CharT >
|
||||
unsigned long constexpr
|
||||
strlen_c(const CharT *const s) noexcept
|
||||
{
|
||||
return strlen_c_r(s, 0UL);
|
||||
}
|
||||
|
||||
static_assert(strlen_c("") == 0UL, "");
|
||||
static_assert(strlen_c("1") == 1UL, "");
|
||||
static_assert(strlen_c("example") == 7UL, "");
|
||||
static_assert(strlen_c("another\0example") == 7UL, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_rvalue_references
|
||||
{
|
||||
|
||||
template < int N >
|
||||
struct answer
|
||||
{
|
||||
static constexpr int value = N;
|
||||
};
|
||||
|
||||
answer<1> f(int&) { return answer<1>(); }
|
||||
answer<2> f(const int&) { return answer<2>(); }
|
||||
answer<3> f(int&&) { return answer<3>(); }
|
||||
|
||||
void
|
||||
test()
|
||||
{
|
||||
int i = 0;
|
||||
const int c = 0;
|
||||
static_assert(decltype(f(i))::value == 1, "");
|
||||
static_assert(decltype(f(c))::value == 2, "");
|
||||
static_assert(decltype(f(0))::value == 3, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_uniform_initialization
|
||||
{
|
||||
|
||||
struct test
|
||||
{
|
||||
static const int zero {};
|
||||
static const int one {1};
|
||||
};
|
||||
|
||||
static_assert(test::zero == 0, "");
|
||||
static_assert(test::one == 1, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_lambdas
|
||||
{
|
||||
|
||||
void
|
||||
test1()
|
||||
{
|
||||
auto lambda1 = [](){};
|
||||
auto lambda2 = lambda1;
|
||||
lambda1();
|
||||
lambda2();
|
||||
}
|
||||
|
||||
int
|
||||
test2()
|
||||
{
|
||||
auto a = [](int i, int j){ return i + j; }(1, 2);
|
||||
auto b = []() -> int { return '0'; }();
|
||||
auto c = [=](){ return a + b; }();
|
||||
auto d = [&](){ return c; }();
|
||||
auto e = [a, &b](int x) mutable {
|
||||
const auto identity = [](int y){ return y; };
|
||||
for (auto i = 0; i < a; ++i)
|
||||
a += b--;
|
||||
return x + identity(a + b);
|
||||
}(0);
|
||||
return a + b + c + d + e;
|
||||
}
|
||||
|
||||
int
|
||||
test3()
|
||||
{
|
||||
const auto nullary = [](){ return 0; };
|
||||
const auto unary = [](int x){ return x; };
|
||||
using nullary_t = decltype(nullary);
|
||||
using unary_t = decltype(unary);
|
||||
const auto higher1st = [](nullary_t f){ return f(); };
|
||||
const auto higher2nd = [unary](nullary_t f1){
|
||||
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
|
||||
};
|
||||
return higher1st(nullary) + higher2nd(nullary)(unary);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_variadic_templates
|
||||
{
|
||||
|
||||
template <int...>
|
||||
struct sum;
|
||||
|
||||
template <int N0, int... N1toN>
|
||||
struct sum<N0, N1toN...>
|
||||
{
|
||||
static constexpr auto value = N0 + sum<N1toN...>::value;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct sum<>
|
||||
{
|
||||
static constexpr auto value = 0;
|
||||
};
|
||||
|
||||
static_assert(sum<>::value == 0, "");
|
||||
static_assert(sum<1>::value == 1, "");
|
||||
static_assert(sum<23>::value == 23, "");
|
||||
static_assert(sum<1, 2>::value == 3, "");
|
||||
static_assert(sum<5, 5, 11>::value == 21, "");
|
||||
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
||||
|
||||
}
|
||||
|
||||
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
|
||||
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
|
||||
// because of this.
|
||||
namespace test_template_alias_sfinae
|
||||
{
|
||||
|
||||
struct foo {};
|
||||
|
||||
template<typename T>
|
||||
using member = typename T::member_type;
|
||||
|
||||
template<typename T>
|
||||
void func(...) {}
|
||||
|
||||
template<typename T>
|
||||
void func(member<T>*) {}
|
||||
|
||||
void test();
|
||||
|
||||
void test() { func<foo>(0); }
|
||||
|
||||
}
|
||||
|
||||
} // namespace cxx11
|
||||
|
||||
#endif // __cplusplus >= 201103L
|
||||
|
||||
]])
|
||||
|
||||
|
||||
dnl Tests for new features in C++14
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
|
||||
|
||||
// If the compiler admits that it is not ready for C++14, why torture it?
|
||||
// Hopefully, this will speed up the test.
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201402L
|
||||
|
||||
#error "This is not a C++14 compiler"
|
||||
|
||||
#else
|
||||
|
||||
namespace cxx14
|
||||
{
|
||||
|
||||
namespace test_polymorphic_lambdas
|
||||
{
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
const auto lambda = [](auto&&... args){
|
||||
const auto istiny = [](auto x){
|
||||
return (sizeof(x) == 1UL) ? 1 : 0;
|
||||
};
|
||||
const int aretiny[] = { istiny(args)... };
|
||||
return aretiny[0];
|
||||
};
|
||||
return lambda(1, 1L, 1.0f, '1');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_binary_literals
|
||||
{
|
||||
|
||||
constexpr auto ivii = 0b0000000000101010;
|
||||
static_assert(ivii == 42, "wrong value");
|
||||
|
||||
}
|
||||
|
||||
namespace test_generalized_constexpr
|
||||
{
|
||||
|
||||
template < typename CharT >
|
||||
constexpr unsigned long
|
||||
strlen_c(const CharT *const s) noexcept
|
||||
{
|
||||
auto length = 0UL;
|
||||
for (auto p = s; *p; ++p)
|
||||
++length;
|
||||
return length;
|
||||
}
|
||||
|
||||
static_assert(strlen_c("") == 0UL, "");
|
||||
static_assert(strlen_c("x") == 1UL, "");
|
||||
static_assert(strlen_c("test") == 4UL, "");
|
||||
static_assert(strlen_c("another\0test") == 7UL, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_lambda_init_capture
|
||||
{
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
auto x = 0;
|
||||
const auto lambda1 = [a = x](int b){ return a + b; };
|
||||
const auto lambda2 = [a = lambda1(x)](){ return a; };
|
||||
return lambda2();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_digit_separators
|
||||
{
|
||||
|
||||
constexpr auto ten_million = 100'000'000;
|
||||
static_assert(ten_million == 100000000, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_return_type_deduction
|
||||
{
|
||||
|
||||
auto f(int& x) { return x; }
|
||||
decltype(auto) g(int& x) { return x; }
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
struct is_same
|
||||
{
|
||||
static constexpr auto value = false;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
struct is_same<T, T>
|
||||
{
|
||||
static constexpr auto value = true;
|
||||
};
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
auto x = 0;
|
||||
static_assert(is_same<int, decltype(f(x))>::value, "");
|
||||
static_assert(is_same<int&, decltype(g(x))>::value, "");
|
||||
return x;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace cxx14
|
||||
|
||||
#endif // __cplusplus >= 201402L
|
||||
|
||||
]])
|
||||
|
||||
|
||||
dnl Tests for new features in C++17
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
|
||||
|
||||
// If the compiler admits that it is not ready for C++17, why torture it?
|
||||
// Hopefully, this will speed up the test.
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201703L
|
||||
|
||||
#error "This is not a C++17 compiler"
|
||||
|
||||
#else
|
||||
|
||||
#include <initializer_list>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
|
||||
namespace cxx17
|
||||
{
|
||||
|
||||
namespace test_constexpr_lambdas
|
||||
{
|
||||
|
||||
constexpr int foo = [](){return 42;}();
|
||||
|
||||
}
|
||||
|
||||
namespace test::nested_namespace::definitions
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
namespace test_fold_expression
|
||||
{
|
||||
|
||||
template<typename... Args>
|
||||
int multiply(Args... args)
|
||||
{
|
||||
return (args * ... * 1);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
bool all(Args... args)
|
||||
{
|
||||
return (args && ...);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_extended_static_assert
|
||||
{
|
||||
|
||||
static_assert (true);
|
||||
|
||||
}
|
||||
|
||||
namespace test_auto_brace_init_list
|
||||
{
|
||||
|
||||
auto foo = {5};
|
||||
auto bar {5};
|
||||
|
||||
static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
|
||||
static_assert(std::is_same<int, decltype(bar)>::value);
|
||||
}
|
||||
|
||||
namespace test_typename_in_template_template_parameter
|
||||
{
|
||||
|
||||
template<template<typename> typename X> struct D;
|
||||
|
||||
}
|
||||
|
||||
namespace test_fallthrough_nodiscard_maybe_unused_attributes
|
||||
{
|
||||
|
||||
int f1()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
|
||||
[[nodiscard]] int f2()
|
||||
{
|
||||
[[maybe_unused]] auto unused = f1();
|
||||
|
||||
switch (f1())
|
||||
{
|
||||
case 17:
|
||||
f1();
|
||||
[[fallthrough]];
|
||||
case 42:
|
||||
f1();
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_extended_aggregate_initialization
|
||||
{
|
||||
|
||||
struct base1
|
||||
{
|
||||
int b1, b2 = 42;
|
||||
};
|
||||
|
||||
struct base2
|
||||
{
|
||||
base2() {
|
||||
b3 = 42;
|
||||
}
|
||||
int b3;
|
||||
};
|
||||
|
||||
struct derived : base1, base2
|
||||
{
|
||||
int d;
|
||||
};
|
||||
|
||||
derived d1 {{1, 2}, {}, 4}; // full initialization
|
||||
derived d2 {{}, {}, 4}; // value-initialized bases
|
||||
|
||||
}
|
||||
|
||||
namespace test_general_range_based_for_loop
|
||||
{
|
||||
|
||||
struct iter
|
||||
{
|
||||
int i;
|
||||
|
||||
int& operator* ()
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
const int& operator* () const
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
iter& operator++()
|
||||
{
|
||||
++i;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
struct sentinel
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
bool operator== (const iter& i, const sentinel& s)
|
||||
{
|
||||
return i.i == s.i;
|
||||
}
|
||||
|
||||
bool operator!= (const iter& i, const sentinel& s)
|
||||
{
|
||||
return !(i == s);
|
||||
}
|
||||
|
||||
struct range
|
||||
{
|
||||
iter begin() const
|
||||
{
|
||||
return {0};
|
||||
}
|
||||
|
||||
sentinel end() const
|
||||
{
|
||||
return {5};
|
||||
}
|
||||
};
|
||||
|
||||
void f()
|
||||
{
|
||||
range r {};
|
||||
|
||||
for (auto i : r)
|
||||
{
|
||||
[[maybe_unused]] auto v = i;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_lambda_capture_asterisk_this_by_value
|
||||
{
|
||||
|
||||
struct t
|
||||
{
|
||||
int i;
|
||||
int foo()
|
||||
{
|
||||
return [*this]()
|
||||
{
|
||||
return i;
|
||||
}();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace test_enum_class_construction
|
||||
{
|
||||
|
||||
enum class byte : unsigned char
|
||||
{};
|
||||
|
||||
byte foo {42};
|
||||
|
||||
}
|
||||
|
||||
namespace test_constexpr_if
|
||||
{
|
||||
|
||||
template <bool cond>
|
||||
int f ()
|
||||
{
|
||||
if constexpr(cond)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_selection_statement_with_initializer
|
||||
{
|
||||
|
||||
int f()
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
|
||||
int f2()
|
||||
{
|
||||
if (auto i = f(); i > 0)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
switch (auto i = f(); i + 4)
|
||||
{
|
||||
case 17:
|
||||
return 2;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_template_argument_deduction_for_class_templates
|
||||
{
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct pair
|
||||
{
|
||||
pair (T1 p1, T2 p2)
|
||||
: m1 {p1},
|
||||
m2 {p2}
|
||||
{}
|
||||
|
||||
T1 m1;
|
||||
T2 m2;
|
||||
};
|
||||
|
||||
void f()
|
||||
{
|
||||
[[maybe_unused]] auto p = pair{13, 42u};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_non_type_auto_template_parameters
|
||||
{
|
||||
|
||||
template <auto n>
|
||||
struct B
|
||||
{};
|
||||
|
||||
B<5> b1;
|
||||
B<'a'> b2;
|
||||
|
||||
}
|
||||
|
||||
namespace test_structured_bindings
|
||||
{
|
||||
|
||||
int arr[2] = { 1, 2 };
|
||||
std::pair<int, int> pr = { 1, 2 };
|
||||
|
||||
auto f1() -> int(&)[2]
|
||||
{
|
||||
return arr;
|
||||
}
|
||||
|
||||
auto f2() -> std::pair<int, int>&
|
||||
{
|
||||
return pr;
|
||||
}
|
||||
|
||||
struct S
|
||||
{
|
||||
int x1 : 2;
|
||||
volatile double y1;
|
||||
};
|
||||
|
||||
S f3()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
auto [ x1, y1 ] = f1();
|
||||
auto& [ xr1, yr1 ] = f1();
|
||||
auto [ x2, y2 ] = f2();
|
||||
auto& [ xr2, yr2 ] = f2();
|
||||
const auto [ x3, y3 ] = f3();
|
||||
|
||||
}
|
||||
|
||||
namespace test_exception_spec_type_system
|
||||
{
|
||||
|
||||
struct Good {};
|
||||
struct Bad {};
|
||||
|
||||
void g1() noexcept;
|
||||
void g2();
|
||||
|
||||
template<typename T>
|
||||
Bad
|
||||
f(T*, T*);
|
||||
|
||||
template<typename T1, typename T2>
|
||||
Good
|
||||
f(T1*, T2*);
|
||||
|
||||
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
|
||||
|
||||
}
|
||||
|
||||
namespace test_inline_variables
|
||||
{
|
||||
|
||||
template<class T> void f(T)
|
||||
{}
|
||||
|
||||
template<class T> inline T g(T)
|
||||
{
|
||||
return T{};
|
||||
}
|
||||
|
||||
template<> inline void f<>(int)
|
||||
{}
|
||||
|
||||
template<> int g<>(int)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace cxx17
|
||||
|
||||
#endif // __cplusplus < 201703L
|
||||
|
||||
]])
|
39
vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx_11.m4
generated
vendored
39
vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx_11.m4
generated
vendored
|
@ -1,39 +0,0 @@
|
|||
# =============================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
|
||||
# =============================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check for baseline language coverage in the compiler for the C++11
|
||||
# standard; if necessary, add switches to CXX and CXXCPP to enable
|
||||
# support.
|
||||
#
|
||||
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
|
||||
# macro with the version set to C++11. The two optional arguments are
|
||||
# forwarded literally as the second and third argument respectively.
|
||||
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
|
||||
# more information. If you want to use this macro, you also need to
|
||||
# download the ax_cxx_compile_stdcxx.m4 file.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
||||
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
|
||||
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
|
||||
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
||||
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
|
||||
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 18
|
||||
|
||||
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
|
||||
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
|
107
vendor/git.apache.org/thrift.git/aclocal/ax_dmd.m4
generated
vendored
107
vendor/git.apache.org/thrift.git/aclocal/ax_dmd.m4
generated
vendored
|
@ -1,107 +0,0 @@
|
|||
dnl @synopsis AX_DMD
|
||||
dnl
|
||||
dnl Test for the presence of a DMD-compatible D2 compiler, and (optionally)
|
||||
dnl specified modules on the import path.
|
||||
dnl
|
||||
dnl If "DMD" is defined in the environment, that will be the only
|
||||
dnl dmd command tested. Otherwise, a hard-coded list will be used.
|
||||
dnl
|
||||
dnl After AX_DMD runs, the shell variables "success" and "ax_dmd" are set to
|
||||
dnl "yes" or "no", and "DMD" is set to the appropriate command. Furthermore,
|
||||
dnl "dmd_optlink" will be set to "yes" or "no" depending on whether OPTLINK is
|
||||
dnl used as the linker (DMD/Windows), and "dmd_of_dirsep" will be set to the
|
||||
dnl directory separator to use when passing -of to DMD (OPTLINK requires a
|
||||
dnl backslash).
|
||||
dnl
|
||||
dnl AX_CHECK_D_MODULE must be run after AX_DMD. It tests for the presence of a
|
||||
dnl module in the import path of the chosen compiler, and sets the shell
|
||||
dnl variable "success" to "yes" or "no".
|
||||
dnl
|
||||
dnl @category D
|
||||
dnl @version 2011-05-31
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl Copyright (C) 2009 David Reiss
|
||||
dnl Copyright (C) 2011 David Nadlinger
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
|
||||
|
||||
AC_DEFUN([AX_DMD],
|
||||
[
|
||||
dnl Hard-coded default commands to test.
|
||||
DMD_PROGS="dmd,gdmd,ldmd"
|
||||
|
||||
dnl Allow the user to specify an alternative.
|
||||
if test -n "$DMD" ; then
|
||||
DMD_PROGS="$DMD"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for DMD)
|
||||
|
||||
# std.algorithm as a quick way to check for D2/Phobos.
|
||||
echo "import std.algorithm; void main() {}" > configtest_ax_dmd.d
|
||||
success=no
|
||||
oIFS="$IFS"
|
||||
|
||||
IFS=","
|
||||
for DMD in $DMD_PROGS ; do
|
||||
IFS="$oIFS"
|
||||
|
||||
echo "Running \"$DMD configtest_ax_dmd.d\"" >&AS_MESSAGE_LOG_FD
|
||||
if $DMD configtest_ax_dmd.d >&AS_MESSAGE_LOG_FD 2>&1 ; then
|
||||
success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$success" != "yes" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
DMD=""
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
|
||||
ax_dmd="$success"
|
||||
|
||||
# Test whether OPTLINK is used by trying if DMD accepts -L/? without
|
||||
# erroring out.
|
||||
if test "$success" == "yes" ; then
|
||||
AC_MSG_CHECKING(whether DMD uses OPTLINK)
|
||||
echo "Running \”$DMD -L/? configtest_ax_dmd.d\"" >&AS_MESSAGE_LOG_FD
|
||||
if $DMD -L/? configtest_ax_dmd.d >&AS_MESSAGE_LOG_FD 2>&1 ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
dmd_optlink="yes"
|
||||
|
||||
# This actually produces double slashes in the final configure
|
||||
# output, but at least it works.
|
||||
dmd_of_dirsep="\\\\"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
dmd_optlink="no"
|
||||
dmd_of_dirsep="/"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f configtest_ax_dmd*
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_CHECK_D_MODULE],
|
||||
[
|
||||
AC_MSG_CHECKING(for D module [$1])
|
||||
|
||||
echo "import $1; void main() {}" > configtest_ax_dmd.d
|
||||
|
||||
echo "Running \"$DMD configtest_ax_dmd.d\"" >&AS_MESSAGE_LOG_FD
|
||||
if $DMD -c configtest_ax_dmd.d >&AS_MESSAGE_LOG_FD 2>&1 ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
success=yes
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
success=no
|
||||
fi
|
||||
|
||||
rm -f configtest_ax_dmd*
|
||||
])
|
129
vendor/git.apache.org/thrift.git/aclocal/ax_javac_and_java.m4
generated
vendored
129
vendor/git.apache.org/thrift.git/aclocal/ax_javac_and_java.m4
generated
vendored
|
@ -1,129 +0,0 @@
|
|||
dnl @synopsis AX_JAVAC_AND_JAVA
|
||||
dnl @synopsis AX_CHECK_JAVA_CLASS(CLASSNAME)
|
||||
dnl
|
||||
dnl Test for the presence of a JDK, and (optionally) specific classes.
|
||||
dnl
|
||||
dnl If "JAVA" is defined in the environment, that will be the only
|
||||
dnl java command tested. Otherwise, a hard-coded list will be used.
|
||||
dnl Similarly for "JAVAC".
|
||||
dnl
|
||||
dnl AX_JAVAC_AND_JAVA does not currently support testing for a particular
|
||||
dnl Java version, testing for only one of "java" and "javac", or
|
||||
dnl compiling or running user-provided Java code.
|
||||
dnl
|
||||
dnl After AX_JAVAC_AND_JAVA runs, the shell variables "success" and
|
||||
dnl "ax_javac_and_java" are set to "yes" or "no", and "JAVAC" and
|
||||
dnl "JAVA" are set to the appropriate commands.
|
||||
dnl
|
||||
dnl AX_CHECK_JAVA_CLASS must be run after AX_JAVAC_AND_JAVA.
|
||||
dnl It tests for the presence of a class based on a fully-qualified name.
|
||||
dnl It sets the shell variable "success" to "yes" or "no".
|
||||
dnl
|
||||
dnl @category Java
|
||||
dnl @version 2009-02-09
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl Copyright (C) 2009 David Reiss
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
|
||||
|
||||
AC_DEFUN([AX_JAVAC_AND_JAVA],
|
||||
[
|
||||
|
||||
dnl Hard-coded default commands to test.
|
||||
JAVAC_PROGS="javac,jikes,gcj -C"
|
||||
JAVA_PROGS="java,kaffe"
|
||||
|
||||
dnl Allow the user to specify an alternative.
|
||||
if test -n "$JAVAC" ; then
|
||||
JAVAC_PROGS="$JAVAC"
|
||||
fi
|
||||
if test -n "$JAVA" ; then
|
||||
JAVA_PROGS="$JAVA"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for javac and java)
|
||||
|
||||
echo "public class configtest_ax_javac_and_java { public static void main(String args@<:@@:>@) { } }" > configtest_ax_javac_and_java.java
|
||||
success=no
|
||||
oIFS="$IFS"
|
||||
|
||||
IFS=","
|
||||
for JAVAC in $JAVAC_PROGS ; do
|
||||
IFS="$oIFS"
|
||||
|
||||
echo "Running \"$JAVAC configtest_ax_javac_and_java.java\"" >&AS_MESSAGE_LOG_FD
|
||||
if $JAVAC configtest_ax_javac_and_java.java >&AS_MESSAGE_LOG_FD 2>&1 ; then
|
||||
|
||||
# prevent $JAVA VM issues with UTF-8 path names (THRIFT-3271)
|
||||
oLC_ALL="$LC_ALL"
|
||||
LC_ALL=""
|
||||
|
||||
IFS=","
|
||||
for JAVA in $JAVA_PROGS ; do
|
||||
IFS="$oIFS"
|
||||
|
||||
echo "Running \"$JAVA configtest_ax_javac_and_java\"" >&AS_MESSAGE_LOG_FD
|
||||
if $JAVA configtest_ax_javac_and_java >&AS_MESSAGE_LOG_FD 2>&1 ; then
|
||||
success=yes
|
||||
break 2
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# restore LC_ALL
|
||||
LC_ALL="$oLC_ALL"
|
||||
oLC_ALL=""
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
|
||||
|
||||
if test "$success" != "yes" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
JAVAC=""
|
||||
JAVA=""
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
|
||||
ax_javac_and_java="$success"
|
||||
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_CHECK_JAVA_CLASS],
|
||||
[
|
||||
AC_MSG_CHECKING(for Java class [$1])
|
||||
|
||||
echo "import $1; public class configtest_ax_javac_and_java { public static void main(String args@<:@@:>@) { } }" > configtest_ax_javac_and_java.java
|
||||
|
||||
echo "Running \"$JAVAC configtest_ax_javac_and_java.java\"" >&AS_MESSAGE_LOG_FD
|
||||
if $JAVAC configtest_ax_javac_and_java.java >&AS_MESSAGE_LOG_FD 2>&1 ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
success=yes
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
success=no
|
||||
fi
|
||||
|
||||
rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_CHECK_ANT_VERSION],
|
||||
[
|
||||
AC_MSG_CHECKING(for ant version > $2)
|
||||
ANT_VALID=`expr "x$(printf "$2\n$($1 -version 2>/dev/null | sed -n 's/.*version \(@<:@0-9\.@:>@*\).*/\1/p')" | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -g | sed -n 1p)" = "x$2"`
|
||||
if test "x$ANT_VALID" = "x1" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
ANT=""
|
||||
fi
|
||||
])
|
||||
|
194
vendor/git.apache.org/thrift.git/aclocal/ax_lib_event.m4
generated
vendored
194
vendor/git.apache.org/thrift.git/aclocal/ax_lib_event.m4
generated
vendored
|
@ -1,194 +0,0 @@
|
|||
dnl @synopsis AX_LIB_EVENT([MINIMUM-VERSION])
|
||||
dnl
|
||||
dnl Test for the libevent library of a particular version (or newer).
|
||||
dnl
|
||||
dnl If no path to the installed libevent is given, the macro will first try
|
||||
dnl using no -I or -L flags, then searches under /usr, /usr/local, /opt,
|
||||
dnl and /opt/libevent.
|
||||
dnl If these all fail, it will try the $LIBEVENT_ROOT environment variable.
|
||||
dnl
|
||||
dnl This macro requires that #include <sys/types.h> works and defines u_char.
|
||||
dnl
|
||||
dnl This macro calls:
|
||||
dnl AC_SUBST(LIBEVENT_CPPFLAGS)
|
||||
dnl AC_SUBST(LIBEVENT_LDFLAGS)
|
||||
dnl AC_SUBST(LIBEVENT_LIBS)
|
||||
dnl
|
||||
dnl And (if libevent is found):
|
||||
dnl AC_DEFINE(HAVE_LIBEVENT)
|
||||
dnl
|
||||
dnl It also leaves the shell variables "success" and "ax_have_libevent"
|
||||
dnl set to "yes" or "no".
|
||||
dnl
|
||||
dnl NOTE: This macro does not currently work for cross-compiling,
|
||||
dnl but it can be easily modified to allow it. (grep "cross").
|
||||
dnl
|
||||
dnl @category InstalledPackages
|
||||
dnl @category C
|
||||
dnl @version 2007-09-12
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl Copyright (C) 2009 David Reiss
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
|
||||
dnl Input: ax_libevent_path, WANT_LIBEVENT_VERSION
|
||||
dnl Output: success=yes/no
|
||||
AC_DEFUN([AX_LIB_EVENT_DO_CHECK],
|
||||
[
|
||||
# Save our flags.
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LIBS_SAVED="$LIBS"
|
||||
LD_LIBRARY_PATH_SAVED="$LD_LIBRARY_PATH"
|
||||
|
||||
# Set our flags if we are checking a specific directory.
|
||||
if test -n "$ax_libevent_path" ; then
|
||||
LIBEVENT_CPPFLAGS="-I$ax_libevent_path/include"
|
||||
LIBEVENT_LDFLAGS="-L$ax_libevent_path/lib"
|
||||
LD_LIBRARY_PATH="$ax_libevent_path/lib:$LD_LIBRARY_PATH"
|
||||
else
|
||||
LIBEVENT_CPPFLAGS=""
|
||||
LIBEVENT_LDFLAGS=""
|
||||
fi
|
||||
|
||||
# Required flag for libevent.
|
||||
LIBEVENT_LIBS="-levent"
|
||||
|
||||
# Prepare the environment for compilation.
|
||||
CPPFLAGS="$CPPFLAGS $LIBEVENT_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $LIBEVENT_LDFLAGS"
|
||||
LIBS="$LIBS $LIBEVENT_LIBS"
|
||||
export CPPFLAGS
|
||||
export LDFLAGS
|
||||
export LIBS
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
success=no
|
||||
|
||||
# Compile, link, and run the program. This checks:
|
||||
# - event.h is available for including.
|
||||
# - event_get_version() is available for linking.
|
||||
# - The event version string is lexicographically greater
|
||||
# than the required version.
|
||||
AC_LANG_PUSH([C])
|
||||
dnl This can be changed to AC_LINK_IFELSE if you are cross-compiling,
|
||||
dnl but then the version cannot be checked.
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <event.h>
|
||||
]], [[
|
||||
const char* lib_version = event_get_version();
|
||||
const char* wnt_version = "$WANT_LIBEVENT_VERSION";
|
||||
int lib_digits;
|
||||
int wnt_digits;
|
||||
for (;;) {
|
||||
/* If we reached the end of the want version. We have it. */
|
||||
if (*wnt_version == '\0' || *wnt_version == '-') {
|
||||
return 0;
|
||||
}
|
||||
/* If the want version continues but the lib version does not, */
|
||||
/* we are missing a letter. We don't have it. */
|
||||
if (*lib_version == '\0' || *lib_version == '-') {
|
||||
return 1;
|
||||
}
|
||||
/* In the 1.4 version numbering style, if there are more digits */
|
||||
/* in one version than the other, that one is higher. */
|
||||
for (lib_digits = 0;
|
||||
lib_version[lib_digits] >= '0' &&
|
||||
lib_version[lib_digits] <= '9';
|
||||
lib_digits++)
|
||||
;
|
||||
for (wnt_digits = 0;
|
||||
wnt_version[wnt_digits] >= '0' &&
|
||||
wnt_version[wnt_digits] <= '9';
|
||||
wnt_digits++)
|
||||
;
|
||||
if (lib_digits > wnt_digits) {
|
||||
return 0;
|
||||
}
|
||||
if (lib_digits < wnt_digits) {
|
||||
return 1;
|
||||
}
|
||||
/* If we have greater than what we want. We have it. */
|
||||
if (*lib_version > *wnt_version) {
|
||||
return 0;
|
||||
}
|
||||
/* If we have less, we don't. */
|
||||
if (*lib_version < *wnt_version) {
|
||||
return 1;
|
||||
}
|
||||
lib_version++;
|
||||
wnt_version++;
|
||||
}
|
||||
return 0;
|
||||
]])], [
|
||||
success=yes
|
||||
])
|
||||
AC_LANG_POP([C])
|
||||
|
||||
# Restore flags.
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
LIBS="$LIBS_SAVED"
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_SAVED"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_LIB_EVENT],
|
||||
[
|
||||
|
||||
dnl Allow search path to be overridden on the command line.
|
||||
AC_ARG_WITH([libevent],
|
||||
AS_HELP_STRING([--with-libevent@<:@=DIR@:>@], [use libevent [default=yes]. Optionally specify the root prefix dir where libevent is installed]),
|
||||
[
|
||||
if test "x$withval" = "xno"; then
|
||||
want_libevent="no"
|
||||
elif test "x$withval" = "xyes"; then
|
||||
want_libevent="yes"
|
||||
ax_libevent_path=""
|
||||
else
|
||||
want_libevent="yes"
|
||||
ax_libevent_path="$withval"
|
||||
fi
|
||||
],
|
||||
[ want_libevent="yes" ; ax_libevent_path="" ])
|
||||
|
||||
|
||||
if test "$want_libevent" = "yes"; then
|
||||
WANT_LIBEVENT_VERSION=ifelse([$1], ,1.2,$1)
|
||||
|
||||
AC_MSG_CHECKING(for libevent >= $WANT_LIBEVENT_VERSION)
|
||||
|
||||
# Run tests.
|
||||
if test -n "$ax_libevent_path"; then
|
||||
AX_LIB_EVENT_DO_CHECK
|
||||
else
|
||||
for ax_libevent_path in "" $lt_sysroot/usr $lt_sysroot/usr/local $lt_sysroot/opt $lt_sysroot/opt/local $lt_sysroot/opt/libevent "$LIBEVENT_ROOT" ; do
|
||||
AX_LIB_EVENT_DO_CHECK
|
||||
if test "$success" = "yes"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$success" != "yes" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
LIBEVENT_CPPFLAGS=""
|
||||
LIBEVENT_LDFLAGS=""
|
||||
LIBEVENT_LIBS=""
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LIBEVENT,,[define if libevent is available])
|
||||
ax_have_libevent_[]m4_translit([$1], [.], [_])="yes"
|
||||
fi
|
||||
|
||||
ax_have_libevent="$success"
|
||||
|
||||
AC_SUBST(LIBEVENT_CPPFLAGS)
|
||||
AC_SUBST(LIBEVENT_LDFLAGS)
|
||||
AC_SUBST(LIBEVENT_LIBS)
|
||||
fi
|
||||
|
||||
])
|
173
vendor/git.apache.org/thrift.git/aclocal/ax_lib_zlib.m4
generated
vendored
173
vendor/git.apache.org/thrift.git/aclocal/ax_lib_zlib.m4
generated
vendored
|
@ -1,173 +0,0 @@
|
|||
dnl @synopsis AX_LIB_ZLIB([MINIMUM-VERSION])
|
||||
dnl
|
||||
dnl Test for the libz library of a particular version (or newer).
|
||||
dnl
|
||||
dnl If no path to the installed zlib is given, the macro will first try
|
||||
dnl using no -I or -L flags, then searches under /usr, /usr/local, /opt,
|
||||
dnl and /opt/zlib.
|
||||
dnl If these all fail, it will try the $ZLIB_ROOT environment variable.
|
||||
dnl
|
||||
dnl This macro calls:
|
||||
dnl AC_SUBST(ZLIB_CPPFLAGS)
|
||||
dnl AC_SUBST(ZLIB_LDFLAGS)
|
||||
dnl AC_SUBST(ZLIB_LIBS)
|
||||
dnl
|
||||
dnl And (if zlib is found):
|
||||
dnl AC_DEFINE(HAVE_ZLIB)
|
||||
dnl
|
||||
dnl It also leaves the shell variables "success" and "ax_have_zlib"
|
||||
dnl set to "yes" or "no".
|
||||
dnl
|
||||
dnl NOTE: This macro does not currently work for cross-compiling,
|
||||
dnl but it can be easily modified to allow it. (grep "cross").
|
||||
dnl
|
||||
dnl @category InstalledPackages
|
||||
dnl @category C
|
||||
dnl @version 2007-09-12
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl Copyright (C) 2009 David Reiss
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
|
||||
dnl Input: ax_zlib_path, WANT_ZLIB_VERSION
|
||||
dnl Output: success=yes/no
|
||||
AC_DEFUN([AX_LIB_ZLIB_DO_CHECK],
|
||||
[
|
||||
# Save our flags.
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LIBS_SAVED="$LIBS"
|
||||
LD_LIBRARY_PATH_SAVED="$LD_LIBRARY_PATH"
|
||||
|
||||
# Set our flags if we are checking a specific directory.
|
||||
if test -n "$ax_zlib_path" ; then
|
||||
ZLIB_CPPFLAGS="-I$ax_zlib_path/include"
|
||||
ZLIB_LDFLAGS="-L$ax_zlib_path/lib"
|
||||
LD_LIBRARY_PATH="$ax_zlib_path/lib:$LD_LIBRARY_PATH"
|
||||
else
|
||||
ZLIB_CPPFLAGS=""
|
||||
ZLIB_LDFLAGS=""
|
||||
fi
|
||||
|
||||
# Required flag for zlib.
|
||||
ZLIB_LIBS="-lz"
|
||||
|
||||
# Prepare the environment for compilation.
|
||||
CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
|
||||
LIBS="$LIBS $ZLIB_LIBS"
|
||||
export CPPFLAGS
|
||||
export LDFLAGS
|
||||
export LIBS
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
success=no
|
||||
|
||||
# Compile, link, and run the program. This checks:
|
||||
# - zlib.h is available for including.
|
||||
# - zlibVersion() is available for linking.
|
||||
# - ZLIB_VERNUM is greater than or equal to the desired version.
|
||||
# - ZLIB_VERSION (defined in zlib.h) matches zlibVersion()
|
||||
# (defined in the library).
|
||||
AC_LANG_PUSH([C])
|
||||
dnl This can be changed to AC_LINK_IFELSE if you are cross-compiling.
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <zlib.h>
|
||||
#if ZLIB_VERNUM >= 0x$WANT_ZLIB_VERSION
|
||||
#else
|
||||
# error zlib is too old
|
||||
#endif
|
||||
]], [[
|
||||
const char* lib_version = zlibVersion();
|
||||
const char* hdr_version = ZLIB_VERSION;
|
||||
for (;;) {
|
||||
if (*lib_version != *hdr_version) {
|
||||
/* If this happens, your zlib header doesn't match your zlib */
|
||||
/* library. That is really bad. */
|
||||
return 1;
|
||||
}
|
||||
if (*lib_version == '\0') {
|
||||
break;
|
||||
}
|
||||
lib_version++;
|
||||
hdr_version++;
|
||||
}
|
||||
return 0;
|
||||
]])], [
|
||||
success=yes
|
||||
])
|
||||
AC_LANG_POP([C])
|
||||
|
||||
# Restore flags.
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
LIBS="$LIBS_SAVED"
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_SAVED"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_LIB_ZLIB],
|
||||
[
|
||||
|
||||
dnl Allow search path to be overridden on the command line.
|
||||
AC_ARG_WITH([zlib],
|
||||
AS_HELP_STRING([--with-zlib@<:@=DIR@:>@], [use zlib (default is yes) - it is possible to specify an alternate root directory for zlib]),
|
||||
[
|
||||
if test "x$withval" = "xno"; then
|
||||
want_zlib="no"
|
||||
elif test "x$withval" = "xyes"; then
|
||||
want_zlib="yes"
|
||||
ax_zlib_path=""
|
||||
else
|
||||
want_zlib="yes"
|
||||
ax_zlib_path="$withval"
|
||||
fi
|
||||
],
|
||||
[want_zlib="yes" ; ax_zlib_path="" ])
|
||||
|
||||
|
||||
if test "$want_zlib" = "yes"; then
|
||||
# Parse out the version.
|
||||
zlib_version_req=ifelse([$1], ,1.2.3,$1)
|
||||
zlib_version_req_major=`expr $zlib_version_req : '\([[0-9]]*\)'`
|
||||
zlib_version_req_minor=`expr $zlib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
|
||||
zlib_version_req_patch=`expr $zlib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
|
||||
if test -z "$zlib_version_req_patch" ; then
|
||||
zlib_version_req_patch="0"
|
||||
fi
|
||||
WANT_ZLIB_VERSION=`expr $zlib_version_req_major \* 1000 \+ $zlib_version_req_minor \* 100 \+ $zlib_version_req_patch \* 10`
|
||||
|
||||
AC_MSG_CHECKING(for zlib >= $zlib_version_req)
|
||||
|
||||
# Run tests.
|
||||
if test -n "$ax_zlib_path"; then
|
||||
AX_LIB_ZLIB_DO_CHECK
|
||||
else
|
||||
for ax_zlib_path in "" /usr /usr/local /opt /opt/zlib "$ZLIB_ROOT" ; do
|
||||
AX_LIB_ZLIB_DO_CHECK
|
||||
if test "$success" = "yes"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$success" != "yes" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
ZLIB_CPPFLAGS=""
|
||||
ZLIB_LDFLAGS=""
|
||||
ZLIB_LIBS=""
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_ZLIB,,[define if zlib is available])
|
||||
fi
|
||||
|
||||
ax_have_zlib="$success"
|
||||
|
||||
AC_SUBST(ZLIB_CPPFLAGS)
|
||||
AC_SUBST(ZLIB_LDFLAGS)
|
||||
AC_SUBST(ZLIB_LIBS)
|
||||
fi
|
||||
|
||||
])
|
664
vendor/git.apache.org/thrift.git/aclocal/ax_lua.m4
generated
vendored
664
vendor/git.apache.org/thrift.git/aclocal/ax_lua.m4
generated
vendored
|
@ -1,664 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_lua.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PROG_LUA[([MINIMUM-VERSION], [TOO-BIG-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
|
||||
# AX_LUA_HEADERS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
|
||||
# AX_LUA_LIBS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
|
||||
# AX_LUA_READLINE[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Detect a Lua interpreter, optionally specifying a minimum and maximum
|
||||
# version number. Set up important Lua paths, such as the directories in
|
||||
# which to install scripts and modules (shared libraries).
|
||||
#
|
||||
# Also detect Lua headers and libraries. The Lua version contained in the
|
||||
# header is checked to match the Lua interpreter version exactly. When
|
||||
# searching for Lua libraries, the version number is used as a suffix.
|
||||
# This is done with the goal of supporting multiple Lua installs (5.1,
|
||||
# 5.2, and 5.3 side-by-side).
|
||||
#
|
||||
# A note on compatibility with previous versions: This file has been
|
||||
# mostly rewritten for serial 18. Most developers should be able to use
|
||||
# these macros without needing to modify configure.ac. Care has been taken
|
||||
# to preserve each macro's behavior, but there are some differences:
|
||||
#
|
||||
# 1) AX_WITH_LUA is deprecated; it now expands to the exact same thing as
|
||||
# AX_PROG_LUA with no arguments.
|
||||
#
|
||||
# 2) AX_LUA_HEADERS now checks that the version number defined in lua.h
|
||||
# matches the interpreter version. AX_LUA_HEADERS_VERSION is therefore
|
||||
# unnecessary, so it is deprecated and does not expand to anything.
|
||||
#
|
||||
# 3) The configure flag --with-lua-suffix no longer exists; the user
|
||||
# should instead specify the LUA precious variable on the command line.
|
||||
# See the AX_PROG_LUA description for details.
|
||||
#
|
||||
# Please read the macro descriptions below for more information.
|
||||
#
|
||||
# This file was inspired by Andrew Dalke's and James Henstridge's
|
||||
# python.m4 and Tom Payne's, Matthieu Moy's, and Reuben Thomas's ax_lua.m4
|
||||
# (serial 17). Basically, this file is a mash-up of those two files. I
|
||||
# like to think it combines the best of the two!
|
||||
#
|
||||
# AX_PROG_LUA: Search for the Lua interpreter, and set up important Lua
|
||||
# paths. Adds precious variable LUA, which may contain the path of the Lua
|
||||
# interpreter. If LUA is blank, the user's path is searched for an
|
||||
# suitable interpreter.
|
||||
#
|
||||
# If MINIMUM-VERSION is supplied, then only Lua interpreters with a
|
||||
# version number greater or equal to MINIMUM-VERSION will be accepted. If
|
||||
# TOO-BIG-VERSION is also supplied, then only Lua interpreters with a
|
||||
# version number greater or equal to MINIMUM-VERSION and less than
|
||||
# TOO-BIG-VERSION will be accepted.
|
||||
#
|
||||
# The Lua version number, LUA_VERSION, is found from the interpreter, and
|
||||
# substituted. LUA_PLATFORM is also found, but not currently supported (no
|
||||
# standard representation).
|
||||
#
|
||||
# Finally, the macro finds four paths:
|
||||
#
|
||||
# luadir Directory to install Lua scripts.
|
||||
# pkgluadir $luadir/$PACKAGE
|
||||
# luaexecdir Directory to install Lua modules.
|
||||
# pkgluaexecdir $luaexecdir/$PACKAGE
|
||||
#
|
||||
# These paths are found based on $prefix, $exec_prefix, Lua's
|
||||
# package.path, and package.cpath. The first path of package.path
|
||||
# beginning with $prefix is selected as luadir. The first path of
|
||||
# package.cpath beginning with $exec_prefix is used as luaexecdir. This
|
||||
# should work on all reasonable Lua installations. If a path cannot be
|
||||
# determined, a default path is used. Of course, the user can override
|
||||
# these later when invoking make.
|
||||
#
|
||||
# luadir Default: $prefix/share/lua/$LUA_VERSION
|
||||
# luaexecdir Default: $exec_prefix/lib/lua/$LUA_VERSION
|
||||
#
|
||||
# These directories can be used by Automake as install destinations. The
|
||||
# variable name minus 'dir' needs to be used as a prefix to the
|
||||
# appropriate Automake primary, e.g. lua_SCRIPS or luaexec_LIBRARIES.
|
||||
#
|
||||
# If an acceptable Lua interpreter is found, then ACTION-IF-FOUND is
|
||||
# performed, otherwise ACTION-IF-NOT-FOUND is preformed. If ACTION-IF-NOT-
|
||||
# FOUND is blank, then it will default to printing an error. To prevent
|
||||
# the default behavior, give ':' as an action.
|
||||
#
|
||||
# AX_LUA_HEADERS: Search for Lua headers. Requires that AX_PROG_LUA be
|
||||
# expanded before this macro. Adds precious variable LUA_INCLUDE, which
|
||||
# may contain Lua specific include flags, e.g. -I/usr/include/lua5.1. If
|
||||
# LUA_INCLUDE is blank, then this macro will attempt to find suitable
|
||||
# flags.
|
||||
#
|
||||
# LUA_INCLUDE can be used by Automake to compile Lua modules or
|
||||
# executables with embedded interpreters. The *_CPPFLAGS variables should
|
||||
# be used for this purpose, e.g. myprog_CPPFLAGS = $(LUA_INCLUDE).
|
||||
#
|
||||
# This macro searches for the header lua.h (and others). The search is
|
||||
# performed with a combination of CPPFLAGS, CPATH, etc, and LUA_INCLUDE.
|
||||
# If the search is unsuccessful, then some common directories are tried.
|
||||
# If the headers are then found, then LUA_INCLUDE is set accordingly.
|
||||
#
|
||||
# The paths automatically searched are:
|
||||
#
|
||||
# * /usr/include/luaX.Y
|
||||
# * /usr/include/lua/X.Y
|
||||
# * /usr/include/luaXY
|
||||
# * /usr/local/include/luaX.Y
|
||||
# * /usr/local/include/lua-X.Y
|
||||
# * /usr/local/include/lua/X.Y
|
||||
# * /usr/local/include/luaXY
|
||||
#
|
||||
# (Where X.Y is the Lua version number, e.g. 5.1.)
|
||||
#
|
||||
# The Lua version number found in the headers is always checked to match
|
||||
# the Lua interpreter's version number. Lua headers with mismatched
|
||||
# version numbers are not accepted.
|
||||
#
|
||||
# If headers are found, then ACTION-IF-FOUND is performed, otherwise
|
||||
# ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
|
||||
# it will default to printing an error. To prevent the default behavior,
|
||||
# set the action to ':'.
|
||||
#
|
||||
# AX_LUA_LIBS: Search for Lua libraries. Requires that AX_PROG_LUA be
|
||||
# expanded before this macro. Adds precious variable LUA_LIB, which may
|
||||
# contain Lua specific linker flags, e.g. -llua5.1. If LUA_LIB is blank,
|
||||
# then this macro will attempt to find suitable flags.
|
||||
#
|
||||
# LUA_LIB can be used by Automake to link Lua modules or executables with
|
||||
# embedded interpreters. The *_LIBADD and *_LDADD variables should be used
|
||||
# for this purpose, e.g. mymod_LIBADD = $(LUA_LIB).
|
||||
#
|
||||
# This macro searches for the Lua library. More technically, it searches
|
||||
# for a library containing the function lua_load. The search is performed
|
||||
# with a combination of LIBS, LIBRARY_PATH, and LUA_LIB.
|
||||
#
|
||||
# If the search determines that some linker flags are missing, then those
|
||||
# flags will be added to LUA_LIB.
|
||||
#
|
||||
# If libraries are found, then ACTION-IF-FOUND is performed, otherwise
|
||||
# ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
|
||||
# it will default to printing an error. To prevent the default behavior,
|
||||
# set the action to ':'.
|
||||
#
|
||||
# AX_LUA_READLINE: Search for readline headers and libraries. Requires the
|
||||
# AX_LIB_READLINE macro, which is provided by ax_lib_readline.m4 from the
|
||||
# Autoconf Archive.
|
||||
#
|
||||
# If a readline compatible library is found, then ACTION-IF-FOUND is
|
||||
# performed, otherwise ACTION-IF-NOT-FOUND is performed.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2015 Reuben Thomas <rrt@sc3d.org>
|
||||
# Copyright (c) 2014 Tim Perkins <tprk77@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 40
|
||||
|
||||
dnl =========================================================================
|
||||
dnl AX_PROG_LUA([MINIMUM-VERSION], [TOO-BIG-VERSION],
|
||||
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([AX_PROG_LUA],
|
||||
[
|
||||
dnl Check for required tools.
|
||||
AC_REQUIRE([AC_PROG_GREP])
|
||||
AC_REQUIRE([AC_PROG_SED])
|
||||
|
||||
dnl Make LUA a precious variable.
|
||||
AC_ARG_VAR([LUA], [The Lua interpreter, e.g. /usr/bin/lua5.1])
|
||||
|
||||
dnl Find a Lua interpreter.
|
||||
m4_define_default([_AX_LUA_INTERPRETER_LIST],
|
||||
[lua lua5.3 lua53 lua5.2 lua52 lua5.1 lua51 lua50])
|
||||
|
||||
m4_if([$1], [],
|
||||
[ dnl No version check is needed. Find any Lua interpreter.
|
||||
AS_IF([test "x$LUA" = 'x'],
|
||||
[AC_PATH_PROGS([LUA], [_AX_LUA_INTERPRETER_LIST], [:])])
|
||||
ax_display_LUA='lua'
|
||||
|
||||
AS_IF([test "x$LUA" != 'x:'],
|
||||
[ dnl At least check if this is a Lua interpreter.
|
||||
AC_MSG_CHECKING([if $LUA is a Lua interpreter])
|
||||
_AX_LUA_CHK_IS_INTRP([$LUA],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([not a Lua interpreter])
|
||||
])
|
||||
])
|
||||
],
|
||||
[ dnl A version check is needed.
|
||||
AS_IF([test "x$LUA" != 'x'],
|
||||
[ dnl Check if this is a Lua interpreter.
|
||||
AC_MSG_CHECKING([if $LUA is a Lua interpreter])
|
||||
_AX_LUA_CHK_IS_INTRP([$LUA],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([not a Lua interpreter])
|
||||
])
|
||||
dnl Check the version.
|
||||
m4_if([$2], [],
|
||||
[_ax_check_text="whether $LUA version >= $1"],
|
||||
[_ax_check_text="whether $LUA version >= $1, < $2"])
|
||||
AC_MSG_CHECKING([$_ax_check_text])
|
||||
_AX_LUA_CHK_VER([$LUA], [$1], [$2],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([version is out of range for specified LUA])])
|
||||
ax_display_LUA=$LUA
|
||||
],
|
||||
[ dnl Try each interpreter until we find one that satisfies VERSION.
|
||||
m4_if([$2], [],
|
||||
[_ax_check_text="for a Lua interpreter with version >= $1"],
|
||||
[_ax_check_text="for a Lua interpreter with version >= $1, < $2"])
|
||||
AC_CACHE_CHECK([$_ax_check_text],
|
||||
[ax_cv_pathless_LUA],
|
||||
[ for ax_cv_pathless_LUA in _AX_LUA_INTERPRETER_LIST none; do
|
||||
test "x$ax_cv_pathless_LUA" = 'xnone' && break
|
||||
_AX_LUA_CHK_IS_INTRP([$ax_cv_pathless_LUA], [], [continue])
|
||||
_AX_LUA_CHK_VER([$ax_cv_pathless_LUA], [$1], [$2], [break])
|
||||
done
|
||||
])
|
||||
dnl Set $LUA to the absolute path of $ax_cv_pathless_LUA.
|
||||
AS_IF([test "x$ax_cv_pathless_LUA" = 'xnone'],
|
||||
[LUA=':'],
|
||||
[AC_PATH_PROG([LUA], [$ax_cv_pathless_LUA])])
|
||||
ax_display_LUA=$ax_cv_pathless_LUA
|
||||
])
|
||||
])
|
||||
|
||||
AS_IF([test "x$LUA" = 'x:'],
|
||||
[ dnl Run any user-specified action, or abort.
|
||||
m4_default([$4], [AC_MSG_ERROR([cannot find suitable Lua interpreter])])
|
||||
],
|
||||
[ dnl Query Lua for its version number.
|
||||
AC_CACHE_CHECK([for $ax_display_LUA version],
|
||||
[ax_cv_lua_version],
|
||||
[ dnl Get the interpreter version in X.Y format. This should work for
|
||||
dnl interpreters version 5.0 and beyond.
|
||||
ax_cv_lua_version=[`$LUA -e '
|
||||
-- return a version number in X.Y format
|
||||
local _, _, ver = string.find(_VERSION, "^Lua (%d+%.%d+)")
|
||||
print(ver)'`]
|
||||
])
|
||||
AS_IF([test "x$ax_cv_lua_version" = 'x'],
|
||||
[AC_MSG_ERROR([invalid Lua version number])])
|
||||
AC_SUBST([LUA_VERSION], [$ax_cv_lua_version])
|
||||
AC_SUBST([LUA_SHORT_VERSION], [`echo "$LUA_VERSION" | $SED 's|\.||'`])
|
||||
|
||||
dnl The following check is not supported:
|
||||
dnl At times (like when building shared libraries) you may want to know
|
||||
dnl which OS platform Lua thinks this is.
|
||||
AC_CACHE_CHECK([for $ax_display_LUA platform],
|
||||
[ax_cv_lua_platform],
|
||||
[ax_cv_lua_platform=[`$LUA -e 'print("unknown")'`]])
|
||||
AC_SUBST([LUA_PLATFORM], [$ax_cv_lua_platform])
|
||||
|
||||
dnl Use the values of $prefix and $exec_prefix for the corresponding
|
||||
dnl values of LUA_PREFIX and LUA_EXEC_PREFIX. These are made distinct
|
||||
dnl variables so they can be overridden if need be. However, the general
|
||||
dnl consensus is that you shouldn't need this ability.
|
||||
AC_SUBST([LUA_PREFIX], ['${prefix}'])
|
||||
AC_SUBST([LUA_EXEC_PREFIX], ['${exec_prefix}'])
|
||||
|
||||
dnl Lua provides no way to query the script directory, and instead
|
||||
dnl provides LUA_PATH. However, we should be able to make a safe educated
|
||||
dnl guess. If the built-in search path contains a directory which is
|
||||
dnl prefixed by $prefix, then we can store scripts there. The first
|
||||
dnl matching path will be used.
|
||||
AC_CACHE_CHECK([for $ax_display_LUA script directory],
|
||||
[ax_cv_lua_luadir],
|
||||
[ AS_IF([test "x$prefix" = 'xNONE'],
|
||||
[ax_lua_prefix=$ac_default_prefix],
|
||||
[ax_lua_prefix=$prefix])
|
||||
|
||||
dnl Initialize to the default path.
|
||||
ax_cv_lua_luadir="$LUA_PREFIX/share/lua/$LUA_VERSION"
|
||||
|
||||
dnl Try to find a path with the prefix.
|
||||
_AX_LUA_FND_PRFX_PTH([$LUA], [$ax_lua_prefix], [script])
|
||||
AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
|
||||
[ dnl Fix the prefix.
|
||||
_ax_strip_prefix=`echo "$ax_lua_prefix" | $SED 's|.|.|g'`
|
||||
ax_cv_lua_luadir=`echo "$ax_lua_prefixed_path" | \
|
||||
$SED "s|^$_ax_strip_prefix|$LUA_PREFIX|"`
|
||||
])
|
||||
])
|
||||
AC_SUBST([luadir], [$ax_cv_lua_luadir])
|
||||
AC_SUBST([pkgluadir], [\${luadir}/$PACKAGE])
|
||||
|
||||
dnl Lua provides no way to query the module directory, and instead
|
||||
dnl provides LUA_PATH. However, we should be able to make a safe educated
|
||||
dnl guess. If the built-in search path contains a directory which is
|
||||
dnl prefixed by $exec_prefix, then we can store modules there. The first
|
||||
dnl matching path will be used.
|
||||
AC_CACHE_CHECK([for $ax_display_LUA module directory],
|
||||
[ax_cv_lua_luaexecdir],
|
||||
[ AS_IF([test "x$exec_prefix" = 'xNONE'],
|
||||
[ax_lua_exec_prefix=$ax_lua_prefix],
|
||||
[ax_lua_exec_prefix=$exec_prefix])
|
||||
|
||||
dnl Initialize to the default path.
|
||||
ax_cv_lua_luaexecdir="$LUA_EXEC_PREFIX/lib/lua/$LUA_VERSION"
|
||||
|
||||
dnl Try to find a path with the prefix.
|
||||
_AX_LUA_FND_PRFX_PTH([$LUA],
|
||||
[$ax_lua_exec_prefix], [module])
|
||||
AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
|
||||
[ dnl Fix the prefix.
|
||||
_ax_strip_prefix=`echo "$ax_lua_exec_prefix" | $SED 's|.|.|g'`
|
||||
ax_cv_lua_luaexecdir=`echo "$ax_lua_prefixed_path" | \
|
||||
$SED "s|^$_ax_strip_prefix|$LUA_EXEC_PREFIX|"`
|
||||
])
|
||||
])
|
||||
AC_SUBST([luaexecdir], [$ax_cv_lua_luaexecdir])
|
||||
AC_SUBST([pkgluaexecdir], [\${luaexecdir}/$PACKAGE])
|
||||
|
||||
dnl Run any user specified action.
|
||||
$3
|
||||
])
|
||||
])
|
||||
|
||||
dnl AX_WITH_LUA is now the same thing as AX_PROG_LUA.
|
||||
AC_DEFUN([AX_WITH_LUA],
|
||||
[
|
||||
AC_MSG_WARN([[$0 is deprecated, please use AX_PROG_LUA instead]])
|
||||
AX_PROG_LUA
|
||||
])
|
||||
|
||||
|
||||
dnl =========================================================================
|
||||
dnl _AX_LUA_CHK_IS_INTRP(PROG, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([_AX_LUA_CHK_IS_INTRP],
|
||||
[
|
||||
dnl A minimal Lua factorial to prove this is an interpreter. This should work
|
||||
dnl for Lua interpreters version 5.0 and beyond.
|
||||
_ax_lua_factorial=[`$1 2>/dev/null -e '
|
||||
-- a simple factorial
|
||||
function fact (n)
|
||||
if n == 0 then
|
||||
return 1
|
||||
else
|
||||
return n * fact(n-1)
|
||||
end
|
||||
end
|
||||
print("fact(5) is " .. fact(5))'`]
|
||||
AS_IF([test "$_ax_lua_factorial" = 'fact(5) is 120'],
|
||||
[$2], [$3])
|
||||
])
|
||||
|
||||
|
||||
dnl =========================================================================
|
||||
dnl _AX_LUA_CHK_VER(PROG, MINIMUM-VERSION, [TOO-BIG-VERSION],
|
||||
dnl [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([_AX_LUA_CHK_VER],
|
||||
[
|
||||
dnl Check that the Lua version is within the bounds. Only the major and minor
|
||||
dnl version numbers are considered. This should work for Lua interpreters
|
||||
dnl version 5.0 and beyond.
|
||||
_ax_lua_good_version=[`$1 -e '
|
||||
-- a script to compare versions
|
||||
function verstr2num(verstr)
|
||||
local _, _, majorver, minorver = string.find(verstr, "^(%d+)%.(%d+)")
|
||||
if majorver and minorver then
|
||||
return tonumber(majorver) * 100 + tonumber(minorver)
|
||||
end
|
||||
end
|
||||
local minver = verstr2num("$2")
|
||||
local _, _, trimver = string.find(_VERSION, "^Lua (.*)")
|
||||
local ver = verstr2num(trimver)
|
||||
local maxver = verstr2num("$3") or 1e9
|
||||
if minver <= ver and ver < maxver then
|
||||
print("yes")
|
||||
else
|
||||
print("no")
|
||||
end'`]
|
||||
AS_IF([test "x$_ax_lua_good_version" = "xyes"],
|
||||
[$4], [$5])
|
||||
])
|
||||
|
||||
|
||||
dnl =========================================================================
|
||||
dnl _AX_LUA_FND_PRFX_PTH(PROG, PREFIX, SCRIPT-OR-MODULE-DIR)
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([_AX_LUA_FND_PRFX_PTH],
|
||||
[
|
||||
dnl Get the script or module directory by querying the Lua interpreter,
|
||||
dnl filtering on the given prefix, and selecting the shallowest path. If no
|
||||
dnl path is found matching the prefix, the result will be an empty string.
|
||||
dnl The third argument determines the type of search, it can be 'script' or
|
||||
dnl 'module'. Supplying 'script' will perform the search with package.path
|
||||
dnl and LUA_PATH, and supplying 'module' will search with package.cpath and
|
||||
dnl LUA_CPATH. This is done for compatibility with Lua 5.0.
|
||||
|
||||
ax_lua_prefixed_path=[`$1 -e '
|
||||
-- get the path based on search type
|
||||
local searchtype = "$3"
|
||||
local paths = ""
|
||||
if searchtype == "script" then
|
||||
paths = (package and package.path) or LUA_PATH
|
||||
elseif searchtype == "module" then
|
||||
paths = (package and package.cpath) or LUA_CPATH
|
||||
end
|
||||
-- search for the prefix
|
||||
local prefix = "'$2'"
|
||||
local minpath = ""
|
||||
local mindepth = 1e9
|
||||
string.gsub(paths, "(@<:@^;@:>@+)",
|
||||
function (path)
|
||||
path = string.gsub(path, "%?.*$", "")
|
||||
path = string.gsub(path, "/@<:@^/@:>@*$", "")
|
||||
if string.find(path, prefix) then
|
||||
local depth = string.len(string.gsub(path, "@<:@^/@:>@", ""))
|
||||
if depth < mindepth then
|
||||
minpath = path
|
||||
mindepth = depth
|
||||
end
|
||||
end
|
||||
end)
|
||||
print(minpath)'`]
|
||||
])
|
||||
|
||||
|
||||
dnl =========================================================================
|
||||
dnl AX_LUA_HEADERS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([AX_LUA_HEADERS],
|
||||
[
|
||||
dnl Check for LUA_VERSION.
|
||||
AC_MSG_CHECKING([if LUA_VERSION is defined])
|
||||
AS_IF([test "x$LUA_VERSION" != 'x'],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([cannot check Lua headers without knowing LUA_VERSION])
|
||||
])
|
||||
|
||||
dnl Make LUA_INCLUDE a precious variable.
|
||||
AC_ARG_VAR([LUA_INCLUDE], [The Lua includes, e.g. -I/usr/include/lua5.1])
|
||||
|
||||
dnl Some default directories to search.
|
||||
LUA_SHORT_VERSION=`echo "$LUA_VERSION" | $SED 's|\.||'`
|
||||
m4_define_default([_AX_LUA_INCLUDE_LIST],
|
||||
[ /usr/include/lua$LUA_VERSION \
|
||||
/usr/include/lua-$LUA_VERSION \
|
||||
/usr/include/lua/$LUA_VERSION \
|
||||
/usr/include/lua$LUA_SHORT_VERSION \
|
||||
/usr/local/include/lua$LUA_VERSION \
|
||||
/usr/local/include/lua-$LUA_VERSION \
|
||||
/usr/local/include/lua/$LUA_VERSION \
|
||||
/usr/local/include/lua$LUA_SHORT_VERSION \
|
||||
])
|
||||
|
||||
dnl Try to find the headers.
|
||||
_ax_lua_saved_cppflags=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
|
||||
AC_CHECK_HEADERS([lua.h lualib.h lauxlib.h luaconf.h])
|
||||
CPPFLAGS=$_ax_lua_saved_cppflags
|
||||
|
||||
dnl Try some other directories if LUA_INCLUDE was not set.
|
||||
AS_IF([test "x$LUA_INCLUDE" = 'x' &&
|
||||
test "x$ac_cv_header_lua_h" != 'xyes'],
|
||||
[ dnl Try some common include paths.
|
||||
for _ax_include_path in _AX_LUA_INCLUDE_LIST; do
|
||||
test ! -d "$_ax_include_path" && continue
|
||||
|
||||
AC_MSG_CHECKING([for Lua headers in])
|
||||
AC_MSG_RESULT([$_ax_include_path])
|
||||
|
||||
AS_UNSET([ac_cv_header_lua_h])
|
||||
AS_UNSET([ac_cv_header_lualib_h])
|
||||
AS_UNSET([ac_cv_header_lauxlib_h])
|
||||
AS_UNSET([ac_cv_header_luaconf_h])
|
||||
|
||||
_ax_lua_saved_cppflags=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS -I$_ax_include_path"
|
||||
AC_CHECK_HEADERS([lua.h lualib.h lauxlib.h luaconf.h])
|
||||
CPPFLAGS=$_ax_lua_saved_cppflags
|
||||
|
||||
AS_IF([test "x$ac_cv_header_lua_h" = 'xyes'],
|
||||
[ LUA_INCLUDE="-I$_ax_include_path"
|
||||
break
|
||||
])
|
||||
done
|
||||
])
|
||||
|
||||
AS_IF([test "x$ac_cv_header_lua_h" = 'xyes'],
|
||||
[ dnl Make a program to print LUA_VERSION defined in the header.
|
||||
dnl TODO It would be really nice if we could do this without compiling a
|
||||
dnl program, then it would work when cross compiling. But I'm not sure how
|
||||
dnl to do this reliably. For now, assume versions match when cross compiling.
|
||||
|
||||
AS_IF([test "x$cross_compiling" != 'xyes'],
|
||||
[ AC_CACHE_CHECK([for Lua header version],
|
||||
[ax_cv_lua_header_version],
|
||||
[ _ax_lua_saved_cppflags=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
|
||||
AC_RUN_IFELSE(
|
||||
[ AC_LANG_SOURCE([[
|
||||
#include <lua.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
if(argc > 1) printf("%s", LUA_VERSION);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
]])
|
||||
],
|
||||
[ ax_cv_lua_header_version=`./conftest$EXEEXT p | \
|
||||
$SED -n "s|^Lua \(@<:@0-9@:>@\{1,\}\.@<:@0-9@:>@\{1,\}\).\{0,\}|\1|p"`
|
||||
],
|
||||
[ax_cv_lua_header_version='unknown'])
|
||||
CPPFLAGS=$_ax_lua_saved_cppflags
|
||||
])
|
||||
|
||||
dnl Compare this to the previously found LUA_VERSION.
|
||||
AC_MSG_CHECKING([if Lua header version matches $LUA_VERSION])
|
||||
AS_IF([test "x$ax_cv_lua_header_version" = "x$LUA_VERSION"],
|
||||
[ AC_MSG_RESULT([yes])
|
||||
ax_header_version_match='yes'
|
||||
],
|
||||
[ AC_MSG_RESULT([no])
|
||||
ax_header_version_match='no'
|
||||
])
|
||||
],
|
||||
[ AC_MSG_WARN([cross compiling so assuming header version number matches])
|
||||
ax_header_version_match='yes'
|
||||
])
|
||||
])
|
||||
|
||||
dnl Was LUA_INCLUDE specified?
|
||||
AS_IF([test "x$ax_header_version_match" != 'xyes' &&
|
||||
test "x$LUA_INCLUDE" != 'x'],
|
||||
[AC_MSG_ERROR([cannot find headers for specified LUA_INCLUDE])])
|
||||
|
||||
dnl Test the final result and run user code.
|
||||
AS_IF([test "x$ax_header_version_match" = 'xyes'], [$1],
|
||||
[m4_default([$2], [AC_MSG_ERROR([cannot find Lua includes])])])
|
||||
])
|
||||
|
||||
dnl AX_LUA_HEADERS_VERSION no longer exists, use AX_LUA_HEADERS.
|
||||
AC_DEFUN([AX_LUA_HEADERS_VERSION],
|
||||
[
|
||||
AC_MSG_WARN([[$0 is deprecated, please use AX_LUA_HEADERS instead]])
|
||||
])
|
||||
|
||||
|
||||
dnl =========================================================================
|
||||
dnl AX_LUA_LIBS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([AX_LUA_LIBS],
|
||||
[
|
||||
dnl TODO Should this macro also check various -L flags?
|
||||
|
||||
dnl Check for LUA_VERSION.
|
||||
AC_MSG_CHECKING([if LUA_VERSION is defined])
|
||||
AS_IF([test "x$LUA_VERSION" != 'x'],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([cannot check Lua libs without knowing LUA_VERSION])
|
||||
])
|
||||
|
||||
dnl Make LUA_LIB a precious variable.
|
||||
AC_ARG_VAR([LUA_LIB], [The Lua library, e.g. -llua5.1])
|
||||
|
||||
AS_IF([test "x$LUA_LIB" != 'x'],
|
||||
[ dnl Check that LUA_LIBS works.
|
||||
_ax_lua_saved_libs=$LIBS
|
||||
LIBS="$LIBS $LUA_LIB"
|
||||
AC_SEARCH_LIBS([lua_load], [],
|
||||
[_ax_found_lua_libs='yes'],
|
||||
[_ax_found_lua_libs='no'])
|
||||
LIBS=$_ax_lua_saved_libs
|
||||
|
||||
dnl Check the result.
|
||||
AS_IF([test "x$_ax_found_lua_libs" != 'xyes'],
|
||||
[AC_MSG_ERROR([cannot find libs for specified LUA_LIB])])
|
||||
],
|
||||
[ dnl First search for extra libs.
|
||||
_ax_lua_extra_libs=''
|
||||
|
||||
_ax_lua_saved_libs=$LIBS
|
||||
LIBS="$LIBS $LUA_LIB"
|
||||
AC_SEARCH_LIBS([exp], [m])
|
||||
AC_SEARCH_LIBS([dlopen], [dl])
|
||||
LIBS=$_ax_lua_saved_libs
|
||||
|
||||
AS_IF([test "x$ac_cv_search_exp" != 'xno' &&
|
||||
test "x$ac_cv_search_exp" != 'xnone required'],
|
||||
[_ax_lua_extra_libs="$_ax_lua_extra_libs $ac_cv_search_exp"])
|
||||
|
||||
AS_IF([test "x$ac_cv_search_dlopen" != 'xno' &&
|
||||
test "x$ac_cv_search_dlopen" != 'xnone required'],
|
||||
[_ax_lua_extra_libs="$_ax_lua_extra_libs $ac_cv_search_dlopen"])
|
||||
|
||||
dnl Try to find the Lua libs.
|
||||
_ax_lua_saved_libs=$LIBS
|
||||
LIBS="$LIBS $LUA_LIB"
|
||||
AC_SEARCH_LIBS([lua_load],
|
||||
[ lua$LUA_VERSION \
|
||||
lua$LUA_SHORT_VERSION \
|
||||
lua-$LUA_VERSION \
|
||||
lua-$LUA_SHORT_VERSION \
|
||||
lua \
|
||||
],
|
||||
[_ax_found_lua_libs='yes'],
|
||||
[_ax_found_lua_libs='no'],
|
||||
[$_ax_lua_extra_libs])
|
||||
LIBS=$_ax_lua_saved_libs
|
||||
|
||||
AS_IF([test "x$ac_cv_search_lua_load" != 'xno' &&
|
||||
test "x$ac_cv_search_lua_load" != 'xnone required'],
|
||||
[LUA_LIB="$ac_cv_search_lua_load $_ax_lua_extra_libs"])
|
||||
])
|
||||
|
||||
dnl Test the result and run user code.
|
||||
AS_IF([test "x$_ax_found_lua_libs" = 'xyes'], [$1],
|
||||
[m4_default([$2], [AC_MSG_ERROR([cannot find Lua libs])])])
|
||||
])
|
||||
|
||||
|
||||
dnl =========================================================================
|
||||
dnl AX_LUA_READLINE([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
dnl =========================================================================
|
||||
AC_DEFUN([AX_LUA_READLINE],
|
||||
[
|
||||
AX_LIB_READLINE
|
||||
AS_IF([test "x$ac_cv_header_readline_readline_h" != 'x' &&
|
||||
test "x$ac_cv_header_readline_history_h" != 'x'],
|
||||
[ LUA_LIBS_CFLAGS="-DLUA_USE_READLINE $LUA_LIBS_CFLAGS"
|
||||
$1
|
||||
],
|
||||
[$2])
|
||||
])
|
61
vendor/git.apache.org/thrift.git/aclocal/ax_prog_dotnetcore_version.m4
generated
vendored
61
vendor/git.apache.org/thrift.git/aclocal/ax_prog_dotnetcore_version.m4
generated
vendored
|
@ -1,61 +0,0 @@
|
|||
# ===============================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_prog_dotnetcore_version.html
|
||||
# ===============================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PROG_DOTNETCORE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Makes sure that .NET Core supports the version indicated. If true the
|
||||
# shell commands in ACTION-IF-TRUE are executed. If not the shell commands
|
||||
# in ACTION-IF-FALSE are run. The $dotnetcore_version variable will be
|
||||
# filled with the detected version.
|
||||
#
|
||||
# This macro uses the $DOTNETCORE variable to perform the check. If
|
||||
# $DOTNETCORE is not set prior to calling this macro, the macro will fail.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# AC_PATH_PROG([DOTNETCORE],[dotnet])
|
||||
# AC_PROG_DOTNETCORE_VERSION([1.0.2],[ ... ],[ ... ])
|
||||
#
|
||||
# Searches for .NET Core, then checks if at least version 1.0.2 is
|
||||
# present.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2016 Jens Geyer <jensg@apache.org>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN([AX_PROG_DOTNETCORE_VERSION],[
|
||||
AC_REQUIRE([AC_PROG_SED])
|
||||
|
||||
AS_IF([test -n "$DOTNETCORE"],[
|
||||
ax_dotnetcore_version="$1"
|
||||
|
||||
AC_MSG_CHECKING([for .NET Core version])
|
||||
dotnetcore_version=`$DOTNETCORE --version 2>&1 | $SED -e 's/\(@<:@0-9@:>@*\.@<:@0-9@:>@*\.@<:@0-9@:>@*\)\(.*\)/\1/'`
|
||||
AC_MSG_RESULT($dotnetcore_version)
|
||||
|
||||
AC_SUBST([DOTNETCORE_VERSION],[$dotnetcore_version])
|
||||
|
||||
AX_COMPARE_VERSION([$ax_dotnetcore_version],[le],[$dotnetcore_version],[
|
||||
:
|
||||
$2
|
||||
],[
|
||||
:
|
||||
$3
|
||||
])
|
||||
],[
|
||||
AC_MSG_WARN([could not find .NET Core])
|
||||
$3
|
||||
])
|
||||
])
|
60
vendor/git.apache.org/thrift.git/aclocal/ax_prog_haxe_version.m4
generated
vendored
60
vendor/git.apache.org/thrift.git/aclocal/ax_prog_haxe_version.m4
generated
vendored
|
@ -1,60 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_prog_haxe_version.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PROG_HAXE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Makes sure that haxe supports the version indicated. If true the shell
|
||||
# commands in ACTION-IF-TRUE are executed. If not the shell commands in
|
||||
# ACTION-IF-FALSE are run. The $HAXE_VERSION variable will be filled with
|
||||
# the detected version.
|
||||
#
|
||||
# This macro uses the $HAXE variable to perform the check. If $HAXE is not
|
||||
# set prior to calling this macro, the macro will fail.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# AC_PATH_PROG([HAXE],[haxe])
|
||||
# AC_PROG_HAXE_VERSION([3.1.3],[ ... ],[ ... ])
|
||||
#
|
||||
# Searches for Haxe, then checks if at least version 3.1.3 is present.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2015 Jens Geyer <jensg@apache.org>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN([AX_PROG_HAXE_VERSION],[
|
||||
AC_REQUIRE([AC_PROG_SED])
|
||||
|
||||
AS_IF([test -n "$HAXE"],[
|
||||
ax_haxe_version="$1"
|
||||
|
||||
AC_MSG_CHECKING([for haxe version])
|
||||
haxe_version=`$HAXE -version 2>&1 | $SED -e 's/^.* \( @<:@0-9@:>@*\.@<:@0-9@:>@*\.@<:@0-9@:>@*\) .*/\1/'`
|
||||
AC_MSG_RESULT($haxe_version)
|
||||
|
||||
AC_SUBST([HAXE_VERSION],[$haxe_version])
|
||||
|
||||
AX_COMPARE_VERSION([$ax_haxe_version],[le],[$haxe_version],[
|
||||
:
|
||||
$2
|
||||
],[
|
||||
:
|
||||
$3
|
||||
])
|
||||
],[
|
||||
AC_MSG_WARN([could not find Haxe])
|
||||
$3
|
||||
])
|
||||
])
|
77
vendor/git.apache.org/thrift.git/aclocal/ax_prog_perl_modules.m4
generated
vendored
77
vendor/git.apache.org/thrift.git/aclocal/ax_prog_perl_modules.m4
generated
vendored
|
@ -1,77 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Checks to see if the given perl modules are available. If true the shell
|
||||
# commands in ACTION-IF-TRUE are executed. If not the shell commands in
|
||||
# ACTION-IF-FALSE are run. Note if $PERL is not set (for example by
|
||||
# calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl)
|
||||
# will be run.
|
||||
#
|
||||
# MODULES is a space separated list of module names. To check for a
|
||||
# minimum version of a module, append the version number to the module
|
||||
# name, separated by an equals sign.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# AX_PROG_PERL_MODULES( Text::Wrap Net::LDAP=1.0.3, ,
|
||||
# AC_MSG_WARN(Need some Perl modules)
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Dean Povey <povey@wedgetail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 8
|
||||
|
||||
AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES])
|
||||
AC_DEFUN([AX_PROG_PERL_MODULES],[dnl
|
||||
|
||||
m4_define([ax_perl_modules])
|
||||
m4_foreach([ax_perl_module], m4_split(m4_normalize([$1])),
|
||||
[
|
||||
m4_append([ax_perl_modules],
|
||||
[']m4_bpatsubst(ax_perl_module,=,[ ])[' ])
|
||||
])
|
||||
|
||||
# Make sure we have perl
|
||||
if test -z "$PERL"; then
|
||||
AC_CHECK_PROG(PERL,perl,perl)
|
||||
fi
|
||||
|
||||
if test "x$PERL" != x; then
|
||||
ax_perl_modules_failed=0
|
||||
for ax_perl_module in ax_perl_modules; do
|
||||
AC_MSG_CHECKING(for perl module $ax_perl_module)
|
||||
|
||||
# Would be nice to log result here, but can't rely on autoconf internals
|
||||
$PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT(no);
|
||||
ax_perl_modules_failed=1
|
||||
else
|
||||
AC_MSG_RESULT(ok);
|
||||
fi
|
||||
done
|
||||
|
||||
# Run optional shell commands
|
||||
if test "$ax_perl_modules_failed" = 0; then
|
||||
:
|
||||
$2
|
||||
else
|
||||
:
|
||||
$3
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN(could not find perl)
|
||||
fi])dnl
|
127
vendor/git.apache.org/thrift.git/aclocal/ax_signed_right_shift.m4
generated
vendored
127
vendor/git.apache.org/thrift.git/aclocal/ax_signed_right_shift.m4
generated
vendored
|
@ -1,127 +0,0 @@
|
|||
dnl @synopsis AX_SIGNED_RIGHT_SHIFT
|
||||
dnl
|
||||
dnl Tests the behavior of a right shift on a negative signed int.
|
||||
dnl
|
||||
dnl This macro calls:
|
||||
dnl AC_DEFINE(SIGNED_RIGHT_SHIFT_IS)
|
||||
dnl AC_DEFINE(ARITHMETIC_RIGHT_SHIFT)
|
||||
dnl AC_DEFINE(LOGICAL_RIGHT_SHIFT)
|
||||
dnl AC_DEFINE(UNKNOWN_RIGHT_SHIFT)
|
||||
dnl
|
||||
dnl SIGNED_RIGHT_SHIFT_IS will be equal to one of the other macros.
|
||||
dnl It also leaves the shell variables "ax_signed_right_shift"
|
||||
dnl set to "arithmetic", "logical", or "unknown".
|
||||
dnl
|
||||
dnl NOTE: This macro does not work for cross-compiling.
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @version 2009-03-25
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl Copyright (C) 2009 David Reiss
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
|
||||
AC_DEFUN([AX_SIGNED_RIGHT_SHIFT],
|
||||
[
|
||||
|
||||
AC_MSG_CHECKING(the behavior of a signed right shift)
|
||||
|
||||
success_arithmetic=no
|
||||
AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
return
|
||||
/* 0xffffffff */
|
||||
-1 >> 1 != -1 ||
|
||||
-1 >> 2 != -1 ||
|
||||
-1 >> 3 != -1 ||
|
||||
-1 >> 4 != -1 ||
|
||||
-1 >> 8 != -1 ||
|
||||
-1 >> 16 != -1 ||
|
||||
-1 >> 24 != -1 ||
|
||||
-1 >> 31 != -1 ||
|
||||
/* 0x80000000 */
|
||||
(-2147483647 - 1) >> 1 != -1073741824 ||
|
||||
(-2147483647 - 1) >> 2 != -536870912 ||
|
||||
(-2147483647 - 1) >> 3 != -268435456 ||
|
||||
(-2147483647 - 1) >> 4 != -134217728 ||
|
||||
(-2147483647 - 1) >> 8 != -8388608 ||
|
||||
(-2147483647 - 1) >> 16 != -32768 ||
|
||||
(-2147483647 - 1) >> 24 != -128 ||
|
||||
(-2147483647 - 1) >> 31 != -1 ||
|
||||
/* 0x90800000 */
|
||||
-1870659584 >> 1 != -935329792 ||
|
||||
-1870659584 >> 2 != -467664896 ||
|
||||
-1870659584 >> 3 != -233832448 ||
|
||||
-1870659584 >> 4 != -116916224 ||
|
||||
-1870659584 >> 8 != -7307264 ||
|
||||
-1870659584 >> 16 != -28544 ||
|
||||
-1870659584 >> 24 != -112 ||
|
||||
-1870659584 >> 31 != -1 ||
|
||||
0;
|
||||
]])], [
|
||||
success_arithmetic=yes
|
||||
])
|
||||
|
||||
|
||||
success_logical=no
|
||||
AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
return
|
||||
/* 0xffffffff */
|
||||
-1 >> 1 != (signed)((unsigned)-1 >> 1) ||
|
||||
-1 >> 2 != (signed)((unsigned)-1 >> 2) ||
|
||||
-1 >> 3 != (signed)((unsigned)-1 >> 3) ||
|
||||
-1 >> 4 != (signed)((unsigned)-1 >> 4) ||
|
||||
-1 >> 8 != (signed)((unsigned)-1 >> 8) ||
|
||||
-1 >> 16 != (signed)((unsigned)-1 >> 16) ||
|
||||
-1 >> 24 != (signed)((unsigned)-1 >> 24) ||
|
||||
-1 >> 31 != (signed)((unsigned)-1 >> 31) ||
|
||||
/* 0x80000000 */
|
||||
(-2147483647 - 1) >> 1 != (signed)((unsigned)(-2147483647 - 1) >> 1) ||
|
||||
(-2147483647 - 1) >> 2 != (signed)((unsigned)(-2147483647 - 1) >> 2) ||
|
||||
(-2147483647 - 1) >> 3 != (signed)((unsigned)(-2147483647 - 1) >> 3) ||
|
||||
(-2147483647 - 1) >> 4 != (signed)((unsigned)(-2147483647 - 1) >> 4) ||
|
||||
(-2147483647 - 1) >> 8 != (signed)((unsigned)(-2147483647 - 1) >> 8) ||
|
||||
(-2147483647 - 1) >> 16 != (signed)((unsigned)(-2147483647 - 1) >> 16) ||
|
||||
(-2147483647 - 1) >> 24 != (signed)((unsigned)(-2147483647 - 1) >> 24) ||
|
||||
(-2147483647 - 1) >> 31 != (signed)((unsigned)(-2147483647 - 1) >> 31) ||
|
||||
/* 0x90800000 */
|
||||
-1870659584 >> 1 != (signed)((unsigned)-1870659584 >> 1) ||
|
||||
-1870659584 >> 2 != (signed)((unsigned)-1870659584 >> 2) ||
|
||||
-1870659584 >> 3 != (signed)((unsigned)-1870659584 >> 3) ||
|
||||
-1870659584 >> 4 != (signed)((unsigned)-1870659584 >> 4) ||
|
||||
-1870659584 >> 8 != (signed)((unsigned)-1870659584 >> 8) ||
|
||||
-1870659584 >> 16 != (signed)((unsigned)-1870659584 >> 16) ||
|
||||
-1870659584 >> 24 != (signed)((unsigned)-1870659584 >> 24) ||
|
||||
-1870659584 >> 31 != (signed)((unsigned)-1870659584 >> 31) ||
|
||||
0;
|
||||
]])], [
|
||||
success_logical=yes
|
||||
])
|
||||
|
||||
|
||||
AC_DEFINE([ARITHMETIC_RIGHT_SHIFT], 1, [Possible value for SIGNED_RIGHT_SHIFT_IS])
|
||||
AC_DEFINE([LOGICAL_RIGHT_SHIFT], 2, [Possible value for SIGNED_RIGHT_SHIFT_IS])
|
||||
AC_DEFINE([UNKNOWN_RIGHT_SHIFT], 3, [Possible value for SIGNED_RIGHT_SHIFT_IS])
|
||||
|
||||
if test "$success_arithmetic" = "yes" && test "$success_logical" = "yes" ; then
|
||||
AC_MSG_ERROR("Right shift appears to be both arithmetic and logical!")
|
||||
elif test "$success_arithmetic" = "yes" ; then
|
||||
ax_signed_right_shift=arithmetic
|
||||
AC_DEFINE([SIGNED_RIGHT_SHIFT_IS], 1,
|
||||
[Indicates the effect of the right shift operator
|
||||
on negative signed integers])
|
||||
elif test "$success_logical" = "yes" ; then
|
||||
ax_signed_right_shift=logical
|
||||
AC_DEFINE([SIGNED_RIGHT_SHIFT_IS], 2,
|
||||
[Indicates the effect of the right shift operator
|
||||
on negative signed integers])
|
||||
else
|
||||
ax_signed_right_shift=unknown
|
||||
AC_DEFINE([SIGNED_RIGHT_SHIFT_IS], 3,
|
||||
[Indicates the effect of the right shift operator
|
||||
on negative signed integers])
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($ax_signed_right_shift)
|
||||
])
|
28
vendor/git.apache.org/thrift.git/aclocal/ax_thrift_internal.m4
generated
vendored
28
vendor/git.apache.org/thrift.git/aclocal/ax_thrift_internal.m4
generated
vendored
|
@ -1,28 +0,0 @@
|
|||
dnl @synopsis AX_THRIFT_GEN(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
|
||||
dnl @synopsis AX_THRIFT_LIB(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
|
||||
dnl
|
||||
dnl Allow a particular language generator to be disabled.
|
||||
dnl Allow a particular language library to be disabled.
|
||||
dnl
|
||||
dnl These macros have poor error handling and are poorly documented.
|
||||
dnl They are intended only for internal use by the Thrift compiler.
|
||||
dnl
|
||||
dnl @version 2008-02-20
|
||||
dnl @license AllPermissive
|
||||
dnl
|
||||
dnl Copyright (C) 2009 David Reiss
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
|
||||
AC_DEFUN([AX_THRIFT_LIB],
|
||||
[
|
||||
AC_ARG_WITH($1,
|
||||
AC_HELP_STRING([--with-$1], [build the $2 library @<:@default=$3@:>@]),
|
||||
[with_$1="$withval"],
|
||||
[with_$1=$3]
|
||||
)
|
||||
have_$1=no
|
||||
dnl What we do here is going to vary from library to library,
|
||||
dnl so we can't really generalize (yet!).
|
||||
])
|
110
vendor/git.apache.org/thrift.git/appveyor.yml
generated
vendored
110
vendor/git.apache.org/thrift.git/appveyor.yml
generated
vendored
|
@ -1,110 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# build Apache Thrift on AppVeyor - https://ci.appveyor.com
|
||||
|
||||
version: '0.12.0.{build}'
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
os:
|
||||
- Visual Studio 2017
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- PROFILE: CYGWIN
|
||||
fast_finish: true
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- PROFILE: MSVC2017
|
||||
PLATFORM: x64
|
||||
CONFIGURATION: Release
|
||||
BOOST_VERSION: 1.65.1
|
||||
LIBEVENT_VERSION: 2.1.8
|
||||
PYTHON_VERSION: 3.6
|
||||
QT_VERSION: 5.10
|
||||
ZLIB_VERSION: 1.2.11
|
||||
DISABLED_TESTS: StressTestNonBlocking
|
||||
|
||||
- PROFILE: MSVC2013
|
||||
PLATFORM: x86
|
||||
CONFIGURATION: Release
|
||||
BOOST_VERSION: 1.58.0
|
||||
LIBEVENT_VERSION: 2.0.22
|
||||
PYTHON_VERSION: 3.5
|
||||
QT_VERSION: 5.8
|
||||
ZLIB_VERSION: 1.2.8
|
||||
DISABLED_TESTS: StressTestNonBlocking
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
|
||||
- PROFILE: MINGW
|
||||
PLATFORM: x64
|
||||
CONFIGURATION: RelWithDebInfo
|
||||
DISABLED_TESTS: StressTestNonBlocking
|
||||
|
||||
- PROFILE: CYGWIN
|
||||
PLATFORM: x86
|
||||
CONFIGURATION: RelWithDebInfo
|
||||
DISABLED_TESTS: (ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest|StressTestNonBlocking)
|
||||
|
||||
# - PROFILE: CYGWIN
|
||||
# PLATFORM: x64
|
||||
# CONFIGURATION: RelWithDebInfo
|
||||
# DISABLED_TESTS: (ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest|StressTestNonBlocking)
|
||||
|
||||
install:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- call build\appveyor\%PROFILE:~0,4%-appveyor-install.bat
|
||||
- refreshenv
|
||||
|
||||
build_script:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- call build\appveyor\%PROFILE:~0,4%-appveyor-build.bat
|
||||
|
||||
test_script:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- call build\appveyor\%PROFILE:~0,4%-appveyor-test.bat
|
||||
|
||||
|
||||
# artifact capture disabled as it might increase service cost for little gain:
|
||||
#
|
||||
# artifacts:
|
||||
# - path: local-thrift-inst
|
||||
# name: cmake installed content
|
||||
# type: zip
|
||||
#
|
||||
# - path: local-thrift-build\Testing
|
||||
# name: ctest output
|
||||
# type: zip
|
||||
|
||||
# RDP support: use one or the other...
|
||||
#
|
||||
# enables RDP for each build job so you can inspect the environment at the beginning of the job:
|
||||
# init:
|
||||
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
#
|
||||
# enables RDP at the end of the build job so you can login and re-run
|
||||
# commands to see why something failed...
|
||||
#on_finish:
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
#
|
||||
# also need:
|
||||
# environment:
|
||||
# APPVEYOR_RDP_PASSWORD: thr1FT2345$xyzZ
|
61
vendor/git.apache.org/thrift.git/bootstrap.sh
generated
vendored
61
vendor/git.apache.org/thrift.git/bootstrap.sh
generated
vendored
|
@ -1,61 +0,0 @@
|
|||
#!/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.
|
||||
#
|
||||
|
||||
./cleanup.sh
|
||||
if test -d lib/php/src/ext/thrift_protocol ; then
|
||||
if phpize -v >/dev/null 2>/dev/null ; then
|
||||
(cd lib/php/src/ext/thrift_protocol && phpize)
|
||||
fi
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# libtoolize is called "glibtoolize" on OSX.
|
||||
if libtoolize --version 1 >/dev/null 2>/dev/null; then
|
||||
LIBTOOLIZE=libtoolize
|
||||
elif glibtoolize --version 1 >/dev/null 2>/dev/null; then
|
||||
LIBTOOLIZE=glibtoolize
|
||||
else
|
||||
echo >&2 "Couldn't find libtoolize!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
format_version () {
|
||||
printf "%03d%03d%03d%03d" $(echo $1 | tr '.' ' ');
|
||||
}
|
||||
|
||||
# we require automake 1.13 or later
|
||||
# check must happen externally due to use of newer macro
|
||||
AUTOMAKE_VERSION=`automake --version | grep automake | egrep -o '([0-9]{1,}\.)+[0-9]{1,}'`
|
||||
if [ $(format_version $AUTOMAKE_VERSION) -lt $(format_version 1.13) ]; then
|
||||
echo >&2 "automake version $AUTOMAKE_VERSION is too old (need 1.13 or later)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
autoscan
|
||||
$LIBTOOLIZE --copy --automake
|
||||
aclocal -I ./aclocal
|
||||
autoheader
|
||||
sed '/undef VERSION/d' config.hin > config.hin2
|
||||
mv config.hin2 config.hin
|
||||
autoconf
|
||||
automake --copy --add-missing --foreign
|
16
vendor/git.apache.org/thrift.git/bower.json
generated
vendored
16
vendor/git.apache.org/thrift.git/bower.json
generated
vendored
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"name": "thrift",
|
||||
"version": "0.12.0",
|
||||
"homepage": "https://git-wip-us.apache.org/repos/asf/thrift.git",
|
||||
"authors": [
|
||||
"Apache Thrift <dev@thrift.apache.org>"
|
||||
],
|
||||
"description": "Apache Thrift",
|
||||
"main": "lib/js/src/thrift.js",
|
||||
"keywords": [
|
||||
"thrift"
|
||||
],
|
||||
"license": "Apache v2",
|
||||
"ignore": [
|
||||
]
|
||||
}
|
68
vendor/git.apache.org/thrift.git/build/cmake/CPackConfig.cmake
generated
vendored
68
vendor/git.apache.org/thrift.git/build/cmake/CPackConfig.cmake
generated
vendored
|
@ -1,68 +0,0 @@
|
|||
#
|
||||
# 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 "thrift")
|
||||
set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Thrift")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_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)
|
79
vendor/git.apache.org/thrift.git/build/cmake/ConfigureChecks.cmake
generated
vendored
79
vendor/git.apache.org/thrift.git/build/cmake/ConfigureChecks.cmake
generated
vendored
|
@ -1,79 +0,0 @@
|
|||
#
|
||||
# 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(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if (Inttypes_FOUND)
|
||||
# This allows the inttypes.h and stdint.h checks to succeed on platforms that
|
||||
# do not natively provide there.
|
||||
set (CMAKE_REQUIRED_INCLUDES ${INTTYPES_INCLUDE_DIRS})
|
||||
endif ()
|
||||
|
||||
check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
|
||||
check_include_file(fcntl.h HAVE_FCNTL_H)
|
||||
check_include_file(getopt.h HAVE_GETOPT_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(signal.h HAVE_SIGNAL_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/ioctl.h HAVE_SYS_IOCTL_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/time.h HAVE_SYS_TIME_H)
|
||||
check_include_file(sys/un.h HAVE_SYS_UN_H)
|
||||
check_include_file(poll.h HAVE_POLL_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(string.h HAVE_STRING_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}/build/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
|
||||
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
93
vendor/git.apache.org/thrift.git/build/cmake/DefineCMakeDefaults.cmake
generated
vendored
93
vendor/git.apache.org/thrift.git/build/cmake/DefineCMakeDefaults.cmake
generated
vendored
|
@ -1,93 +0,0 @@
|
|||
#
|
||||
# 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 preferred 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.12.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)
|
||||
|
||||
#
|
||||
# "rpath" support.
|
||||
# See http://www.itk.org/Wiki/index.php?title=CMake_RPATH_handling
|
||||
#
|
||||
# On MacOSX, for shared libraries, enable rpath support.
|
||||
set(CMAKE_MACOSX_RPATH TRUE)
|
||||
#
|
||||
# On any OS, for executables, allow linking with shared libraries in non-system
|
||||
# locations and running the executables without LD_PRELOAD or similar.
|
||||
# This requires the library to be built with rpath support.
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
#
|
||||
# C++ Language Level Defaults - this depends on the compiler capabilities
|
||||
#
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
if (MSVC AND MSVC_VERSION LESS 1800)
|
||||
# MSVC 2012 and earlier don't support template aliases so you have to use C++98
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
message(STATUS "Setting C++98 as the default language level (for an older MSVC compiler).")
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11) # C++11
|
||||
message(STATUS "Setting C++11 as the default language level.")
|
||||
endif()
|
||||
message(STATUS "To specify a different C++ language level, set CMAKE_CXX_STANDARD")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED OFF) # can degrade to C++98 if compiler does not support C++11
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF) # use standards compliant language level for portability
|
||||
endif()
|
26
vendor/git.apache.org/thrift.git/build/cmake/DefineInstallationPaths.cmake
generated
vendored
26
vendor/git.apache.org/thrift.git/build/cmake/DefineInstallationPaths.cmake
generated
vendored
|
@ -1,26 +0,0 @@
|
|||
#
|
||||
# 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)")
|
219
vendor/git.apache.org/thrift.git/build/cmake/DefineOptions.cmake
generated
vendored
219
vendor/git.apache.org/thrift.git/build/cmake/DefineOptions.cmake
generated
vendored
|
@ -1,219 +0,0 @@
|
|||
#
|
||||
# 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)
|
||||
|
||||
set(THRIFT_COMPILER "" CACHE FILEPATH "External Thrift compiler to use during build")
|
||||
|
||||
# Additional components
|
||||
option(BUILD_COMPILER "Build Thrift compiler" ON)
|
||||
|
||||
if(BUILD_COMPILER OR EXISTS ${THRIFT_COMPILER})
|
||||
set(HAVE_COMPILER ON)
|
||||
endif()
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_TESTING "Build with unit tests" ON "HAVE_COMPILER" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_EXAMPLES "Build examples" ON "HAVE_COMPILER" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_TUTORIALS "Build Thrift tutorials" ON "HAVE_COMPILER" OFF)
|
||||
option(BUILD_LIBRARIES "Build Thrift 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.
|
||||
|
||||
option(WITH_BOOST_FUNCTIONAL "Use boost/tr1/functional.hpp even under C++11 or later" OFF)
|
||||
if (WITH_BOOST_FUNCTIONAL)
|
||||
add_definitions(-DFORCE_BOOST_FUNCTIONAL)
|
||||
endif()
|
||||
|
||||
option(WITH_BOOST_SMART_PTR "Use boost/smart_ptr.hpp even under C++11 or later" OFF)
|
||||
if (WITH_BOOST_SMART_PTR)
|
||||
add_definitions(-DFORCE_BOOST_SMART_PTR)
|
||||
endif()
|
||||
|
||||
option(WITH_BOOST_STATIC "Build with Boost static link library" OFF)
|
||||
set(Boost_USE_STATIC_LIBS ${WITH_BOOST_STATIC})
|
||||
if (NOT WITH_BOOST_STATIC)
|
||||
add_definitions(-DBOOST_ALL_DYN_LINK)
|
||||
add_definitions(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
|
||||
# C++
|
||||
option(WITH_CPP "Build C++ Thrift library" ON)
|
||||
if(WITH_CPP)
|
||||
find_package(Boost 1.53 QUIET)
|
||||
# NOTE: Currently the following options are C++ specific,
|
||||
# but in future other libraries might reuse them.
|
||||
# So they are not dependent on WITH_CPP but setting them without WITH_CPP currently
|
||||
# has no effect.
|
||||
if(ZLIB_LIBRARY)
|
||||
# FindZLIB.cmake does not normalize path so we need to do it ourselves.
|
||||
file(TO_CMAKE_PATH ${ZLIB_LIBRARY} ZLIB_LIBRARY)
|
||||
endif()
|
||||
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_STDTHREADS "Build with C++ std::thread support" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(WITH_BOOSTTHREADS "Build with Boost threads support" OFF
|
||||
"NOT WITH_STDTHREADS;Boost_FOUND" OFF)
|
||||
endif()
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_CPP "Build C++ library" ON
|
||||
"BUILD_LIBRARIES;WITH_CPP;Boost_FOUND" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(WITH_PLUGIN "Build compiler plugin support" OFF
|
||||
"BUILD_COMPILER;BUILD_CPP" OFF)
|
||||
|
||||
# C GLib
|
||||
option(WITH_C_GLIB "Build C (GLib) Thrift library" ON)
|
||||
if(WITH_C_GLIB)
|
||||
find_package(GLIB QUIET COMPONENTS gobject)
|
||||
endif()
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON
|
||||
"BUILD_LIBRARIES;WITH_C_GLIB;GLIB_FOUND" OFF)
|
||||
|
||||
if(BUILD_CPP)
|
||||
set(boost_components)
|
||||
if(WITH_BOOSTTHREADS OR BUILD_TESTING)
|
||||
list(APPEND boost_components system thread)
|
||||
endif()
|
||||
if(BUILD_TESTING)
|
||||
list(APPEND boost_components unit_test_framework filesystem chrono program_options)
|
||||
endif()
|
||||
if(boost_components)
|
||||
find_package(Boost 1.53 REQUIRED COMPONENTS ${boost_components})
|
||||
endif()
|
||||
elseif(BUILD_C_GLIB AND BUILD_TESTING)
|
||||
find_package(Boost 1.53 REQUIRED)
|
||||
endif()
|
||||
|
||||
# Java
|
||||
option(WITH_JAVA "Build Java Thrift library" ON)
|
||||
if(ANDROID)
|
||||
find_package(Gradle QUIET)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_JAVA "Build Java library" ON
|
||||
"BUILD_LIBRARIES;WITH_JAVA;GRADLE_FOUND" OFF)
|
||||
else()
|
||||
find_package(Gradlew QUIET)
|
||||
find_package(Java QUIET)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_JAVA "Build Java library" ON
|
||||
"BUILD_LIBRARIES;WITH_JAVA;JAVA_FOUND;GRADLEW_FOUND" OFF)
|
||||
endif()
|
||||
|
||||
# Python
|
||||
option(WITH_PYTHON "Build Python Thrift library" ON)
|
||||
find_package(PythonInterp QUIET) # for Python executable
|
||||
find_package(PythonLibs QUIET) # for Python.h
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_PYTHON "Build Python library" ON
|
||||
"BUILD_LIBRARIES;WITH_PYTHON;PYTHONLIBS_FOUND" OFF)
|
||||
|
||||
# Haskell
|
||||
option(WITH_HASKELL "Build Haskell Thrift library" ON)
|
||||
find_package(GHC QUIET)
|
||||
find_package(Cabal QUIET)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_HASKELL "Build GHC library" ON
|
||||
"BUILD_LIBRARIES;WITH_HASKELL;GHC_FOUND;CABAL_FOUND" OFF)
|
||||
|
||||
# Common library options
|
||||
option(WITH_SHARED_LIB "Build shared libraries" ON)
|
||||
option(WITH_STATIC_LIB "Build static libraries" ON)
|
||||
if (NOT WITH_SHARED_LIB AND NOT WITH_STATIC_LIB)
|
||||
message(FATAL_ERROR "Cannot build with both shared and static outputs disabled!")
|
||||
endif()
|
||||
|
||||
#NOTE: C++ compiler options are defined in the lib/cpp/CMakeLists.txt
|
||||
|
||||
# Visual Studio only options
|
||||
if(MSVC)
|
||||
option(WITH_MT "Build using MT instead of MD (MSVC only)" OFF)
|
||||
endif(MSVC)
|
||||
|
||||
macro(MESSAGE_DEP flag summary)
|
||||
if(NOT ${flag})
|
||||
message(STATUS " - ${summary}")
|
||||
endif()
|
||||
endmacro(MESSAGE_DEP flag summary)
|
||||
|
||||
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 compiler plugin support: ${WITH_PLUGIN}")
|
||||
message(STATUS " Build with unit tests: ${BUILD_TESTING}")
|
||||
MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
|
||||
message(STATUS " Build examples: ${BUILD_EXAMPLES}")
|
||||
MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
|
||||
message(STATUS " Build Thrift libraries: ${BUILD_LIBRARIES}")
|
||||
message(STATUS " Language libraries:")
|
||||
message(STATUS " Build C++ library: ${BUILD_CPP}")
|
||||
MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
|
||||
MESSAGE_DEP(Boost_FOUND "Boost headers missing")
|
||||
message(STATUS " C++ Language Level: ${CXX_LANGUAGE_LEVEL}")
|
||||
message(STATUS " Build C (GLib) library: ${BUILD_C_GLIB}")
|
||||
MESSAGE_DEP(WITH_C_GLIB "Disabled by WITH_C_GLIB=OFF")
|
||||
MESSAGE_DEP(GLIB_FOUND "GLib missing")
|
||||
message(STATUS " Build Java library: ${BUILD_JAVA}")
|
||||
MESSAGE_DEP(WITH_JAVA "Disabled by WITH_JAVA=OFF")
|
||||
if(ANDROID)
|
||||
MESSAGE_DEP(GRADLE_FOUND "Gradle missing")
|
||||
else()
|
||||
MESSAGE_DEP(JAVA_FOUND "Java Runtime missing")
|
||||
MESSAGE_DEP(GRADLEW_FOUND "Gradle Wrapper missing")
|
||||
endif()
|
||||
message(STATUS " Build Python library: ${BUILD_PYTHON}")
|
||||
MESSAGE_DEP(WITH_PYTHON "Disabled by WITH_PYTHON=OFF")
|
||||
MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
|
||||
message(STATUS " Build Haskell library: ${BUILD_HASKELL}")
|
||||
MESSAGE_DEP(WITH_HASKELL "Disabled by WITH_HASKELL=OFF")
|
||||
MESSAGE_DEP(GHC_FOUND "GHC missing")
|
||||
MESSAGE_DEP(CABAL_FOUND "Cabal missing")
|
||||
message(STATUS " Library features:")
|
||||
message(STATUS " Build shared libraries: ${WITH_SHARED_LIB}")
|
||||
message(STATUS " Build static libraries: ${WITH_STATIC_LIB}")
|
||||
message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}")
|
||||
message(STATUS " Build with Boost thread support: ${WITH_BOOSTTHREADS}")
|
||||
message(STATUS " Build with boost/tr1/functional (forced) ${WITH_BOOST_FUNCTIONAL}")
|
||||
message(STATUS " Build with boost/smart_ptr (forced) ${WITH_BOOST_SMART_PTR}")
|
||||
message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}")
|
||||
message(STATUS " Build with libevent support: ${WITH_LIBEVENT}")
|
||||
message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}")
|
||||
message(STATUS " Build with Qt4 support: ${WITH_QT4}")
|
||||
message(STATUS " Build with Qt5 support: ${WITH_QT5}")
|
||||
message(STATUS " Build with ZLIB support: ${WITH_ZLIB}")
|
||||
message(STATUS "----------------------------------------------------------")
|
||||
endmacro(PRINT_CONFIG_SUMMARY)
|
129
vendor/git.apache.org/thrift.git/build/cmake/DefinePlatformSpecifc.cmake
generated
vendored
129
vendor/git.apache.org/thrift.git/build/cmake/DefinePlatformSpecifc.cmake
generated
vendored
|
@ -1,129 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Uncomment this to show some basic cmake variables about platforms
|
||||
# include (NewPlatformDebug)
|
||||
|
||||
# Visual Studio specific options
|
||||
if(MSVC)
|
||||
#For visual studio the library naming is as following:
|
||||
# Dynamic libraries:
|
||||
# - thrift.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)
|
||||
set(CMAKE_RELWITHDEBINFO_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_CXX_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
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)
|
||||
|
||||
# Disable boost auto linking pragmas - cmake includes the right files
|
||||
add_definitions("-DBOOST_ALL_NO_LIB")
|
||||
|
||||
# Windows build does not know how to make a shared library yet
|
||||
# as there are no __declspec(dllexport) or exports files in the project.
|
||||
if (WITH_SHARED_LIB)
|
||||
message (FATAL_ERROR "Windows build does not support shared library output yet, please set -DWITH_SHARED_LIB=off")
|
||||
endif()
|
||||
|
||||
add_definitions("/MP") # parallel build
|
||||
add_definitions("/W3") # warning level 3
|
||||
|
||||
# VS2010 does not provide inttypes which we need for "PRId64" used in many places
|
||||
find_package(Inttypes)
|
||||
if (Inttypes_FOUND)
|
||||
include_directories(${INTTYPES_INCLUDE_DIRS})
|
||||
# OpenSSL conflicts with the definition of PRId64 unless it is defined first
|
||||
add_definitions("/FIinttypes.h")
|
||||
endif ()
|
||||
elseif(UNIX)
|
||||
find_program( MEMORYCHECK_COMMAND valgrind )
|
||||
set( MEMORYCHECK_COMMAND_OPTIONS "--gen-suppressions=all --leak-check=full" )
|
||||
set( MEMORYCHECK_SUPPRESSIONS_FILE "${PROJECT_SOURCE_DIR}/test/valgrind.suppress" )
|
||||
endif()
|
||||
|
||||
add_definitions("-D__STDC_FORMAT_MACROS")
|
||||
add_definitions("-D__STDC_LIMIT_MACROS")
|
||||
|
||||
# WITH_*THREADS selects which threading library to use
|
||||
if(WITH_BOOSTTHREADS)
|
||||
add_definitions("-DUSE_BOOST_THREAD=1")
|
||||
elseif(WITH_STDTHREADS)
|
||||
add_definitions("-DUSE_STD_THREAD=1")
|
||||
endif()
|
||||
|
||||
# C++ Language Level
|
||||
set(CXX_LANGUAGE_LEVEL "C++${CMAKE_CXX_STANDARD}")
|
||||
if (CMAKE_CXX_STANDARD_REQUIRED)
|
||||
string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [compiler must support it]")
|
||||
else()
|
||||
string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [fallback to earlier if compiler does not support it]")
|
||||
endif()
|
||||
if (CMAKE_CXX_EXTENSIONS)
|
||||
string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [with compiler-specific extensions]")
|
||||
else()
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros -Wno-long-long")
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-long-long")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
|
||||
endif()
|
||||
|
||||
# Building WITH_PLUGIN requires boost memory operations, for now, and gcc >= 4.8
|
||||
if (WITH_PLUGIN)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
|
||||
message(SEND_ERROR "Thrift compiler plug-in support is not possible with older gcc ( < 4.8 ) compiler")
|
||||
endif()
|
||||
message(STATUS "Forcing use of boost::smart_ptr to build WITH_PLUGIN")
|
||||
add_definitions("-DFORCE_BOOST_SMART_PTR=1")
|
||||
endif()
|
||||
|
30
vendor/git.apache.org/thrift.git/build/cmake/FindAnt.cmake
generated
vendored
30
vendor/git.apache.org/thrift.git/build/cmake/FindAnt.cmake
generated
vendored
|
@ -1,30 +0,0 @@
|
|||
#
|
||||
# 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_EXECUTABLE - 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)
|
30
vendor/git.apache.org/thrift.git/build/cmake/FindCabal.cmake
generated
vendored
30
vendor/git.apache.org/thrift.git/build/cmake/FindCabal.cmake
generated
vendored
|
@ -1,30 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
# Cabal_FOUND - system has Cabal
|
||||
# Cabal - the Cabal executable
|
||||
#
|
||||
# It will search the environment variable CABAL_HOME if it is set
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_program(CABAL NAMES cabal PATHS $ENV{HOME}/.cabal/bin $ENV{CABAL_HOME}/bin)
|
||||
find_package_handle_standard_args(CABAL DEFAULT_MSG CABAL)
|
||||
mark_as_advanced(CABAL)
|
36
vendor/git.apache.org/thrift.git/build/cmake/FindGHC.cmake
generated
vendored
36
vendor/git.apache.org/thrift.git/build/cmake/FindGHC.cmake
generated
vendored
|
@ -1,36 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
# GHC_FOUND - system has GHC
|
||||
# GHC - the GHC executable
|
||||
# RUN_HASKELL_FOUND - system has runhaskell
|
||||
# RUN_HASKELL - the runhaskell executable
|
||||
#
|
||||
# It will search the environment variable GHC_HOME if it is set
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_program(GHC NAMES ghc PATHS $ENV{GHC_HOME}/bin)
|
||||
find_package_handle_standard_args(GHC DEFAULT_MSG GHC)
|
||||
mark_as_advanced(GHC)
|
||||
|
||||
find_program(RUN_HASKELL NAMES runhaskell PATHS $ENV{GHC_HOME}/bin)
|
||||
find_package_handle_standard_args(RUN_HASKELL DEFAULT_MSG RUN_HASKELL)
|
||||
mark_as_advanced(RUN_HASKELL)
|
122
vendor/git.apache.org/thrift.git/build/cmake/FindGLIB.cmake
generated
vendored
122
vendor/git.apache.org/thrift.git/build/cmake/FindGLIB.cmake
generated
vendored
|
@ -1,122 +0,0 @@
|
|||
# - 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
|
||||
)
|
30
vendor/git.apache.org/thrift.git/build/cmake/FindGradle.cmake
generated
vendored
30
vendor/git.apache.org/thrift.git/build/cmake/FindGradle.cmake
generated
vendored
|
@ -1,30 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
# GRADLE_FOUND - system has Gradle
|
||||
# GRADLE_EXECUTABLE - the Gradle executable
|
||||
#
|
||||
# It will search the environment variable ANT_HOME if it is set
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_program(GRADLE_EXECUTABLE NAMES gradle PATHS $ENV{GRADLE_HOME}/bin NO_CMAKE_FIND_ROOT_PATH)
|
||||
find_package_handle_standard_args(Gradle DEFAULT_MSG GRADLE_EXECUTABLE)
|
||||
mark_as_advanced(GRADLE_EXECUTABLE)
|
45
vendor/git.apache.org/thrift.git/build/cmake/FindLibevent.cmake
generated
vendored
45
vendor/git.apache.org/thrift.git/build/cmake/FindLibevent.cmake
generated
vendored
|
@ -1,45 +0,0 @@
|
|||
# find LibEvent
|
||||
# an event notification library (http://libevent.org/)
|
||||
#
|
||||
# Usage:
|
||||
# LIBEVENT_INCLUDE_DIRS, where to find LibEvent headers
|
||||
# LIBEVENT_LIBRARIES, LibEvent libraries
|
||||
# Libevent_FOUND, If false, do not try to use libevent
|
||||
|
||||
set(LIBEVENT_ROOT CACHE PATH "Root directory of libevent installation")
|
||||
set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}" ${LIBEVENT_ROOT})
|
||||
foreach(prefix ${LibEvent_EXTRA_PREFIXES})
|
||||
list(APPEND LibEvent_INCLUDE_PATHS "${prefix}/include")
|
||||
list(APPEND LibEvent_LIBRARIES_PATHS "${prefix}/lib")
|
||||
endforeach()
|
||||
|
||||
# Looking for "event.h" will find the Platform SDK include dir on windows
|
||||
# so we also look for a peer header like evhttp.h to get the right path
|
||||
find_path(LIBEVENT_INCLUDE_DIRS evhttp.h event.h PATHS ${LibEvent_INCLUDE_PATHS})
|
||||
|
||||
# "lib" prefix is needed on Windows in some cases
|
||||
# newer versions of libevent use three libraries
|
||||
find_library(LIBEVENT_LIBRARIES NAMES event event_core event_extra libevent PATHS ${LibEvent_LIBRARIES_PATHS})
|
||||
|
||||
if (LIBEVENT_LIBRARIES AND LIBEVENT_INCLUDE_DIRS)
|
||||
set(Libevent_FOUND TRUE)
|
||||
set(LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARIES})
|
||||
else ()
|
||||
set(Libevent_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
if (Libevent_FOUND)
|
||||
if (NOT Libevent_FIND_QUIETLY)
|
||||
message(STATUS "Found libevent: ${LIBEVENT_LIBRARIES}")
|
||||
endif ()
|
||||
else ()
|
||||
if (LibEvent_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find libevent.")
|
||||
endif ()
|
||||
message(STATUS "libevent NOT found.")
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(
|
||||
LIBEVENT_LIBRARIES
|
||||
LIBEVENT_INCLUDE_DIRS
|
||||
)
|
60
vendor/git.apache.org/thrift.git/build/cmake/README.md
generated
vendored
60
vendor/git.apache.org/thrift.git/build/cmake/README.md
generated
vendored
|
@ -1,60 +0,0 @@
|
|||
# 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 cmake-build && cd cmake-build
|
||||
cmake ..
|
||||
|
||||
if you use a specific toolchain pass it to cmake, the same for options:
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake ..
|
||||
cmake -DCMAKE_C_COMPILER=clang-3.5 -DCMAKE_CXX_COMPILER=clang++-3.5 ..
|
||||
cmake -DTHRIFT_COMPILER_HS=OFF ..
|
||||
cmake -DWITH_ZLIB=ON ..
|
||||
|
||||
or on Windows
|
||||
|
||||
cmake -G "Visual Studio 12 2013 Win64" \
|
||||
-DBOOST_ROOT=C:/3rdparty/boost_1_58_0 \
|
||||
-DZLIB_ROOT=C:/3rdparty/zlib128-dll \
|
||||
-DWITH_SHARED_LIB=off -DWITH_BOOSTTHREADS=ON ..
|
||||
|
||||
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 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
|
105
vendor/git.apache.org/thrift.git/build/cmake/ThriftMacros.cmake
generated
vendored
105
vendor/git.apache.org/thrift.git/build/cmake/ThriftMacros.cmake
generated
vendored
|
@ -1,105 +0,0 @@
|
|||
#
|
||||
# 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})
|
||||
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})
|
||||
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(ADD_LIBRARY_THRIFT)
|
||||
|
||||
|
||||
macro(TARGET_INCLUDE_DIRECTORIES_THRIFT name)
|
||||
|
||||
if(WITH_SHARED_LIB)
|
||||
target_include_directories(${name} ${ARGN})
|
||||
endif()
|
||||
|
||||
if(WITH_STATIC_LIB)
|
||||
target_include_directories(${name}_static ${ARGN})
|
||||
endif()
|
||||
|
||||
endmacro(TARGET_INCLUDE_DIRECTORIES_THRIFT)
|
||||
|
||||
|
||||
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(TARGET_LINK_LIBRARIES_THRIFT)
|
||||
|
||||
|
||||
macro(LINK_AGAINST_THRIFT_LIBRARY target libname)
|
||||
|
||||
if (WITH_SHARED_LIB)
|
||||
target_link_libraries(${target} ${libname})
|
||||
elseif (WITH_STATIC_LIB)
|
||||
target_link_libraries(${target} ${libname}_static)
|
||||
else()
|
||||
message(FATAL "Not linking with shared or static libraries?")
|
||||
endif()
|
||||
|
||||
endmacro(LINK_AGAINST_THRIFT_LIBRARY)
|
||||
|
||||
|
||||
macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname)
|
||||
|
||||
if(WITH_SHARED_LIB)
|
||||
target_link_libraries(${target} ${ARGN} ${libname})
|
||||
endif()
|
||||
|
||||
if(WITH_STATIC_LIB)
|
||||
target_link_libraries(${target}_static ${ARGN} ${libname}_static)
|
||||
endif()
|
||||
|
||||
endmacro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY)
|
26
vendor/git.apache.org/thrift.git/build/cmake/android-toolchain.cmake
generated
vendored
26
vendor/git.apache.org/thrift.git/build/cmake/android-toolchain.cmake
generated
vendored
|
@ -1,26 +0,0 @@
|
|||
set(ANDROID_NDK "/opt/android-ndk" CACHE)
|
||||
set(ANDROID_PLATFORM "android-15" CACHE)
|
||||
set(ANDROID_ARCH "arch-arm" CACHE)
|
||||
set(ANDROID_TOOL_ARCH "android-arm" CACHE)
|
||||
set(ANDROID_CPU "armeabi-v7a" CACHE)
|
||||
set(ANDROID_GCC_VERSION 4.9 CACHE)
|
||||
set(HOST_ARCH linux-x86_64 CACHE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Android)
|
||||
set(ANDROID_SYSROOT "${ANDROID_NDK}/platforms/${ANDROID_PLATFORM}/${ANDROID_ARCH}")
|
||||
set(ANDROID_TRIPLET arm-linux-androideabi)
|
||||
set(ANDROID_STL "${ANDROID_NDK}/sources/cxx-stl/gnu-libstd++/${ANDROID_GCC_VERSION}")
|
||||
|
||||
set(_COMPILER_ROOT ${ANDROID_NDK}/prebuilt/${ANDROID_TRIPLET}-${ANDROID_GCC_VERSION}/prebuilt/${HOST_ARCH})
|
||||
set(CMAKE_C_COMPILER ${_COMPILER_ROOT}/bin/${ANDROID_TRIPLET}-gcc)
|
||||
set(CMAKE_CXCX_COMPILER ${_COMPILER_ROOT}/bin/${ANDROID_TRIPLET}-g++)
|
||||
|
||||
include_directories(
|
||||
${ANDROID_STL}/include
|
||||
${ANDROID_STL}/libs/${ANDROID_CPU}/include)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH ${ANDROID_SYSROOT})
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
163
vendor/git.apache.org/thrift.git/build/cmake/config.h.in
generated
vendored
163
vendor/git.apache.org/thrift.git/build/cmake/config.h.in
generated
vendored
|
@ -1,163 +0,0 @@
|
|||
/*
|
||||
* 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}"
|
||||
|
||||
/************************** 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 only 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 <signal.h> header file. */
|
||||
#cmakedefine HAVE_SIGNAL_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/ioctl.h> header file. */
|
||||
#cmakedefine HAVE_SYS_IOCTL_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 <poll.h> header file. */
|
||||
#cmakedefine HAVE_POLL_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 <sys/time.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TIME_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
|
24
vendor/git.apache.org/thrift.git/build/cmake/mingw32-toolchain.cmake
generated
vendored
24
vendor/git.apache.org/thrift.git/build/cmake/mingw32-toolchain.cmake
generated
vendored
|
@ -1,24 +0,0 @@
|
|||
# CMake mingw32 cross compile toolchain file
|
||||
|
||||
# the name of the target operating system
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
# which compilers to use for C and C++
|
||||
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
|
||||
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
|
||||
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
|
||||
|
||||
# here is the target environment located
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the 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)
|
||||
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-static")
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-static-libgcc")
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-static-libstdc++")
|
198
vendor/git.apache.org/thrift.git/build/docker/README.md
generated
vendored
198
vendor/git.apache.org/thrift.git/build/docker/README.md
generated
vendored
|
@ -1,198 +0,0 @@
|
|||
# Docker Integration #
|
||||
|
||||
Due to the large number of languages supported by Apache Thrift,
|
||||
docker containers are used to build and test the project on a
|
||||
variety of platforms to provide maximum test coverage.
|
||||
|
||||
## Appveyor Integration ##
|
||||
|
||||
At this time the Appveyor scripts do not use docker containers.
|
||||
Once Microsoft supports Visual Studio Build Tools running inside
|
||||
nano containers (instead of Core, which is huge) then we will
|
||||
consider using containers for the Windows builds as well.
|
||||
|
||||
## Travis CI Integration ##
|
||||
|
||||
The Travis CI scripts use the following environment variables and
|
||||
logic to determine their behavior:
|
||||
|
||||
### Environment Variables ###
|
||||
|
||||
| Variable | Default | Usage |
|
||||
| -------- | ----- | ------- |
|
||||
| `DISTRO` | `ubuntu-bionic` | Set by various build jobs in `.travis.yml` to run builds in different containers. Not intended to be set externally.|
|
||||
| `DOCKER_REPO` | `thrift/thrift-build` | The name of the Docker Hub repository to obtain and store docker images. |
|
||||
| `DOCKER_USER` | `<none>` | The Docker Hub account name containing the repository. |
|
||||
| `DOCKER_PASS` | `<none>` | The Docker Hub account password to use when pushing new tags. |
|
||||
|
||||
For example, the default docker image that is used in builds if no overrides are specified would be: `thrift/thrift-build:ubuntu-bionic`
|
||||
|
||||
### Forks ###
|
||||
|
||||
If you have forked the Apache Thrift repository and you would like
|
||||
to use your own Docker Hub account to store thrift build images,
|
||||
you can use the Travis CI web interface to set the `DOCKER_USER`,
|
||||
`DOCKER_PASS`, and `DOCKER_REPO` variables in a secure manner.
|
||||
Your fork builds will then pull, push, and tag the docker images
|
||||
in your account.
|
||||
|
||||
### Logic ###
|
||||
|
||||
The Travis CI build runs in two phases - first the docker images are rebuilt
|
||||
for each of the supported containers if they do not match the Dockerfile that
|
||||
was used to build the most recent tag. If a `DOCKER_PASS` environment
|
||||
variable is specified, the docker stage builds will attempt to log into
|
||||
Docker Hub and push the resulting tags.
|
||||
|
||||
## Supported Containers ##
|
||||
|
||||
The Travis CI (continuous integration) builds use the Ubuntu Bionic
|
||||
(18.04 LTS) and Xenial (16.04 LTS) images to maximize language level
|
||||
coverage.
|
||||
|
||||
### Ubuntu ###
|
||||
|
||||
* bionic (stable, current)
|
||||
* artful (previous stable)
|
||||
* xenial (legacy)
|
||||
|
||||
## Unsupported Containers ##
|
||||
|
||||
These containers may be in various states, and may not build everything.
|
||||
They can be found in the `old/` subdirectory.
|
||||
|
||||
### CentOS ###
|
||||
* 7.3
|
||||
* make check in lib/py may hang in test_sslsocket - root cause unknown
|
||||
|
||||
### Debian ###
|
||||
|
||||
* jessie
|
||||
* stretch
|
||||
* make check in lib/cpp fails due to https://svn.boost.org/trac10/ticket/12507
|
||||
|
||||
## Building like Travis CI does, locally ##
|
||||
|
||||
We recommend you build locally the same way Travis CI does, so that when you
|
||||
submit your pull request you will run into fewer surprises. To make it a
|
||||
little easier, put the following into your `~/.bash_aliases` file:
|
||||
|
||||
# Kill all running containers.
|
||||
alias dockerkillall='docker kill $(docker ps -q)'
|
||||
|
||||
# Delete all stopped containers.
|
||||
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
|
||||
|
||||
# Delete all untagged images.
|
||||
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'
|
||||
|
||||
# Delete all stopped containers and untagged images.
|
||||
alias dockerclean='dockercleanc || true && dockercleani'
|
||||
|
||||
# Build a thrift docker image (run from top level of git repo): argument #1 is image type (ubuntu, centos, etc).
|
||||
function dockerbuild
|
||||
{
|
||||
docker build -t $1 build/docker/$1
|
||||
}
|
||||
|
||||
# Run a thrift docker image: argument #1 is image type (ubuntu, centos, etc).
|
||||
function dockerrun
|
||||
{
|
||||
docker run -v $(pwd):/thrift/src -it $1 /bin/bash
|
||||
}
|
||||
|
||||
Then, to pull down the current image being used to build (the same way
|
||||
Travis CI does it) - if it is out of date in any way it will build a
|
||||
new one for you:
|
||||
|
||||
thrift$ DOCKER_REPO=thrift/thrift-build DISTRO=ubuntu-bionic build/docker/refresh.sh
|
||||
|
||||
To run all unit tests (just like Travis CI does):
|
||||
|
||||
thrift$ dockerrun ubuntu-bionic
|
||||
root@8caf56b0ce7b:/thrift/src# build/docker/scripts/autotools.sh
|
||||
|
||||
To run the cross tests (just like Travis CI does):
|
||||
|
||||
thrift$ dockerrun ubuntu-bionic
|
||||
root@8caf56b0ce7b:/thrift/src# build/docker/scripts/cross-test.sh
|
||||
|
||||
When you are done, you want to clean up occasionally so that docker isn't using lots of extra disk space:
|
||||
|
||||
thrift$ dockerclean
|
||||
|
||||
You need to run the docker commands from the root of the local clone of the
|
||||
thrift git repository for them to work.
|
||||
|
||||
When you are done in the root docker shell you can `exit` to go back to
|
||||
your user host shell. Once the unit tests and cross test passes locally,
|
||||
submit the changes, and if desired squash the pull request to one commit
|
||||
to make it easier to merge (the committers can squash at commit time now
|
||||
that GitHub is the master repository). Now you are building like Travis CI does!
|
||||
|
||||
## Raw Commands for Building with Docker ##
|
||||
|
||||
If you do not want to use the same scripts Travis CI does, you can do it manually:
|
||||
|
||||
Build the image:
|
||||
|
||||
thrift$ docker build -t thrift build/docker/ubuntu-bionic
|
||||
|
||||
Open a command prompt in the image:
|
||||
|
||||
thrift$ docker run -v $(pwd):/thrift/src -it thrift /bin/bash
|
||||
|
||||
## Core Tool Versions per Dockerfile ##
|
||||
|
||||
Last updated: October 1, 2017
|
||||
|
||||
| Tool | ubuntu-xenial | ubuntu-bionic | Notes |
|
||||
| :-------- | :------------ | :------------ | :---- |
|
||||
| ant | 1.9.6 | 1.10.3 | |
|
||||
| autoconf | 2.69 | 2.69 | |
|
||||
| automake | 1.15 | 1.15.1 | |
|
||||
| bison | 3.0.4 | 3.0.4 | |
|
||||
| boost | 1.58.0 | 1.65.1 | |
|
||||
| cmake | 3.5.1 | 3.10.2 | |
|
||||
| cppcheck | 1.72 | 1.82 | |
|
||||
| flex | 2.6.0 | 2.6.4 | |
|
||||
| libc6 | 2.23 | 2.27 | glibc |
|
||||
| libevent | 2.0.21 | 2.1.8 | |
|
||||
| libstdc++ | 5.4.0 | 7.3.0 | |
|
||||
| make | 4.1 | 4.1 | |
|
||||
| openssl | 1.0.2g | 1.1.0g | |
|
||||
| qt5 | 5.5.1 | 5.9.5 | |
|
||||
|
||||
## Compiler/Language Versions per Dockerfile ##
|
||||
|
||||
| Language | ubuntu-xenial | ubuntu-bionic | Notes |
|
||||
| :-------- | :------------ | :------------ | :---- |
|
||||
| as of | Mar 06, 2018 | Jul 6, 2018 | |
|
||||
| as3 | | | Not in CI |
|
||||
| C++ gcc | 5.4.0 | 7.3.0 | |
|
||||
| C++ clang | 3.8 | 6.0 | |
|
||||
| C# (mono) | 4.2.1.0 | 4.6.2.7 | |
|
||||
| c_glib | 2.48.2 | 2.56.0 | |
|
||||
| cl (sbcl) | | 1.4.9 | |
|
||||
| cocoa | | | Not in CI |
|
||||
| d | 2.075.1 | 2.081.0 | |
|
||||
| dart | 1.22.1 | 1.24.3 | |
|
||||
| delphi | | | Not in CI |
|
||||
| dotnet | 2.1.4 | 2.1.301 | |
|
||||
| erlang | 18.3 | 20.2.2 | |
|
||||
| go | 1.7.6 | 1.10.3 | |
|
||||
| haskell | 7.10.3 | 8.0.2 | |
|
||||
| haxe | 3.2.1 | 3.4.4 | THRIFT-4352: avoid 3.4.2 |
|
||||
| java | 1.8.0_151 | 1.8.0_171 | |
|
||||
| js | | | Unsure how to look for version info? |
|
||||
| lua | 5.2.4 | 5.2.4 | Lua 5.3: see THRIFT-4386 |
|
||||
| nodejs | 6.13.0 | 8.11.3 | |
|
||||
| ocaml | | 4.05.0 | THRIFT-4517: ocaml 4.02.3 on xenial appears broken |
|
||||
| perl | 5.22.1 | 5.26.1 | |
|
||||
| php | 7.0.22 | 7.2.5 | |
|
||||
| python | 2.7.12 | 2.7.15rc1 | |
|
||||
| python3 | 3.5.2 | 3.6.5 | |
|
||||
| ruby | 2.3.1p112 | 2.5.1p57 | |
|
||||
| rust | 1.17.0 | 1.24.1 | |
|
||||
| smalltalk | | | Not in CI |
|
||||
| swift | | | Not in CI |
|
6
vendor/git.apache.org/thrift.git/build/docker/scripts/autotools.sh
generated
vendored
6
vendor/git.apache.org/thrift.git/build/docker/scripts/autotools.sh
generated
vendored
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
./bootstrap.sh
|
||||
./configure $*
|
||||
make check -j3
|
23
vendor/git.apache.org/thrift.git/build/docker/scripts/cmake.sh
generated
vendored
23
vendor/git.apache.org/thrift.git/build/docker/scripts/cmake.sh
generated
vendored
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
CMAKE_FLAGS=$*
|
||||
MAKEPROG=make
|
||||
|
||||
if ninja --version >/dev/null 2>&1; then
|
||||
MAKEPROG=ninja
|
||||
CMAKE_FLAGS="-GNinja $CMAKE_FLAGS"
|
||||
fi
|
||||
|
||||
mkdir -p cmake_build && cd cmake_build
|
||||
cmake $CMAKE_FLAGS ..
|
||||
for LIB in $BUILD_LIBS; do
|
||||
if ! grep "^BUILD_${LIB}:BOOL=ON$" CMakeCache.txt ; then
|
||||
echo "failed to configure $LIB"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
$MAKEPROG -j3
|
||||
cpack
|
||||
ctest -VV -E "(python_test)"
|
||||
# disabled cmake python_test for now since it fails in travis under centos
|
16
vendor/git.apache.org/thrift.git/build/docker/scripts/cross-test.sh
generated
vendored
16
vendor/git.apache.org/thrift.git/build/docker/scripts/cross-test.sh
generated
vendored
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
./bootstrap.sh
|
||||
./configure --enable-tutorial=no
|
||||
make -j3 precross
|
||||
|
||||
set +e
|
||||
make cross$1
|
||||
|
||||
RET=$?
|
||||
if [ $RET -ne 0 ]; then
|
||||
cat test/log/unexpected_failures.log
|
||||
fi
|
||||
|
||||
exit $RET
|
5
vendor/git.apache.org/thrift.git/build/docker/scripts/dpkg.sh
generated
vendored
5
vendor/git.apache.org/thrift.git/build/docker/scripts/dpkg.sh
generated
vendored
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
dpkg-buildpackage -tc -us -uc
|
||||
ls -al ..
|
9
vendor/git.apache.org/thrift.git/build/docker/scripts/make-dist.sh
generated
vendored
9
vendor/git.apache.org/thrift.git/build/docker/scripts/make-dist.sh
generated
vendored
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
./bootstrap.sh
|
||||
./configure $*
|
||||
make dist
|
||||
tar xvf thrift-*.tar.gz
|
||||
cd thrift-*
|
||||
./build/docker/scripts/cmake.sh
|
29
vendor/git.apache.org/thrift.git/build/travis/installCXXDependencies.sh
generated
vendored
29
vendor/git.apache.org/thrift.git/build/travis/installCXXDependencies.sh
generated
vendored
|
@ -1,29 +0,0 @@
|
|||
#!/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
|
66
vendor/git.apache.org/thrift.git/build/travis/installDependencies.sh
generated
vendored
66
vendor/git.apache.org/thrift.git/build/travis/installDependencies.sh
generated
vendored
|
@ -1,66 +0,0 @@
|
|||
#!/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
|
||||
|
||||
# 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 python-twisted python-six python3-six
|
||||
|
||||
# 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 libio-socket-ssl-perl libnet-ssleay-perl libcrypt-ssleay-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 erlang-tools rebar
|
||||
|
||||
# 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
|
89
vendor/git.apache.org/thrift.git/cleanup.sh
generated
vendored
89
vendor/git.apache.org/thrift.git/cleanup.sh
generated
vendored
|
@ -1,89 +0,0 @@
|
|||
#!/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.
|
||||
#
|
||||
|
||||
topsrcdir="`dirname $0`"
|
||||
cd "$topsrcdir"
|
||||
|
||||
make -k clean >/dev/null 2>&1
|
||||
make -k distclean >/dev/null 2>&1
|
||||
find . -name Makefile.in -exec rm -f {} \;
|
||||
rm -rf \
|
||||
AUTHORS \
|
||||
ChangeLog \
|
||||
INSTALL \
|
||||
Makefile \
|
||||
Makefile.in \
|
||||
Makefile.orig \
|
||||
aclocal/libtool.m4 \
|
||||
aclocal/ltoptions.m4 \
|
||||
aclocal/ltsugar.m4 \
|
||||
aclocal/ltversion.m4 \
|
||||
aclocal/lt~obsolete.m4 \
|
||||
aclocal.m4 \
|
||||
autom4te.cache \
|
||||
autoscan.log \
|
||||
config.guess \
|
||||
config.h \
|
||||
config.hin \
|
||||
config.hin~ \
|
||||
config.log \
|
||||
config.status \
|
||||
config.status.lineno \
|
||||
config.sub \
|
||||
configure \
|
||||
configure.lineno \
|
||||
configure.scan \
|
||||
depcomp \
|
||||
.deps \
|
||||
install-sh \
|
||||
.libs \
|
||||
libtool \
|
||||
ltmain.sh \
|
||||
missing \
|
||||
ylwrap \
|
||||
if/gen-* \
|
||||
test/gen-* \
|
||||
lib/php/src/ext/thrift_protocol/.deps \
|
||||
lib/php/src/ext/thrift_protocol/Makefile \
|
||||
lib/php/src/ext/thrift_protocol/Makefile.fragments \
|
||||
lib/php/src/ext/thrift_protocol/Makefile.global \
|
||||
lib/php/src/ext/thrift_protocol/Makefile.objects \
|
||||
lib/php/src/ext/thrift_protocol/acinclude.m4 \
|
||||
lib/php/src/ext/thrift_protocol/aclocal.m4 \
|
||||
lib/php/src/ext/thrift_protocol/autom4te.cache \
|
||||
lib/php/src/ext/thrift_protocol/build \
|
||||
lib/php/src/ext/thrift_protocol/config.guess \
|
||||
lib/php/src/ext/thrift_protocol/config.h \
|
||||
lib/php/src/ext/thrift_protocol/config.h.in \
|
||||
lib/php/src/ext/thrift_protocol/config.log \
|
||||
lib/php/src/ext/thrift_protocol/config.nice \
|
||||
lib/php/src/ext/thrift_protocol/config.status \
|
||||
lib/php/src/ext/thrift_protocol/config.sub \
|
||||
lib/php/src/ext/thrift_protocol/configure \
|
||||
lib/php/src/ext/thrift_protocol/configure.in \
|
||||
lib/php/src/ext/thrift_protocol/include \
|
||||
lib/php/src/ext/thrift_protocol/install-sh \
|
||||
lib/php/src/ext/thrift_protocol/libtool \
|
||||
lib/php/src/ext/thrift_protocol/ltmain.sh \
|
||||
lib/php/src/ext/thrift_protocol/missing \
|
||||
lib/php/src/ext/thrift_protocol/mkinstalldirs \
|
||||
lib/php/src/ext/thrift_protocol/modules \
|
||||
lib/php/src/ext/thrift_protocol/run-tests.php
|
221
vendor/git.apache.org/thrift.git/compiler/cpp/CMakeLists.txt
generated
vendored
221
vendor/git.apache.org/thrift.git/compiler/cpp/CMakeLists.txt
generated
vendored
|
@ -1,221 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
|
||||
if(MSVC)
|
||||
# The winflexbison generator outputs some macros that conflict with the Visual Studio 2010 copy of stdint.h
|
||||
# This might be fixed in later versions of Visual Studio, but an easy solution is to include stdint.h first
|
||||
if(HAVE_STDINT_H)
|
||||
add_definitions(-D__STDC_FORMAT_MACROS)
|
||||
add_definitions(-D__STDC_LIMIT_MACROS)
|
||||
add_definitions(/FI"stdint.h")
|
||||
endif(HAVE_STDINT_H)
|
||||
endif()
|
||||
|
||||
find_package(FLEX REQUIRED)
|
||||
find_package(BISON REQUIRED)
|
||||
|
||||
# create directory for thrifty and thriftl
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/)
|
||||
|
||||
# Create flex and bison files and build the lib parse static library
|
||||
BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc)
|
||||
FLEX_TARGET(thriftl ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thriftl.ll ${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc)
|
||||
ADD_FLEX_BISON_DEPENDENCY(thriftl thrifty)
|
||||
|
||||
set(parse_SOURCES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.hh
|
||||
)
|
||||
|
||||
add_library(parse STATIC ${parse_SOURCES})
|
||||
|
||||
# Create the thrift compiler
|
||||
set(compiler_core
|
||||
src/thrift/common.cc
|
||||
src/thrift/generate/t_generator.cc
|
||||
src/thrift/parse/t_typedef.cc
|
||||
src/thrift/parse/parse.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h
|
||||
)
|
||||
|
||||
set(thrift-compiler_SOURCES
|
||||
src/thrift/main.cc
|
||||
src/thrift/audit/t_audit.cpp
|
||||
)
|
||||
|
||||
set(thrift_compiler_LANGS
|
||||
)
|
||||
|
||||
# This macro adds an option THRIFT_COMPILER_${NAME}
|
||||
# that allows enabling or disabling certain languages
|
||||
macro(THRIFT_ADD_COMPILER name description initial)
|
||||
string(TOUPPER "THRIFT_COMPILER_${name}" enabler)
|
||||
set(src "src/thrift/generate/t_${name}_generator.cc")
|
||||
option(${enabler} ${description} ${initial})
|
||||
if(${enabler})
|
||||
list(APPEND thrift-compiler_SOURCES ${src})
|
||||
list(APPEND thrift_compiler_LANGS ${name})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# The following compiler can be enabled or disabled
|
||||
THRIFT_ADD_COMPILER(c_glib "Enable compiler for C with Glib" ON)
|
||||
THRIFT_ADD_COMPILER(cpp "Enable compiler for C++" ON)
|
||||
THRIFT_ADD_COMPILER(java "Enable compiler for Java" ON)
|
||||
THRIFT_ADD_COMPILER(as3 "Enable compiler for ActionScript 3" ON)
|
||||
THRIFT_ADD_COMPILER(dart "Enable compiler for Dart" ON)
|
||||
THRIFT_ADD_COMPILER(haxe "Enable compiler for Haxe" ON)
|
||||
THRIFT_ADD_COMPILER(csharp "Enable compiler for C#" ON)
|
||||
THRIFT_ADD_COMPILER(netcore "Enable compiler for .NET Core" ON)
|
||||
THRIFT_ADD_COMPILER(py "Enable compiler for Python 2.0" ON)
|
||||
THRIFT_ADD_COMPILER(rb "Enable compiler for Ruby" ON)
|
||||
THRIFT_ADD_COMPILER(perl "Enable compiler for Perl" ON)
|
||||
THRIFT_ADD_COMPILER(php "Enable compiler for PHP" ON)
|
||||
THRIFT_ADD_COMPILER(erl "Enable compiler for Erlang" ON)
|
||||
THRIFT_ADD_COMPILER(cocoa "Enable compiler for Cocoa Objective-C" ON)
|
||||
THRIFT_ADD_COMPILER(swift "Enable compiler for Cocoa Swift" ON)
|
||||
THRIFT_ADD_COMPILER(st "Enable compiler for Smalltalk" ON)
|
||||
THRIFT_ADD_COMPILER(ocaml "Enable compiler for OCaml" ON)
|
||||
THRIFT_ADD_COMPILER(hs "Enable compiler for Haskell" ON)
|
||||
THRIFT_ADD_COMPILER(xsd "Enable compiler for XSD" ON)
|
||||
THRIFT_ADD_COMPILER(html "Enable compiler for HTML Documentation" ON)
|
||||
THRIFT_ADD_COMPILER(js "Enable compiler for JavaScript" ON)
|
||||
THRIFT_ADD_COMPILER(json "Enable compiler for JSON" ON)
|
||||
THRIFT_ADD_COMPILER(javame "Enable compiler for Java ME" ON)
|
||||
THRIFT_ADD_COMPILER(delphi "Enable compiler for Delphi" ON)
|
||||
THRIFT_ADD_COMPILER(go "Enable compiler for Go" ON)
|
||||
THRIFT_ADD_COMPILER(d "Enable compiler for D" ON)
|
||||
THRIFT_ADD_COMPILER(lua "Enable compiler for Lua" ON)
|
||||
THRIFT_ADD_COMPILER(gv "Enable compiler for GraphViz" ON)
|
||||
THRIFT_ADD_COMPILER(rs "Enable compiler for Rust" ON)
|
||||
THRIFT_ADD_COMPILER(xml "Enable compiler for XML" ON)
|
||||
|
||||
# Thrift is looking for include files in the src directory
|
||||
# we also add the current binary directory for generated files
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} src)
|
||||
|
||||
if(NOT DEFINED WITH_PLUGIN OR NOT ${WITH_PLUGIN})
|
||||
list(APPEND thrift-compiler_SOURCES ${compiler_core})
|
||||
endif()
|
||||
|
||||
add_executable(thrift-compiler ${thrift-compiler_SOURCES})
|
||||
|
||||
if(${WITH_PLUGIN})
|
||||
add_executable(thrift-bootstrap ${compiler_core}
|
||||
src/thrift/main.cc
|
||||
src/thrift/audit/t_audit.cpp
|
||||
src/thrift/generate/t_cpp_generator.cc
|
||||
)
|
||||
target_link_libraries(thrift-bootstrap parse)
|
||||
|
||||
set(PLUGIN_GEN_SOURCES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_types.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_types.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_constants.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_constants.cpp
|
||||
)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin)
|
||||
add_custom_command(OUTPUT ${PLUGIN_GEN_SOURCES}
|
||||
DEPENDS thrift-bootstrap src/thrift/plugin/plugin.thrift
|
||||
COMMAND thrift-bootstrap -gen cpp
|
||||
-out ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/plugin/plugin.thrift
|
||||
)
|
||||
|
||||
include_directories(../../lib/cpp/src)
|
||||
|
||||
include(ThriftMacros)
|
||||
ADD_LIBRARY_THRIFT(thriftc
|
||||
${compiler_core}
|
||||
${PLUGIN_GEN_SOURCES}
|
||||
src/thrift/logging.cc
|
||||
src/thrift/plugin/plugin_output.cc
|
||||
src/thrift/plugin/plugin.cc
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES_THRIFT(thriftc PUBLIC ${Boost_INCLUDE_DIRS})
|
||||
TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY(thriftc thrift PUBLIC)
|
||||
target_compile_definitions(thrift-compiler PUBLIC THRIFT_ENABLE_PLUGIN)
|
||||
LINK_AGAINST_THRIFT_LIBRARY(thrift-compiler thriftc)
|
||||
endif()
|
||||
|
||||
set_target_properties(thrift-compiler PROPERTIES RUNTIME_OUTPUT_DIRECTORY bin/)
|
||||
set_target_properties(thrift-compiler PROPERTIES OUTPUT_NAME thrift)
|
||||
|
||||
target_link_libraries(thrift-compiler parse)
|
||||
|
||||
install(TARGETS thrift-compiler DESTINATION bin)
|
||||
|
||||
if(${WITH_PLUGIN})
|
||||
# Install the headers
|
||||
install(FILES
|
||||
"src/thrift/common.h"
|
||||
"src/thrift/globals.h"
|
||||
"src/thrift/logging.h"
|
||||
"src/thrift/main.h"
|
||||
"src/thrift/platform.h"
|
||||
"${CMAKE_BINARY_DIR}/compiler/cpp/thrift/version.h"
|
||||
DESTINATION "${INCLUDE_INSTALL_DIR}/thrift")
|
||||
install(FILES
|
||||
"src/thrift/audit/t_audit.h"
|
||||
DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/audit")
|
||||
install(FILES
|
||||
"src/thrift/generate/t_generator.h"
|
||||
"src/thrift/generate/t_generator_registry.h"
|
||||
"src/thrift/generate/t_html_generator.h"
|
||||
"src/thrift/generate/t_oop_generator.h"
|
||||
DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/generate")
|
||||
install(FILES
|
||||
"src/thrift/parse/t_base_type.h"
|
||||
"src/thrift/parse/t_const.h"
|
||||
"src/thrift/parse/t_const_value.h"
|
||||
"src/thrift/parse/t_container.h"
|
||||
"src/thrift/parse/t_doc.h"
|
||||
"src/thrift/parse/t_enum.h"
|
||||
"src/thrift/parse/t_enum_value.h"
|
||||
"src/thrift/parse/t_field.h"
|
||||
"src/thrift/parse/t_function.h"
|
||||
"src/thrift/parse/t_list.h"
|
||||
"src/thrift/parse/t_map.h"
|
||||
"src/thrift/parse/t_program.h"
|
||||
"src/thrift/parse/t_scope.h"
|
||||
"src/thrift/parse/t_service.h"
|
||||
"src/thrift/parse/t_set.h"
|
||||
"src/thrift/parse/t_struct.h"
|
||||
"src/thrift/parse/t_typedef.h"
|
||||
"src/thrift/parse/t_type.h"
|
||||
DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/parse")
|
||||
install(FILES
|
||||
"src/thrift/plugin/plugin.h"
|
||||
"src/thrift/plugin/plugin_output.h"
|
||||
"src/thrift/plugin/type_util.h"
|
||||
DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/plugin")
|
||||
if(MSVC)
|
||||
install(FILES
|
||||
"src/thrift/windows/config.h"
|
||||
DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/windows")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
207
vendor/git.apache.org/thrift.git/compiler/cpp/Makefile.am
generated
vendored
207
vendor/git.apache.org/thrift.git/compiler/cpp/Makefile.am
generated
vendored
|
@ -1,207 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# Contains some contributions under the Thrift Software License.
|
||||
# Please see doc/old-thrift-license.txt in the Thrift distribution for
|
||||
# details.
|
||||
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
# Note on why we have src/thrift and src/thrift/plugin directories:
|
||||
# Since Automake supports only one set of BUILT_SOURCES per file and does not allow
|
||||
# SUBDIRS built before BUILT_SOURCES, we end up separate Makefile.am for each source
|
||||
# code generation, i.e. lex-yacc and Thrift, to achieve stable parallel make.
|
||||
|
||||
SUBDIRS = src src/thrift/plugin .
|
||||
if WITH_TESTS
|
||||
SUBDIRS += test
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = thrift
|
||||
|
||||
thrift_OBJDIR = obj
|
||||
|
||||
plugin_gen = src/thrift/plugin/plugin_types.h \
|
||||
src/thrift/plugin/plugin_types.cpp \
|
||||
src/thrift/plugin/plugin_constants.h \
|
||||
src/thrift/plugin/plugin_constants.cpp
|
||||
|
||||
compiler_core = src/thrift/common.h \
|
||||
src/thrift/common.cc \
|
||||
src/thrift/generate/t_generator.cc \
|
||||
src/thrift/generate/t_generator_registry.h \
|
||||
src/thrift/globals.h \
|
||||
src/thrift/platform.h \
|
||||
src/thrift/logging.h \
|
||||
src/thrift/parse/t_doc.h \
|
||||
src/thrift/parse/t_type.h \
|
||||
src/thrift/parse/t_base_type.h \
|
||||
src/thrift/parse/t_enum.h \
|
||||
src/thrift/parse/t_enum_value.h \
|
||||
src/thrift/parse/t_typedef.h \
|
||||
src/thrift/parse/t_typedef.cc \
|
||||
src/thrift/parse/t_container.h \
|
||||
src/thrift/parse/t_list.h \
|
||||
src/thrift/parse/t_set.h \
|
||||
src/thrift/parse/t_map.h \
|
||||
src/thrift/parse/t_struct.h \
|
||||
src/thrift/parse/t_field.h \
|
||||
src/thrift/parse/t_service.h \
|
||||
src/thrift/parse/t_function.h \
|
||||
src/thrift/parse/t_program.h \
|
||||
src/thrift/parse/t_scope.h \
|
||||
src/thrift/parse/t_const.h \
|
||||
src/thrift/parse/t_const_value.h \
|
||||
src/thrift/parse/parse.cc \
|
||||
src/thrift/generate/t_generator.h \
|
||||
src/thrift/generate/t_oop_generator.h \
|
||||
src/thrift/generate/t_html_generator.h
|
||||
|
||||
thrift_SOURCES = src/thrift/main.h \
|
||||
src/thrift/main.cc \
|
||||
src/thrift/audit/t_audit.cpp \
|
||||
src/thrift/audit/t_audit.h
|
||||
|
||||
# Specific client generator source
|
||||
thrift_SOURCES += src/thrift/generate/t_c_glib_generator.cc \
|
||||
src/thrift/generate/t_cpp_generator.cc \
|
||||
src/thrift/generate/t_java_generator.cc \
|
||||
src/thrift/generate/t_json_generator.cc \
|
||||
src/thrift/generate/t_as3_generator.cc \
|
||||
src/thrift/generate/t_dart_generator.cc \
|
||||
src/thrift/generate/t_haxe_generator.cc \
|
||||
src/thrift/generate/t_csharp_generator.cc \
|
||||
src/thrift/generate/t_netcore_generator.cc \
|
||||
src/thrift/generate/t_netcore_generator.h \
|
||||
src/thrift/generate/t_py_generator.cc \
|
||||
src/thrift/generate/t_rb_generator.cc \
|
||||
src/thrift/generate/t_perl_generator.cc \
|
||||
src/thrift/generate/t_php_generator.cc \
|
||||
src/thrift/generate/t_erl_generator.cc \
|
||||
src/thrift/generate/t_cocoa_generator.cc \
|
||||
src/thrift/generate/t_swift_generator.cc \
|
||||
src/thrift/generate/t_st_generator.cc \
|
||||
src/thrift/generate/t_ocaml_generator.cc \
|
||||
src/thrift/generate/t_hs_generator.cc \
|
||||
src/thrift/generate/t_xsd_generator.cc \
|
||||
src/thrift/generate/t_xml_generator.cc \
|
||||
src/thrift/generate/t_html_generator.cc \
|
||||
src/thrift/generate/t_js_generator.cc \
|
||||
src/thrift/generate/t_javame_generator.cc \
|
||||
src/thrift/generate/t_delphi_generator.cc \
|
||||
src/thrift/generate/t_go_generator.cc \
|
||||
src/thrift/generate/t_gv_generator.cc \
|
||||
src/thrift/generate/t_d_generator.cc \
|
||||
src/thrift/generate/t_lua_generator.cc \
|
||||
src/thrift/generate/t_rs_generator.cc \
|
||||
src/thrift/generate/t_cl_generator.cc
|
||||
|
||||
thrift_CPPFLAGS = -I$(srcdir)/src
|
||||
thrift_CXXFLAGS = -Wall -Wextra -pedantic -Werror
|
||||
thrift_LDADD = @LEXLIB@ src/thrift/libparse.a
|
||||
|
||||
if !WITH_PLUGIN
|
||||
thrift_SOURCES += $(compiler_core)
|
||||
else
|
||||
|
||||
lib_LTLIBRARIES = libthriftc.la
|
||||
|
||||
thrift_CPPFLAGS += -DTHRIFT_ENABLE_PLUGIN=1
|
||||
thrift_LDADD += libthriftc.la
|
||||
|
||||
nodist_libthriftc_la_SOURCES = $(plugin_gen)
|
||||
libthriftc_la_SOURCES = $(compiler_core) \
|
||||
src/thrift/plugin/type_util.h \
|
||||
src/thrift/plugin/plugin.h \
|
||||
src/thrift/plugin/plugin.cc \
|
||||
src/thrift/plugin/plugin_output.h \
|
||||
src/thrift/plugin/plugin_output.cc \
|
||||
src/thrift/plugin/plugin.thrift \
|
||||
src/thrift/logging.cc
|
||||
|
||||
|
||||
libthriftc_la_CPPFLAGS = -I$(srcdir)/src -Isrc -I$(top_builddir)/lib/cpp/src -DTHRIFT_ENABLE_PLUGIN=1
|
||||
libthriftc_la_CXXFLAGS = -Wall -Wextra -pedantic
|
||||
libthriftc_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
|
||||
|
||||
include_thriftdir = $(includedir)/thrift
|
||||
include_thrift_HEADERS = src/thrift/common.h \
|
||||
src/thrift/globals.h \
|
||||
src/thrift/logging.h \
|
||||
src/thrift/main.h \
|
||||
src/thrift/platform.h \
|
||||
src/thrift/version.h
|
||||
|
||||
include_auditdir = $(include_thriftdir)/windows
|
||||
include_audit_HEADERS = src/thrift/audit/t_audit.h
|
||||
|
||||
include_generatedir = $(include_thriftdir)/generate
|
||||
include_generate_HEADERS = src/thrift/generate/t_generator.h \
|
||||
src/thrift/generate/t_generator_registry.h \
|
||||
src/thrift/generate/t_oop_generator.h \
|
||||
src/thrift/generate/t_html_generator.h
|
||||
|
||||
include_parsedir = $(include_thriftdir)/parse
|
||||
include_parse_HEADERS = src/thrift/parse/t_service.h \
|
||||
src/thrift/parse/t_program.h \
|
||||
src/thrift/parse/t_field.h \
|
||||
src/thrift/parse/t_scope.h \
|
||||
src/thrift/parse/t_typedef.h \
|
||||
src/thrift/parse/t_set.h \
|
||||
src/thrift/parse/t_const_value.h \
|
||||
src/thrift/parse/t_enum_value.h \
|
||||
src/thrift/parse/t_const.h \
|
||||
src/thrift/parse/t_list.h \
|
||||
src/thrift/parse/t_map.h \
|
||||
src/thrift/parse/t_container.h \
|
||||
src/thrift/parse/t_base_type.h \
|
||||
src/thrift/parse/t_enum.h \
|
||||
src/thrift/parse/t_function.h \
|
||||
src/thrift/parse/t_type.h \
|
||||
src/thrift/parse/t_doc.h \
|
||||
src/thrift/parse/t_struct.h
|
||||
|
||||
include_plugindir = $(include_thriftdir)/plugin
|
||||
include_plugin_HEADERS = src/thrift/plugin/plugin.h \
|
||||
src/thrift/plugin/type_util.h \
|
||||
src/thrift/plugin/plugin_output.h
|
||||
|
||||
include_windowsdir = $(include_thriftdir)/windows
|
||||
include_windows_HEADERS = src/thrift/windows/config.h
|
||||
endif
|
||||
|
||||
WINDOWS_DIST = \
|
||||
compiler.sln \
|
||||
compiler.vcxproj \
|
||||
compiler.vcxproj.filters
|
||||
|
||||
EXTRA_DIST = \
|
||||
coding_standards.md \
|
||||
README.md \
|
||||
CMakeLists.txt \
|
||||
test \
|
||||
$(WINDOWS_DIST)
|
||||
|
||||
clean-local:
|
||||
$(RM) version.h $(plugin_gen)
|
||||
|
||||
src/thrift/main.cc: src/thrift/version.h
|
||||
|
||||
style-local:
|
||||
$(CPPSTYLE_CMD)
|
175
vendor/git.apache.org/thrift.git/compiler/cpp/README.md
generated
vendored
175
vendor/git.apache.org/thrift.git/compiler/cpp/README.md
generated
vendored
|
@ -1,175 +0,0 @@
|
|||
# Build Thrift IDL compiler using CMake
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
- [Build Thrift IDL compiler using CMake](#build-thrift-idl-compiler-using-cmake)
|
||||
- [Build on Unix-like System](#build-on-unix-like-system)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Build using CMake](#build-using-cmake)
|
||||
- [Build with Eclipse IDE](#build-with-eclipse-ide)
|
||||
- [Build with XCode IDE in MacOS](#build-with-xcode-ide-in-macos)
|
||||
- [Usage of other IDEs](#usage-of-other-ides)
|
||||
- [Build on Windows](#build-on-windows)
|
||||
- [Prerequisites](#prerequisites-1)
|
||||
- [Build using Git Bash](#build-using-git-bash)
|
||||
- [Using Visual Studio and Win flex-bison](#using-visual-studio-and-win-flex-bison)
|
||||
- [Cross compile using mingw32 and generate a Windows Installer with CPack](#cross-compile-using-mingw32-and-generate-a-windows-installer-with-cpack)
|
||||
- [Other cases](#other-cases)
|
||||
- [Building the Thrift IDL compiler in Windows without CMake](#building-the-thrift-idl-compiler-in-windows-without-cmake)
|
||||
- [Unit tests for compiler](#unit-tests-for-compiler)
|
||||
- [Using boost test](#using-boost-test)
|
||||
- [Using Catch C++ test library](#using-catch-c-test-library)
|
||||
- [Have a Happy free time and holidays](#have-a-happy-free-time-and-holidays)
|
||||
|
||||
<!-- /TOC -->
|
||||
|
||||
## Build on Unix-like System
|
||||
|
||||
### Prerequisites
|
||||
- Install CMake
|
||||
- Install flex and bison
|
||||
|
||||
### Build using CMake
|
||||
|
||||
- Go to **thrift\compiler\cpp**
|
||||
- Use the following steps to build using cmake:
|
||||
|
||||
```
|
||||
mkdir cmake-build && cd cmake-build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
#### Build with Eclipse IDE
|
||||
|
||||
- Go to **thrift\compiler\cpp**
|
||||
- Use the following steps to build using cmake:
|
||||
|
||||
```
|
||||
mkdir cmake-ec && cd cmake-ec
|
||||
cmake -G "Eclipse CDT4 - Unix Makefiles" ..
|
||||
make
|
||||
```
|
||||
|
||||
Now open the folder cmake-ec using eclipse.
|
||||
|
||||
#### Build with XCode IDE in MacOS
|
||||
|
||||
- Install/update flex, bison and cmake with brew
|
||||
|
||||
```
|
||||
brew install cmake
|
||||
brew install bison
|
||||
```
|
||||
|
||||
- Go to **thrift\compiler\cpp**
|
||||
- Run commands in command line:
|
||||
|
||||
```
|
||||
mkdir cmake-build && cd cmake-build
|
||||
cmake -G "Xcode" -DWITH_PLUGIN=OFF ..
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
#### Usage of other IDEs
|
||||
|
||||
Please check list of supported IDE
|
||||
|
||||
```
|
||||
cmake --help
|
||||
```
|
||||
|
||||
## Build on Windows
|
||||
|
||||
### Prerequisites
|
||||
- Install CMake - https://cmake.org/download/
|
||||
- In case if you want to build without Git Bash - install winflexbison - https://sourceforge.net/projects/winflexbison/
|
||||
- In case if you want to build with Visual Studio - install Visual Studio
|
||||
- Better to use the latest stable Visual Studio Community Edition - https://www.visualstudio.com/vs/whatsnew/ (ensure that you installed workload "Desktop Development with C++" for VS2017) - Microsoft added some support for CMake and improving it in Visual Studio
|
||||
|
||||
### Build using Git Bash
|
||||
|
||||
Git Bash provides flex and bison
|
||||
|
||||
- Go to **thrift\compiler\cpp**
|
||||
- Use the following steps to build using cmake:
|
||||
|
||||
```
|
||||
mkdir cmake-vs && cd cmake-vs
|
||||
cmake -DWITH_SHARED_LIB=off ..
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
### Using Visual Studio and Win flex-bison
|
||||
|
||||
- Generate a Visual Studio project for version of Visual Studio which you have (**cmake --help** can show list of supportable VS versions):
|
||||
- Run commands in command line:
|
||||
```
|
||||
mkdir cmake-vs
|
||||
cd cmake-vs
|
||||
cmake -G "Visual Studio 15 2017" -DWITH_PLUGIN=OFF ..
|
||||
```
|
||||
- Now open the folder cmake-vs using Visual Studio.
|
||||
|
||||
### Cross compile using mingw32 and generate a Windows Installer with CPack
|
||||
|
||||
```
|
||||
mkdir cmake-mingw32 && cd cmake-mingw32
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF ..
|
||||
cpack
|
||||
```
|
||||
|
||||
# Other cases
|
||||
|
||||
## Building the Thrift IDL compiler in Windows without CMake
|
||||
|
||||
If you don't want to use CMake you can use the already available Visual Studio 2010 solution.
|
||||
|
||||
The Visual Studio project contains pre-build commands to generate the thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build the compiler.
|
||||
|
||||
These depend on bison, flex and their dependencies to work properly.
|
||||
|
||||
Download flex & bison as described above.
|
||||
|
||||
Place these binaries somewhere in the path and rename win_flex.exe and win_bison.exe to flex.exe and bison.exe respectively.
|
||||
|
||||
If this doesn't work on a system, try these manual pre-build steps.
|
||||
|
||||
Open compiler.sln and remove the Pre-build commands under the project's: Properties -> Build Events -> Pre-Build Events.
|
||||
|
||||
From a command prompt:
|
||||
```
|
||||
cd thrift/compiler/cpp
|
||||
flex -o src\thrift\thriftl.cc src\thrift\thriftl.ll
|
||||
```
|
||||
In the generated thriftl.cc, comment out #include <unistd.h>
|
||||
|
||||
Place a copy of bison.simple in thrift/compiler/cpp
|
||||
```
|
||||
bison -y -o "src/thrift/thrifty.cc" --defines src/thrift/thrifty.yy
|
||||
move src\thrift\thrifty.cc.hh src\thrift\thrifty.hh
|
||||
```
|
||||
|
||||
Bison might generate the yacc header file "thrifty.cc.h" with just one h ".h" extension; in this case you'll have to rename to "thrifty.h".
|
||||
|
||||
```
|
||||
move src\thrift\version.h.in src\thrift\version.h
|
||||
```
|
||||
|
||||
Download inttypes.h from the interwebs and place it in an include path
|
||||
location (e.g. thrift/compiler/cpp/src).
|
||||
|
||||
Build the compiler in Visual Studio.
|
||||
|
||||
# Unit tests for compiler
|
||||
|
||||
## Using boost test
|
||||
- pls check **test** folder
|
||||
|
||||
## Using Catch C++ test library
|
||||
|
||||
Added generic way to cover code by tests for many languages (you just need to make a correct header file for generator for your language - example in **netcore** implementation)
|
||||
|
||||
- pls check **tests** folder
|
||||
|
||||
# Have a Happy free time and holidays
|
4
vendor/git.apache.org/thrift.git/compiler/cpp/coding_standards.md
generated
vendored
4
vendor/git.apache.org/thrift.git/compiler/cpp/coding_standards.md
generated
vendored
|
@ -1,4 +0,0 @@
|
|||
## Compiler Coding Standards
|
||||
|
||||
* When making small change / bugfix - follow style as seen in nearby code.
|
||||
* When making major refactor and / or adding new feature - follow style for C++ library
|
20
vendor/git.apache.org/thrift.git/compiler/cpp/compiler.sln
generated
vendored
20
vendor/git.apache.org/thrift.git/compiler/cpp/compiler.sln
generated
vendored
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compiler", "compiler.vcxproj", "{89975A1A-F799-4556-98B8-64E30AB39A90}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{89975A1A-F799-4556-98B8-64E30AB39A90}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{89975A1A-F799-4556-98B8-64E30AB39A90}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{89975A1A-F799-4556-98B8-64E30AB39A90}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{89975A1A-F799-4556-98B8-64E30AB39A90}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
250
vendor/git.apache.org/thrift.git/compiler/cpp/compiler.vcxproj
generated
vendored
250
vendor/git.apache.org/thrift.git/compiler/cpp/compiler.vcxproj
generated
vendored
|
@ -1,250 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\thrift\audit\t_audit.h" />
|
||||
<ClInclude Include="src\thrift\common.h" />
|
||||
<ClInclude Include="src\thrift\generate\t_generator.h" />
|
||||
<ClInclude Include="src\thrift\generate\t_generator_registry.h" />
|
||||
<ClInclude Include="src\thrift\generate\t_oop_generator.h" />
|
||||
<ClInclude Include="src\thrift\generate\t_html_generator.h" />
|
||||
<ClInclude Include="src\thrift\globals.h" />
|
||||
<ClInclude Include="src\thrift\main.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_base_type.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_const.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_const_value.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_container.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_doc.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_enum.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_enum_value.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_field.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_function.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_list.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_map.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_program.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_scope.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_service.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_set.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_struct.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_type.h" />
|
||||
<ClInclude Include="src\thrift\parse\t_typedef.h" />
|
||||
<ClInclude Include="src\thrift\platform.h" />
|
||||
<ClInclude Include="src\thrift\thrifty.hh" />
|
||||
<ClInclude Include="src\thrift\windows\config.h" />
|
||||
<ClInclude Include="src\thrift\version.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\thrift\audit\t_audit.cpp" />
|
||||
<ClCompile Include="src\thrift\common.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_as3_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_cocoa_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_cpp_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_csharp_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_netcore_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_c_glib_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_d_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_dart_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_delphi_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_erl_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_go_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_gv_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_haxe_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_hs_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_html_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_javame_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_java_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_js_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_json_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_lua_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_ocaml_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_perl_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_php_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_py_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_rb_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_rs_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_st_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_swift_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_xml_generator.cc" />
|
||||
<ClCompile Include="src\thrift\generate\t_xsd_generator.cc" />
|
||||
<ClCompile Include="src\thrift\main.cc" />
|
||||
<ClCompile Include="src\thrift\parse\parse.cc" />
|
||||
<ClCompile Include="src\thrift\parse\t_typedef.cc" />
|
||||
<ClCompile Include="src\thrift\thriftl.cc" />
|
||||
<ClCompile Include="src\thrift\thrifty.cc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="src\thrift\thriftl.ll" />
|
||||
<None Include="src\thrift\thrifty.yy" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{89975A1A-F799-4556-98B8-64E30AB39A90}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>compiler</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
|
||||
<TargetName>thrift</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
|
||||
<TargetName>thrift</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
|
||||
<TargetName>thrift</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
|
||||
<TargetName>thrift</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>thrift\windows\config.h</ForcedIncludeFiles>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>flex -o "src\\thrift\\thriftl.cc" src/thrift/thriftl.ll && bison -y -o "src\\thrift\\thrifty.cc" --defines="src\\thrift\\thrifty.hh" src/thrift/thrifty.yy</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>thrift\windows\config.h</ForcedIncludeFiles>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>flex -o "src\\thrift\\thriftl.cc" src/thrift/thriftl.ll && bison -y -o "src\\thrift\\thrifty.cc" --defines="src\\thrift\\thrifty.hh" src/thrift/thrifty.yy</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>thrift\windows\config.h</ForcedIncludeFiles>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>flex -o "src\\thrift\\thriftl.cc" src/thrift/thriftl.ll && bison -y -o "src\\thrift\\thrifty.cc" --defines="src\\thrift\\thrifty.hh" src/thrift/thrifty.yy</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>thrift\windows\config.h</ForcedIncludeFiles>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>flex -o "src\\thrift\\thriftl.cc" src/thrift/thriftl.ll && bison -y -o "src\\thrift\\thrifty.cc" --defines="src\\thrift\\thrifty.hh" src/thrift/thrifty.yy</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
199
vendor/git.apache.org/thrift.git/compiler/cpp/compiler.vcxproj.filters
generated
vendored
199
vendor/git.apache.org/thrift.git/compiler/cpp/compiler.vcxproj.filters
generated
vendored
|
@ -1,199 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\audit\t_audit.h" />
|
||||
<ClInclude Include="src\generate\t_generator.h">
|
||||
<Filter>generate</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\generate\t_generator_registry.h">
|
||||
<Filter>generate</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\generate\t_oop_generator.h">
|
||||
<Filter>generate</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\generate\t_html_generator.h">
|
||||
<Filter>generate</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\globals.h" />
|
||||
<ClInclude Include="src\main.h" />
|
||||
<ClInclude Include="src\parse\t_base_type.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_const.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_const_value.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_container.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_doc.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_enum.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_enum_value.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_field.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_function.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_list.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_map.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_program.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_scope.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_service.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_set.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_struct.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_type.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\parse\t_typedef.h">
|
||||
<Filter>parse</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\platform.h" />
|
||||
<ClInclude Include="src\thrifty.hh" />
|
||||
<ClInclude Include="src\windows\config.h">
|
||||
<Filter>windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\windows\version.h">
|
||||
<Filter>windows</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="windows">
|
||||
<UniqueIdentifier>{ae9d0a15-57ae-4f01-87a4-81f790249b83}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="parse">
|
||||
<UniqueIdentifier>{5df016bb-591b-420a-a535-4330d9187fbf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="generate">
|
||||
<UniqueIdentifier>{b5c626af-afa5-433c-8e10-ee734533cb68}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\audit\t_audit.cpp"/>
|
||||
<ClCompile Include="src\generate\t_as3_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_cocoa_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_cpp_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_csharp_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_c_glib_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_d_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_dart_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_delphi_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_erl_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_go_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_gv_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_haxe_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_hs_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_html_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_javame_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_java_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_js_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_ocaml_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_perl_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_php_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_py_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_rb_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_rs_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_st_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_swift_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_xsd_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_xml_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\main.cc" />
|
||||
<ClCompile Include="src\parse\parse.cc">
|
||||
<Filter>parse</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\thriftl.cc" />
|
||||
<ClCompile Include="src\thrifty.cc" />
|
||||
<ClCompile Include="src\parse\t_typedef.cc">
|
||||
<Filter>parse</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_json_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\generate\t_lua_generator.cc">
|
||||
<Filter>generate</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="src\thriftl.ll" />
|
||||
<None Include="src\thrifty.yy" />
|
||||
</ItemGroup>
|
||||
</Project>
|
87
vendor/git.apache.org/thrift.git/compiler/cpp/src/Makefile.am
generated
vendored
87
vendor/git.apache.org/thrift.git/compiler/cpp/src/Makefile.am
generated
vendored
|
@ -1,87 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# Contains some contributions under the Thrift Software License.
|
||||
# Please see doc/old-thrift-license.txt in the Thrift distribution for
|
||||
# details.
|
||||
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
AM_YFLAGS = -d
|
||||
|
||||
BUILT_SOURCES = thrift/thrifty.cc
|
||||
|
||||
noinst_LIBRARIES = thrift/libparse.a
|
||||
|
||||
thrift_libparse_a_CPPFLAGS = -I$(srcdir)
|
||||
thrift_libparse_a_CXXFLAGS = -Wall -Wno-sign-compare -Wno-unused
|
||||
|
||||
thrift_libparse_a_SOURCES = thrift/thrifty.yy \
|
||||
thrift/thriftl.ll
|
||||
|
||||
clean-local:
|
||||
$(RM) thrift/thriftl.cc thrift/thrifty.cc thrift/thrifty.h thrift/thrifty.hh
|
||||
|
||||
if WITH_PLUGIN
|
||||
noinst_PROGRAMS = thrift/thrift-bootstrap
|
||||
|
||||
thrift_thrift_bootstrap_SOURCES = \
|
||||
thrift/common.h \
|
||||
thrift/common.cc \
|
||||
thrift/audit/t_audit.h \
|
||||
thrift/audit/t_audit.cpp \
|
||||
thrift/generate/t_generator.cc \
|
||||
thrift/generate/t_generator_registry.h \
|
||||
thrift/globals.h \
|
||||
thrift/platform.h \
|
||||
thrift/logging.h \
|
||||
thrift/parse/t_doc.h \
|
||||
thrift/parse/t_type.h \
|
||||
thrift/parse/t_base_type.h \
|
||||
thrift/parse/t_enum.h \
|
||||
thrift/parse/t_enum_value.h \
|
||||
thrift/parse/t_typedef.h \
|
||||
thrift/parse/t_typedef.cc \
|
||||
thrift/parse/t_container.h \
|
||||
thrift/parse/t_list.h \
|
||||
thrift/parse/t_set.h \
|
||||
thrift/parse/t_map.h \
|
||||
thrift/parse/t_struct.h \
|
||||
thrift/parse/t_field.h \
|
||||
thrift/parse/t_service.h \
|
||||
thrift/parse/t_function.h \
|
||||
thrift/parse/t_program.h \
|
||||
thrift/parse/t_scope.h \
|
||||
thrift/parse/t_const.h \
|
||||
thrift/parse/t_const_value.h \
|
||||
thrift/parse/parse.cc \
|
||||
thrift/generate/t_generator.h \
|
||||
thrift/generate/t_oop_generator.h \
|
||||
thrift/generate/t_html_generator.h \
|
||||
thrift/windows/config.h \
|
||||
thrift/version.h \
|
||||
thrift/generate/t_cpp_generator.cc \
|
||||
thrift/main.h \
|
||||
thrift/main.cc
|
||||
|
||||
main.cc: version.h
|
||||
|
||||
thrift_thrift_bootstrap_CXXFLAGS = -Wall -Wextra -pedantic
|
||||
thrift_thrift_bootstrap_LDADD = @LEXLIB@ thrift/libparse.a
|
||||
endif
|
464
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/audit/t_audit.cpp
generated
vendored
464
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/audit/t_audit.cpp
generated
vendored
|
@ -1,464 +0,0 @@
|
|||
|
||||
#include <cassert>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
// Careful: must include globals first for extern definitions
|
||||
#include "thrift/globals.h"
|
||||
|
||||
#include "thrift/parse/t_program.h"
|
||||
#include "thrift/parse/t_scope.h"
|
||||
#include "thrift/parse/t_const.h"
|
||||
#include "thrift/parse/t_field.h"
|
||||
|
||||
#include "thrift/version.h"
|
||||
|
||||
#include "thrift/audit/t_audit.h"
|
||||
|
||||
extern int g_warn;
|
||||
extern std::string g_curpath;
|
||||
extern bool g_return_failure;
|
||||
|
||||
void thrift_audit_warning(int level, const char* fmt, ...) {
|
||||
if (g_warn < level) {
|
||||
return;
|
||||
}
|
||||
va_list args;
|
||||
printf("[Thrift Audit Warning:%s] ", g_curpath.c_str());
|
||||
va_start(args, fmt);
|
||||
vprintf(fmt, args);
|
||||
va_end(args);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void thrift_audit_failure(const char* fmt, ...) {
|
||||
va_list args;
|
||||
fprintf(stderr, "[Thrift Audit Failure:%s] ", g_curpath.c_str());
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
fprintf(stderr, "\n");
|
||||
g_return_failure = true;
|
||||
}
|
||||
|
||||
void compare_namespace(t_program* newProgram, t_program* oldProgram)
|
||||
{
|
||||
const std::map<std::string, std::string>& newNamespaceMap = newProgram->get_all_namespaces();
|
||||
const std::map<std::string, std::string>& oldNamespaceMap = oldProgram->get_all_namespaces();
|
||||
|
||||
for(std::map<std::string, std::string>::const_iterator oldNamespaceMapIt = oldNamespaceMap.begin();
|
||||
oldNamespaceMapIt != oldNamespaceMap.end();
|
||||
oldNamespaceMapIt++)
|
||||
{
|
||||
std::map<std::string, std::string>::const_iterator newNamespaceMapIt = newNamespaceMap.find(oldNamespaceMapIt->first);
|
||||
if(newNamespaceMapIt == newNamespaceMap.end())
|
||||
{
|
||||
thrift_audit_warning(1, "Language %s not found in new thrift file\n", (oldNamespaceMapIt->first).c_str());
|
||||
}
|
||||
else if((newNamespaceMapIt->second) != oldNamespaceMapIt->second)
|
||||
{
|
||||
thrift_audit_warning(1, "Namespace %s changed in new thrift file\n", (oldNamespaceMapIt->second).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void compare_enum_values(t_enum* newEnum,t_enum* oldEnum)
|
||||
{
|
||||
const std::vector<t_enum_value*>& oldEnumValues = oldEnum->get_constants();
|
||||
for(std::vector<t_enum_value*>::const_iterator oldEnumValuesIt = oldEnumValues.begin();
|
||||
oldEnumValuesIt != oldEnumValues.end();
|
||||
oldEnumValuesIt++)
|
||||
{
|
||||
int enumValue = (*oldEnumValuesIt)->get_value();
|
||||
t_enum_value* newEnumValue = newEnum->get_constant_by_value(enumValue);
|
||||
if(newEnumValue != NULL)
|
||||
{
|
||||
std::string enumName = (*oldEnumValuesIt)->get_name();
|
||||
if(enumName != newEnumValue->get_name())
|
||||
{
|
||||
thrift_audit_warning(1, "Name of the value %d changed in enum %s\n", enumValue, oldEnum->get_name().c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
thrift_audit_failure("Enum value %d missing in %s\n", enumValue, oldEnum->get_name().c_str());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void compare_enums(const std::vector<t_enum*>& newEnumList, const std::vector<t_enum*>& oldEnumList)
|
||||
{
|
||||
std::map<std::string,t_enum*> newEnumMap;
|
||||
std::vector<t_enum*>::const_iterator newEnumIt;
|
||||
for(newEnumIt = newEnumList.begin(); newEnumIt != newEnumList.end(); newEnumIt++)
|
||||
{
|
||||
newEnumMap[(*newEnumIt)->get_name()] = *newEnumIt;
|
||||
}
|
||||
std::vector<t_enum*>::const_iterator oldEnumIt;
|
||||
for(oldEnumIt = oldEnumList.begin(); oldEnumIt != oldEnumList.end(); oldEnumIt++)
|
||||
{
|
||||
std::map<std::string,t_enum*>::iterator newEnumMapIt;
|
||||
newEnumMapIt = newEnumMap.find((*oldEnumIt)->get_name());
|
||||
|
||||
if(newEnumMapIt == newEnumMap.end())
|
||||
{
|
||||
thrift_audit_warning(1, "Enum %s not found in new thrift file\n",(*oldEnumIt)->get_name().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
compare_enum_values(newEnumMapIt->second, *oldEnumIt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//This function returns 'true' if the two arguements are of same types.
|
||||
//Returns false if they are of different type
|
||||
bool compare_type(t_type* newType, t_type* oldType)
|
||||
{
|
||||
//Comparing names of two types will work when the newType and oldType are basic types or structs or enums.
|
||||
//However, when they are containers, get_name() returns empty for which we have to compare the type of
|
||||
//their elements as well.
|
||||
if((newType->get_name()).empty() && (oldType->get_name()).empty())
|
||||
{
|
||||
|
||||
if(newType->is_list() && oldType->is_list())
|
||||
{
|
||||
t_type* newElementType = ((t_list*)newType)->get_elem_type();
|
||||
t_type* oldElementType = ((t_list*)oldType)->get_elem_type();
|
||||
return compare_type(newElementType, oldElementType);
|
||||
}
|
||||
else if(newType->is_map() && oldType->is_map())
|
||||
{
|
||||
t_type* newKeyType = ((t_map*)newType)->get_key_type();
|
||||
t_type* oldKeyType = ((t_map*)oldType)->get_key_type();
|
||||
|
||||
t_type* newValType = ((t_map*)newType)->get_val_type();
|
||||
t_type* oldValType = ((t_map*)oldType)->get_val_type();
|
||||
|
||||
return (compare_type(newKeyType, oldKeyType) && compare_type(newValType, oldValType));
|
||||
}
|
||||
else if(newType->is_set() && oldType->is_set())
|
||||
{
|
||||
t_type* newElementType = ((t_set*)newType)->get_elem_type();
|
||||
t_type* oldElementType = ((t_set*)oldType)->get_elem_type();
|
||||
return compare_type(newElementType, oldElementType);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(newType->get_name() == oldType->get_name())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool compare_pair(std::pair<t_const_value*, t_const_value*> newMapPair, std::pair<t_const_value*, t_const_value*> oldMapPair)
|
||||
{
|
||||
return compare_defaults(newMapPair.first, oldMapPair.first) && compare_defaults(newMapPair.second, oldMapPair.second);
|
||||
}
|
||||
|
||||
// This function returns 'true' if the default values are same. Returns false if they are different.
|
||||
bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault)
|
||||
{
|
||||
if(newStructDefault == NULL && oldStructDefault == NULL) return true;
|
||||
else if(newStructDefault == NULL && oldStructDefault != NULL) return false;
|
||||
else if (newStructDefault != NULL && oldStructDefault == NULL) return false;
|
||||
|
||||
if(newStructDefault->get_type() != oldStructDefault->get_type())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(newStructDefault->get_type())
|
||||
{
|
||||
case t_const_value::CV_INTEGER:
|
||||
return (newStructDefault->get_integer() == oldStructDefault->get_integer());
|
||||
case t_const_value::CV_DOUBLE:
|
||||
return (newStructDefault->get_double() == oldStructDefault->get_double());
|
||||
case t_const_value::CV_STRING:
|
||||
return (newStructDefault->get_string() == oldStructDefault->get_string());
|
||||
case t_const_value::CV_LIST:
|
||||
{
|
||||
const std::vector<t_const_value*>& oldDefaultList = oldStructDefault->get_list();
|
||||
const std::vector<t_const_value*>& newDefaultList = newStructDefault->get_list();
|
||||
bool defaultValuesCompare = (oldDefaultList.size() == newDefaultList.size());
|
||||
|
||||
return defaultValuesCompare && std::equal(newDefaultList.begin(), newDefaultList.end(), oldDefaultList.begin(), compare_defaults);
|
||||
}
|
||||
case t_const_value::CV_MAP:
|
||||
{
|
||||
const std::map<t_const_value*, t_const_value*, t_const_value::value_compare> newMap = newStructDefault->get_map();
|
||||
const std::map<t_const_value*, t_const_value*, t_const_value::value_compare> oldMap = oldStructDefault->get_map();
|
||||
|
||||
bool defaultValuesCompare = (oldMap.size() == newMap.size());
|
||||
|
||||
return defaultValuesCompare && std::equal(newMap.begin(), newMap.end(), oldMap.begin(), compare_pair);
|
||||
}
|
||||
case t_const_value::CV_IDENTIFIER:
|
||||
return (newStructDefault->get_identifier() == oldStructDefault->get_identifier());
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void compare_struct_field(t_field* newField, t_field* oldField, std::string oldStructName)
|
||||
{
|
||||
t_type* newFieldType = newField->get_type();
|
||||
t_type* oldFieldType = oldField->get_type();
|
||||
if(!compare_type(newFieldType, oldFieldType))
|
||||
{
|
||||
thrift_audit_failure("Struct Field Type Changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
|
||||
}
|
||||
|
||||
// A Struct member can be optional if it is mentioned explicitly, or if it is assigned with default values.
|
||||
bool newStructFieldOptional = (newField->get_req() != t_field::T_REQUIRED);
|
||||
bool oldStructFieldOptional = (oldField->get_req() != t_field::T_REQUIRED);
|
||||
|
||||
if(newStructFieldOptional != oldStructFieldOptional)
|
||||
{
|
||||
thrift_audit_failure("Struct Field Requiredness Changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
|
||||
}
|
||||
if(newStructFieldOptional || oldStructFieldOptional)
|
||||
{
|
||||
if(!compare_defaults(newField->get_value(), oldField->get_value()))
|
||||
{
|
||||
thrift_audit_warning(1, "Default value changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
std::string fieldName = newField->get_name();
|
||||
if(fieldName != oldField->get_name())
|
||||
{
|
||||
thrift_audit_warning(1, "Struct field name changed for Id = %d in %s\n", newField->get_key(), oldStructName.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void compare_single_struct(t_struct* newStruct, t_struct* oldStruct, const std::string& oldStructName = std::string())
|
||||
{
|
||||
std::string structName = oldStructName.empty() ? oldStruct->get_name() : oldStructName;
|
||||
const std::vector<t_field*>& oldStructMembersInIdOrder = oldStruct->get_sorted_members();
|
||||
const std::vector<t_field*>& newStructMembersInIdOrder = newStruct->get_sorted_members();
|
||||
std::vector<t_field*>::const_iterator oldStructMemberIt = oldStructMembersInIdOrder.begin();
|
||||
std::vector<t_field*>::const_iterator newStructMemberIt = newStructMembersInIdOrder.begin();
|
||||
|
||||
// Since we have the struct members in their ID order, comparing their IDs can be done by traversing the two member
|
||||
// lists together.
|
||||
while(!(oldStructMemberIt == oldStructMembersInIdOrder.end() && newStructMemberIt == newStructMembersInIdOrder.end()))
|
||||
{
|
||||
if(newStructMemberIt == newStructMembersInIdOrder.end() && oldStructMemberIt != oldStructMembersInIdOrder.end())
|
||||
{
|
||||
// A field ID has been removed from the end.
|
||||
thrift_audit_failure("Struct Field removed for Id = %d in %s \n", (*oldStructMemberIt)->get_key(), structName.c_str());
|
||||
oldStructMemberIt++;
|
||||
}
|
||||
else if(newStructMemberIt != newStructMembersInIdOrder.end() && oldStructMemberIt == oldStructMembersInIdOrder.end())
|
||||
{
|
||||
//New field ID has been added to the end.
|
||||
if((*newStructMemberIt)->get_req() == t_field::T_REQUIRED)
|
||||
{
|
||||
thrift_audit_failure("Required Struct Field Added for Id = %d in %s \n", (*newStructMemberIt)->get_key(), structName.c_str());
|
||||
}
|
||||
newStructMemberIt++;
|
||||
}
|
||||
else if((*newStructMemberIt)->get_key() == (*oldStructMemberIt)->get_key())
|
||||
{
|
||||
//Field ID found in both structs. Compare field types, default values.
|
||||
compare_struct_field(*newStructMemberIt, *oldStructMemberIt, structName);
|
||||
|
||||
newStructMemberIt++;
|
||||
oldStructMemberIt++;
|
||||
}
|
||||
else if((*newStructMemberIt)->get_key() < (*oldStructMemberIt)->get_key())
|
||||
{
|
||||
//New Field Id is inserted in between
|
||||
//Adding fields to struct is fine, but adding them in the middle is suspicious. Error!!
|
||||
thrift_audit_failure("Struct field is added in the middle with Id = %d in %s\n", (*newStructMemberIt)->get_key(), structName.c_str());
|
||||
newStructMemberIt++;
|
||||
}
|
||||
else if((*newStructMemberIt)->get_key() > (*oldStructMemberIt)->get_key())
|
||||
{
|
||||
//A field is deleted in newStruct.
|
||||
thrift_audit_failure("Struct Field removed for Id = %d in %s \n", (*oldStructMemberIt)->get_key(), structName.c_str());
|
||||
oldStructMemberIt++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void compare_structs(const std::vector<t_struct*>& newStructList, const std::vector<t_struct*>& oldStructList)
|
||||
{
|
||||
std::map<std::string,t_struct*> newStructMap;
|
||||
std::vector<t_struct*>::const_iterator newStructListIt;
|
||||
for(newStructListIt = newStructList.begin(); newStructListIt != newStructList.end(); newStructListIt++)
|
||||
{
|
||||
newStructMap[(*newStructListIt)->get_name()] = *newStructListIt;
|
||||
}
|
||||
|
||||
std::vector<t_struct*>::const_iterator oldStructListIt;
|
||||
for(oldStructListIt = oldStructList.begin(); oldStructListIt != oldStructList.end(); oldStructListIt++)
|
||||
{
|
||||
std::map<std::string, t_struct*>::iterator newStructMapIt;
|
||||
newStructMapIt = newStructMap.find((*oldStructListIt)->get_name());
|
||||
if(newStructMapIt == newStructMap.end())
|
||||
{
|
||||
thrift_audit_failure("Struct %s not found in new thrift file\n", (*oldStructListIt)->get_name().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
compare_single_struct(newStructMapIt->second, *oldStructListIt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void compare_single_function(t_function* newFunction, t_function* oldFunction)
|
||||
{
|
||||
t_type* newFunctionReturnType = newFunction->get_returntype();
|
||||
|
||||
if(newFunction->is_oneway() != oldFunction->is_oneway())
|
||||
{
|
||||
thrift_audit_failure("Oneway attribute changed for function %s\n",oldFunction->get_name().c_str());
|
||||
}
|
||||
if(!compare_type(newFunctionReturnType, oldFunction->get_returntype()))
|
||||
{
|
||||
thrift_audit_failure("Return type changed for function %s\n",oldFunction->get_name().c_str());
|
||||
}
|
||||
|
||||
//Compare function arguments.
|
||||
compare_single_struct(newFunction->get_arglist(), oldFunction->get_arglist());
|
||||
std::string exceptionName = oldFunction->get_name();
|
||||
exceptionName += "_exception";
|
||||
compare_single_struct(newFunction->get_xceptions(), oldFunction->get_xceptions(), exceptionName);
|
||||
}
|
||||
|
||||
void compare_functions(const std::vector<t_function*>& newFunctionList, const std::vector<t_function*>& oldFunctionList)
|
||||
{
|
||||
std::map<std::string, t_function*> newFunctionMap;
|
||||
std::map<std::string, t_function*>::iterator newFunctionMapIt;
|
||||
for(std::vector<t_function*>::const_iterator newFunctionIt = newFunctionList.begin();
|
||||
newFunctionIt != newFunctionList.end();
|
||||
newFunctionIt++)
|
||||
{
|
||||
newFunctionMap[(*newFunctionIt)->get_name()] = *newFunctionIt;
|
||||
}
|
||||
|
||||
for(std::vector<t_function*>::const_iterator oldFunctionIt = oldFunctionList.begin();
|
||||
oldFunctionIt != oldFunctionList.end();
|
||||
oldFunctionIt++)
|
||||
{
|
||||
newFunctionMapIt = newFunctionMap.find((*oldFunctionIt)->get_name());
|
||||
if(newFunctionMapIt == newFunctionMap.end())
|
||||
{
|
||||
thrift_audit_failure("New Thrift File has missing function %s\n",(*oldFunctionIt)->get_name().c_str());
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Function is found in both thrift files. Compare return type and argument list
|
||||
compare_single_function(newFunctionMapIt->second, *oldFunctionIt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void compare_services(const std::vector<t_service*>& newServices, const std::vector<t_service*>& oldServices)
|
||||
{
|
||||
std::vector<t_service*>::const_iterator oldServiceIt;
|
||||
|
||||
std::map<std::string, t_service*> newServiceMap;
|
||||
for(std::vector<t_service*>::const_iterator newServiceIt = newServices.begin();
|
||||
newServiceIt != newServices.end();
|
||||
newServiceIt++)
|
||||
{
|
||||
newServiceMap[(*newServiceIt)->get_name()] = *newServiceIt;
|
||||
}
|
||||
|
||||
|
||||
for(oldServiceIt = oldServices.begin(); oldServiceIt != oldServices.end(); oldServiceIt++)
|
||||
{
|
||||
const std::string oldServiceName = (*oldServiceIt)->get_name();
|
||||
std::map<std::string, t_service*>::iterator newServiceMapIt = newServiceMap.find(oldServiceName);
|
||||
|
||||
if(newServiceMapIt == newServiceMap.end())
|
||||
{
|
||||
thrift_audit_failure("New Thrift file is missing a service %s\n", oldServiceName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
t_service* oldServiceExtends = (*oldServiceIt)->get_extends();
|
||||
t_service* newServiceExtends = (newServiceMapIt->second)->get_extends();
|
||||
|
||||
if(oldServiceExtends == NULL)
|
||||
{
|
||||
// It is fine to add extends. So if service in older thrift did not have any extends, we are fine.
|
||||
// DO Nothing
|
||||
}
|
||||
else if(oldServiceExtends != NULL && newServiceExtends == NULL)
|
||||
{
|
||||
thrift_audit_failure("Change in Service inheritance for %s\n", oldServiceName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string oldExtendsName = oldServiceExtends->get_name();
|
||||
std::string newExtendsName = newServiceExtends->get_name();
|
||||
|
||||
if( newExtendsName != oldExtendsName)
|
||||
{
|
||||
thrift_audit_failure("Change in Service inheritance for %s\n", oldServiceName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
compare_functions((newServiceMapIt->second)->get_functions(), (*oldServiceIt)->get_functions());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst)
|
||||
{
|
||||
std::vector<t_const*>::const_iterator newConstIt;
|
||||
std::vector<t_const*>::const_iterator oldConstIt;
|
||||
|
||||
std::map<std::string, t_const*> newConstMap;
|
||||
|
||||
for(newConstIt = newConst.begin(); newConstIt != newConst.end(); newConstIt++)
|
||||
{
|
||||
newConstMap[(*newConstIt)->get_name()] = *newConstIt;
|
||||
}
|
||||
|
||||
std::map<std::string, t_const*>::const_iterator newConstMapIt;
|
||||
for(oldConstIt = oldConst.begin(); oldConstIt != oldConst.end(); oldConstIt++)
|
||||
{
|
||||
newConstMapIt = newConstMap.find((*oldConstIt)->get_name());
|
||||
if(newConstMapIt == newConstMap.end())
|
||||
{
|
||||
thrift_audit_warning(1, "Constants Missing %s \n", ((*oldConstIt)->get_name()).c_str());
|
||||
}
|
||||
else if(!compare_type((newConstMapIt->second)->get_type(), (*oldConstIt)->get_type()))
|
||||
{
|
||||
thrift_audit_warning(1, "Constant %s is of different type \n", ((*oldConstIt)->get_name()).c_str());
|
||||
}
|
||||
else if(!compare_defaults((newConstMapIt->second)->get_value(), (*oldConstIt)->get_value()))
|
||||
{
|
||||
thrift_audit_warning(1, "Constant %s has different value\n", ((*oldConstIt)->get_name()).c_str());
|
||||
}
|
||||
}
|
||||
}
|
14
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/audit/t_audit.h
generated
vendored
14
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/audit/t_audit.h
generated
vendored
|
@ -1,14 +0,0 @@
|
|||
#ifndef T_AUDIT_H
|
||||
#define T_AUDIT_H
|
||||
|
||||
void compare_namespace(t_program* newProgram, t_program* oldProgram);
|
||||
void compare_enums(const std::vector<t_enum*>& newEnumList,
|
||||
const std::vector<t_enum*>& oldEnumList);
|
||||
bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault);
|
||||
void compare_structs(const std::vector<t_struct*>& newStructList,
|
||||
const std::vector<t_struct*>& oldStructList);
|
||||
void compare_services(const std::vector<t_service*>& newServices,
|
||||
const std::vector<t_service*>& oldServices);
|
||||
void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst);
|
||||
|
||||
#endif
|
69
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/common.cc
generated
vendored
69
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/common.cc
generated
vendored
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* 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 "thrift/common.h"
|
||||
#include "thrift/parse/t_base_type.h"
|
||||
|
||||
t_type* g_type_void;
|
||||
t_type* g_type_string;
|
||||
t_type* g_type_binary;
|
||||
t_type* g_type_slist;
|
||||
t_type* g_type_bool;
|
||||
t_type* g_type_i8;
|
||||
t_type* g_type_i16;
|
||||
t_type* g_type_i32;
|
||||
t_type* g_type_i64;
|
||||
t_type* g_type_double;
|
||||
|
||||
void initGlobals() {
|
||||
g_type_void = new t_base_type("void", t_base_type::TYPE_VOID);
|
||||
g_type_string = new t_base_type("string", t_base_type::TYPE_STRING);
|
||||
g_type_binary = new t_base_type("string", t_base_type::TYPE_STRING);
|
||||
((t_base_type*)g_type_binary)->set_binary(true);
|
||||
g_type_slist = new t_base_type("string", t_base_type::TYPE_STRING);
|
||||
((t_base_type*)g_type_slist)->set_string_list(true);
|
||||
g_type_bool = new t_base_type("bool", t_base_type::TYPE_BOOL);
|
||||
g_type_i8 = new t_base_type("i8", t_base_type::TYPE_I8);
|
||||
g_type_i16 = new t_base_type("i16", t_base_type::TYPE_I16);
|
||||
g_type_i32 = new t_base_type("i32", t_base_type::TYPE_I32);
|
||||
g_type_i64 = new t_base_type("i64", t_base_type::TYPE_I64);
|
||||
g_type_double = new t_base_type("double", t_base_type::TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void clearGlobals() {
|
||||
delete g_type_void;
|
||||
delete g_type_string;
|
||||
delete g_type_bool;
|
||||
delete g_type_i8;
|
||||
delete g_type_i16;
|
||||
delete g_type_i32;
|
||||
delete g_type_i64;
|
||||
delete g_type_double;
|
||||
}
|
||||
|
||||
/**
|
||||
* Those are not really needed for plugins but causes link errors without
|
||||
*/
|
||||
|
||||
/**
|
||||
* The location of the last parsed doctext comment.
|
||||
*/
|
||||
int g_doctext_lineno;
|
||||
int g_program_doctext_lineno = 0;
|
||||
PROGDOCTEXT_STATUS g_program_doctext_status = INVALID;
|
43
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/common.h
generated
vendored
43
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/common.h
generated
vendored
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef T_COMMON_H
|
||||
#define T_COMMON_H
|
||||
|
||||
#include "thrift/parse/t_type.h"
|
||||
|
||||
/**
|
||||
* Global types for the parser to be able to reference
|
||||
*/
|
||||
|
||||
extern t_type* g_type_void;
|
||||
extern t_type* g_type_string;
|
||||
extern t_type* g_type_binary;
|
||||
extern t_type* g_type_slist;
|
||||
extern t_type* g_type_bool;
|
||||
extern t_type* g_type_i8;
|
||||
extern t_type* g_type_i16;
|
||||
extern t_type* g_type_i32;
|
||||
extern t_type* g_type_i64;
|
||||
extern t_type* g_type_double;
|
||||
|
||||
void initGlobals();
|
||||
void clearGlobals();
|
||||
|
||||
#endif
|
2594
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_as3_generator.cc
generated
vendored
2594
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_as3_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
4587
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
generated
vendored
4587
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
558
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_cl_generator.cc
generated
vendored
558
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_cl_generator.cc
generated
vendored
|
@ -1,558 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008- Patrick Collison <patrick@collison.ie>
|
||||
* Copyright (c) 2006- Facebook
|
||||
*
|
||||
* 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 <string>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
#include "thrift/platform.h"
|
||||
#include "t_oop_generator.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
/**
|
||||
* Common Lisp code generator.
|
||||
*
|
||||
* @author Patrick Collison <patrick@collison.ie>
|
||||
*/
|
||||
class t_cl_generator : public t_oop_generator {
|
||||
public:
|
||||
t_cl_generator(
|
||||
t_program* program,
|
||||
const std::map<std::string, std::string>& parsed_options,
|
||||
const std::string& option_string)
|
||||
: t_oop_generator(program)
|
||||
{
|
||||
no_asd = false;
|
||||
system_prefix = "thrift-gen-";
|
||||
|
||||
std::map<std::string, std::string>::const_iterator iter;
|
||||
|
||||
for(iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
|
||||
if(iter->first.compare("no_asd") == 0) {
|
||||
no_asd = true;
|
||||
} else if (iter->first.compare("sys_pref") == 0) {
|
||||
system_prefix = iter->second;
|
||||
} else {
|
||||
throw "unknown option cl:" + iter->first;
|
||||
}
|
||||
}
|
||||
|
||||
out_dir_base_ = "gen-cl";
|
||||
copy_options_ = option_string;
|
||||
}
|
||||
|
||||
void init_generator();
|
||||
void close_generator();
|
||||
|
||||
void generate_typedef (t_typedef* ttypedef);
|
||||
void generate_enum (t_enum* tenum);
|
||||
void generate_const (t_const* tconst);
|
||||
void generate_struct (t_struct* tstruct);
|
||||
void generate_xception (t_struct* txception);
|
||||
void generate_service (t_service* tservice);
|
||||
void generate_cl_struct (std::ostream& out, t_struct* tstruct, bool is_exception);
|
||||
void generate_cl_struct_internal (std::ostream& out, t_struct* tstruct, bool is_exception);
|
||||
void generate_exception_sig(std::ostream& out, t_function* f);
|
||||
std::string render_const_value(t_type* type, t_const_value* value);
|
||||
|
||||
std::string cl_autogen_comment();
|
||||
void asdf_def(std::ostream &out);
|
||||
void package_def(std::ostream &out);
|
||||
void package_in(std::ostream &out);
|
||||
std::string generated_package();
|
||||
std::string prefix(std::string name);
|
||||
std::string package_of(t_program* program);
|
||||
std::string package();
|
||||
std::string render_includes();
|
||||
|
||||
std::string type_name(t_type* ttype);
|
||||
std::string typespec (t_type *t);
|
||||
std::string function_signature(t_function* tfunction);
|
||||
std::string argument_list(t_struct* tstruct);
|
||||
|
||||
std::string cl_docstring(std::string raw);
|
||||
|
||||
private:
|
||||
|
||||
int temporary_var;
|
||||
/**
|
||||
* Isolate the variable definitions, as they can require structure definitions
|
||||
*/
|
||||
ofstream_with_content_based_conditional_update f_asd_;
|
||||
ofstream_with_content_based_conditional_update f_types_;
|
||||
ofstream_with_content_based_conditional_update f_vars_;
|
||||
|
||||
std::string copy_options_;
|
||||
|
||||
bool no_asd;
|
||||
std::string system_prefix;
|
||||
};
|
||||
|
||||
|
||||
void t_cl_generator::init_generator() {
|
||||
MKDIR(get_out_dir().c_str());
|
||||
string program_dir = get_out_dir() + "/" + program_name_;
|
||||
MKDIR(program_dir.c_str());
|
||||
|
||||
temporary_var = 0;
|
||||
|
||||
string f_types_name = program_dir + "/" + program_name_ + "-types.lisp";
|
||||
string f_vars_name = program_dir + "/" + program_name_ + "-vars.lisp";
|
||||
|
||||
f_types_.open(f_types_name.c_str());
|
||||
f_types_ << cl_autogen_comment() << endl;
|
||||
f_vars_.open(f_vars_name.c_str());
|
||||
f_vars_ << cl_autogen_comment() << endl;
|
||||
|
||||
package_def(f_types_);
|
||||
package_in(f_types_);
|
||||
package_in(f_vars_);
|
||||
|
||||
if (!no_asd) {
|
||||
string f_asd_name = program_dir + "/" + system_prefix + program_name_ + ".asd";
|
||||
f_asd_.open(f_asd_name.c_str());
|
||||
f_asd_ << cl_autogen_comment() << endl;
|
||||
asdf_def(f_asd_);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders all the imports necessary for including another Thrift program
|
||||
*/
|
||||
string t_cl_generator::render_includes() {
|
||||
const vector<t_program*>& includes = program_->get_includes();
|
||||
string result = "";
|
||||
result += ":depends-on (:thrift";
|
||||
for (size_t i = 0; i < includes.size(); ++i) {
|
||||
result += " :" + system_prefix + underscore(includes[i]->get_name());
|
||||
}
|
||||
result += ")\n";
|
||||
return result;
|
||||
}
|
||||
|
||||
string t_cl_generator::package_of(t_program* program) {
|
||||
string prefix = program->get_namespace("cl");
|
||||
return prefix.empty() ? "thrift-generated" : prefix;
|
||||
}
|
||||
|
||||
string t_cl_generator::package() {
|
||||
return package_of(program_);
|
||||
}
|
||||
|
||||
string t_cl_generator::prefix(string symbol) {
|
||||
return "\"" + symbol + "\"";
|
||||
}
|
||||
|
||||
string t_cl_generator::cl_autogen_comment() {
|
||||
return
|
||||
std::string(";;; ") + "Autogenerated by Thrift\n" +
|
||||
";;; DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n" +
|
||||
";;; options string: " + copy_options_ + "\n";
|
||||
}
|
||||
|
||||
string t_cl_generator::cl_docstring(string raw) {
|
||||
replace(raw.begin(), raw.end(), '"', '\'');
|
||||
return raw;
|
||||
}
|
||||
|
||||
|
||||
void t_cl_generator::close_generator() {
|
||||
f_asd_.close();
|
||||
f_types_.close();
|
||||
f_vars_.close();
|
||||
}
|
||||
|
||||
string t_cl_generator::generated_package() {
|
||||
return program_->get_namespace("cpp");
|
||||
}
|
||||
|
||||
void t_cl_generator::asdf_def(std::ostream &out) {
|
||||
out << "(asdf:defsystem #:" << system_prefix << program_name_ << endl;
|
||||
indent_up();
|
||||
out << indent() << render_includes()
|
||||
<< indent() << ":serial t" << endl
|
||||
<< indent() << ":components ("
|
||||
<< "(:file \"" << program_name_ << "-types\") "
|
||||
<< "(:file \"" << program_name_ << "-vars\")))" << endl;
|
||||
indent_down();
|
||||
}
|
||||
|
||||
/***
|
||||
* Generate a package definition. Add use references equivalent to the idl file's include statements.
|
||||
*/
|
||||
void t_cl_generator::package_def(std::ostream &out) {
|
||||
const vector<t_program*>& includes = program_->get_includes();
|
||||
|
||||
out << "(thrift:def-package :" << package();
|
||||
if ( includes.size() > 0 ) {
|
||||
out << " :use (";
|
||||
for (size_t i = 0; i < includes.size(); ++i) {
|
||||
out << " :" << includes[i]->get_name();
|
||||
}
|
||||
out << ")";
|
||||
}
|
||||
out << ")" << endl << endl;
|
||||
}
|
||||
|
||||
void t_cl_generator::package_in(std::ostream &out) {
|
||||
out << "(cl:in-package :" << package() << ")" << endl << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a typedef. This is not done in Common Lisp, types are all implicit.
|
||||
*
|
||||
* @param ttypedef The type definition
|
||||
*/
|
||||
void t_cl_generator::generate_typedef(t_typedef* ttypedef) {
|
||||
(void)ttypedef;
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_enum(t_enum* tenum) {
|
||||
f_types_ << "(thrift:def-enum " << prefix(tenum->get_name()) << endl;
|
||||
|
||||
vector<t_enum_value*> constants = tenum->get_constants();
|
||||
vector<t_enum_value*>::iterator c_iter;
|
||||
int value = -1;
|
||||
|
||||
indent_up();
|
||||
f_types_ << indent() << "(";
|
||||
for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
|
||||
value = (*c_iter)->get_value();
|
||||
|
||||
if(c_iter != constants.begin()) f_types_ << endl << indent() << " ";
|
||||
|
||||
f_types_ << "(\"" << (*c_iter)->get_name() << "\" . " << value << ")";
|
||||
}
|
||||
indent_down();
|
||||
f_types_ << "))" << endl << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a constant value
|
||||
*/
|
||||
void t_cl_generator::generate_const(t_const* tconst) {
|
||||
t_type* type = tconst->get_type();
|
||||
string name = tconst->get_name();
|
||||
t_const_value* value = tconst->get_value();
|
||||
|
||||
f_vars_ << "(thrift:def-constant " << prefix(name) << " " << render_const_value(type, value) << ")"
|
||||
<< endl << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the value of a constant with the given type. Note that type checking
|
||||
* is NOT performed in this function as it is always run beforehand using the
|
||||
* validate_types method in main.cc
|
||||
*/
|
||||
string t_cl_generator::render_const_value(t_type* type, t_const_value* value) {
|
||||
type = get_true_type(type);
|
||||
std::ostringstream out;
|
||||
if (type->is_base_type()) {
|
||||
t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
|
||||
switch (tbase) {
|
||||
case t_base_type::TYPE_STRING:
|
||||
out << "\"" << value->get_string() << "\"";
|
||||
break;
|
||||
case t_base_type::TYPE_BOOL:
|
||||
out << (value->get_integer() > 0 ? "t" : "nil");
|
||||
break;
|
||||
case t_base_type::TYPE_I8:
|
||||
case t_base_type::TYPE_I16:
|
||||
case t_base_type::TYPE_I32:
|
||||
case t_base_type::TYPE_I64:
|
||||
out << value->get_integer();
|
||||
break;
|
||||
case t_base_type::TYPE_DOUBLE:
|
||||
if (value->get_type() == t_const_value::CV_INTEGER) {
|
||||
out << value->get_integer();
|
||||
} else {
|
||||
out << value->get_double();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
|
||||
}
|
||||
} else if (type->is_enum()) {
|
||||
indent(out) << value->get_integer();
|
||||
} else if (type->is_struct() || type->is_xception()) {
|
||||
out << (type->is_struct() ? "(make-instance '" : "(make-exception '") <<
|
||||
lowercase(type->get_name()) << " " << endl;
|
||||
indent_up();
|
||||
|
||||
const vector<t_field*>& fields = ((t_struct*)type)->get_members();
|
||||
vector<t_field*>::const_iterator f_iter;
|
||||
const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
|
||||
map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
|
||||
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
t_type* field_type = NULL;
|
||||
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
|
||||
if ((*f_iter)->get_name() == v_iter->first->get_string()) {
|
||||
field_type = (*f_iter)->get_type();
|
||||
}
|
||||
}
|
||||
if (field_type == NULL) {
|
||||
throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
|
||||
}
|
||||
|
||||
out << indent() << ":" << v_iter->first->get_string() << " " <<
|
||||
render_const_value(field_type, v_iter->second) << endl;
|
||||
}
|
||||
out << indent() << ")";
|
||||
|
||||
indent_down();
|
||||
} else if (type->is_map()) {
|
||||
// emit an hash form with both keys and values to be evaluated
|
||||
t_type* ktype = ((t_map*)type)->get_key_type();
|
||||
t_type* vtype = ((t_map*)type)->get_val_type();
|
||||
out << "(thrift:map ";
|
||||
indent_up();
|
||||
const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
|
||||
map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
out << endl << indent()
|
||||
<< "(cl:cons " << render_const_value(ktype, v_iter->first) << " "
|
||||
<< render_const_value(vtype, v_iter->second) << ")";
|
||||
}
|
||||
indent_down();
|
||||
out << indent() << ")";
|
||||
} else if (type->is_list() || type->is_set()) {
|
||||
t_type* etype;
|
||||
if (type->is_list()) {
|
||||
etype = ((t_list*)type)->get_elem_type();
|
||||
} else {
|
||||
etype = ((t_set*)type)->get_elem_type();
|
||||
}
|
||||
if (type->is_set()) {
|
||||
out << "(thrift:set" << endl;
|
||||
} else {
|
||||
out << "(thrift:list" << endl;
|
||||
}
|
||||
indent_up();
|
||||
indent_up();
|
||||
const vector<t_const_value*>& val = value->get_list();
|
||||
vector<t_const_value*>::const_iterator v_iter;
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
out << indent() << render_const_value(etype, *v_iter) << endl;
|
||||
}
|
||||
out << indent() << ")";
|
||||
indent_down();
|
||||
indent_down();
|
||||
} else {
|
||||
throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
|
||||
}
|
||||
return out.str();
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_struct(t_struct* tstruct) {
|
||||
generate_cl_struct(f_types_, tstruct, false);
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_xception(t_struct* txception) {
|
||||
generate_cl_struct(f_types_, txception, true);
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_cl_struct_internal(std::ostream& out, t_struct* tstruct, bool is_exception) {
|
||||
(void)is_exception;
|
||||
const vector<t_field*>& members = tstruct->get_members();
|
||||
vector<t_field*>::const_iterator m_iter;
|
||||
|
||||
out << "(";
|
||||
|
||||
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
|
||||
t_const_value* value = (*m_iter)->get_value();
|
||||
t_type* type = (*m_iter)->get_type();
|
||||
|
||||
if (m_iter != members.begin()) {
|
||||
out << endl << indent() << " ";
|
||||
}
|
||||
out << "(" << prefix((*m_iter)->get_name()) << " " <<
|
||||
( (NULL != value) ? render_const_value(type, value) : "nil" ) <<
|
||||
" :id " << (*m_iter)->get_key();
|
||||
if ( type->is_base_type() && "string" == typespec(type) )
|
||||
if ( ((t_base_type*)type)->is_binary() )
|
||||
out << " :type binary";
|
||||
else
|
||||
out << " :type string";
|
||||
else
|
||||
out << " :type " << typespec(type);
|
||||
if ( (*m_iter)->get_req() == t_field::T_OPTIONAL ) {
|
||||
out << " :optional t";
|
||||
}
|
||||
if ( (*m_iter)->has_doc()) {
|
||||
out << " :documentation \"" << cl_docstring((*m_iter)->get_doc()) << "\"";
|
||||
}
|
||||
out <<")";
|
||||
}
|
||||
|
||||
out << ")";
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_cl_struct(std::ostream& out, t_struct* tstruct, bool is_exception = false) {
|
||||
std::string name = type_name(tstruct);
|
||||
out << (is_exception ? "(thrift:def-exception " : "(thrift:def-struct ") <<
|
||||
prefix(name) << endl;
|
||||
indent_up();
|
||||
if ( tstruct->has_doc() ) {
|
||||
out << indent() ;
|
||||
out << "\"" << cl_docstring(tstruct->get_doc()) << "\"" << endl;
|
||||
}
|
||||
out << indent() ;
|
||||
generate_cl_struct_internal(out, tstruct, is_exception);
|
||||
indent_down();
|
||||
out << ")" << endl << endl;
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_exception_sig(std::ostream& out, t_function* f) {
|
||||
generate_cl_struct_internal(out, f->get_xceptions(), true);
|
||||
}
|
||||
|
||||
void t_cl_generator::generate_service(t_service* tservice) {
|
||||
string extends_client;
|
||||
vector<t_function*> functions = tservice->get_functions();
|
||||
vector<t_function*>::iterator f_iter;
|
||||
|
||||
if (tservice->get_extends() != NULL) {
|
||||
extends_client = type_name(tservice->get_extends());
|
||||
}
|
||||
|
||||
extends_client = extends_client.empty() ? "nil" : prefix(extends_client);
|
||||
|
||||
f_types_ << "(thrift:def-service " << prefix(service_name_) << " "
|
||||
<< extends_client;
|
||||
|
||||
indent_up();
|
||||
|
||||
if ( tservice->has_doc()) {
|
||||
f_types_ << endl << indent()
|
||||
<< "(:documentation \"" << cl_docstring(tservice->get_doc()) << "\")";
|
||||
}
|
||||
|
||||
for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
|
||||
t_function* function = *f_iter;
|
||||
string fname = function->get_name();
|
||||
string signature = function_signature(function);
|
||||
t_struct* exceptions = function->get_xceptions();
|
||||
const vector<t_field*>& xmembers = exceptions->get_members();
|
||||
|
||||
f_types_ << endl << indent() << "(:method " << prefix(fname);
|
||||
f_types_ << " (" << signature << " " << typespec((*f_iter)->get_returntype()) << ")";
|
||||
if (xmembers.size() > 0) {
|
||||
f_types_ << endl << indent() << " :exceptions " ;
|
||||
generate_exception_sig(f_types_, function);
|
||||
}
|
||||
if ( (*f_iter)->is_oneway() ) {
|
||||
f_types_ << endl << indent() << " :oneway t";
|
||||
}
|
||||
if ( (*f_iter)->has_doc() ) {
|
||||
f_types_ << endl << indent() << " :documentation \""
|
||||
<< cl_docstring((*f_iter)->get_doc()) << "\"";
|
||||
}
|
||||
f_types_ << ")";
|
||||
}
|
||||
|
||||
f_types_ << ")" << endl << endl;
|
||||
|
||||
indent_down();
|
||||
}
|
||||
|
||||
string t_cl_generator::typespec(t_type *t) {
|
||||
t = get_true_type(t);
|
||||
|
||||
if (t -> is_binary()){
|
||||
return "binary";
|
||||
} else if (t->is_base_type()) {
|
||||
return type_name(t);
|
||||
} else if (t->is_map()) {
|
||||
t_map *m = (t_map*) t;
|
||||
return "(thrift:map " + typespec(m->get_key_type()) + " " +
|
||||
typespec(m->get_val_type()) + ")";
|
||||
} else if (t->is_struct() || t->is_xception()) {
|
||||
return "(struct " + prefix(type_name(t)) + ")";
|
||||
} else if (t->is_list()) {
|
||||
return "(thrift:list " + typespec(((t_list*) t)->get_elem_type()) + ")";
|
||||
} else if (t->is_set()) {
|
||||
return "(thrift:set " + typespec(((t_set*) t)->get_elem_type()) + ")";
|
||||
} else if (t->is_enum()) {
|
||||
return "(enum \"" + ((t_enum*) t)->get_name() + "\")";
|
||||
} else {
|
||||
throw "Sorry, I don't know how to generate this: " + type_name(t);
|
||||
}
|
||||
}
|
||||
|
||||
string t_cl_generator::function_signature(t_function* tfunction) {
|
||||
return argument_list(tfunction->get_arglist());
|
||||
}
|
||||
|
||||
string t_cl_generator::argument_list(t_struct* tstruct) {
|
||||
stringstream res;
|
||||
res << "(";
|
||||
|
||||
const vector<t_field*>& fields = tstruct->get_members();
|
||||
vector<t_field*>::const_iterator f_iter;
|
||||
bool first = true;
|
||||
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
res << " ";
|
||||
}
|
||||
res << "(" + prefix((*f_iter)->get_name()) << " " <<
|
||||
typespec((*f_iter)->get_type()) << " " <<
|
||||
(*f_iter)->get_key() << ")";
|
||||
|
||||
|
||||
}
|
||||
res << ")";
|
||||
return res.str();
|
||||
}
|
||||
|
||||
string t_cl_generator::type_name(t_type* ttype) {
|
||||
string prefix = "";
|
||||
t_program* program = ttype->get_program();
|
||||
|
||||
if (program != NULL && program != program_)
|
||||
prefix = package_of(program) == package() ? "" : package_of(program) + ":";
|
||||
|
||||
string name = ttype->get_name();
|
||||
|
||||
if (ttype->is_struct() || ttype->is_xception())
|
||||
name = lowercase(ttype->get_name());
|
||||
|
||||
return prefix + name;
|
||||
}
|
||||
|
||||
THRIFT_REGISTER_GENERATOR(
|
||||
cl,
|
||||
"Common Lisp",
|
||||
" no_asd: Do not define ASDF systems for each generated Thrift program.\n"
|
||||
" sys_pref= The prefix to give ASDF system names. Default: thrift-gen-\n")
|
3309
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_cocoa_generator.cc
generated
vendored
3309
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_cocoa_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
4489
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
generated
vendored
4489
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
3242
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_csharp_generator.cc
generated
vendored
3242
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_csharp_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
742
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_d_generator.cc
generated
vendored
742
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_d_generator.cc
generated
vendored
|
@ -1,742 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
* Contains some contributions under the Thrift Software License.
|
||||
* Please see doc/old-thrift-license.txt in the Thrift distribution for
|
||||
* details.
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "thrift/platform.h"
|
||||
#include "thrift/generate/t_oop_generator.h"
|
||||
|
||||
using std::map;
|
||||
using std::ofstream;
|
||||
using std::ostream;
|
||||
using std::ostringstream;
|
||||
using std::set;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
static const string endl = "\n"; // avoid ostream << std::endl flushes
|
||||
|
||||
/**
|
||||
* D code generator.
|
||||
*
|
||||
* generate_*() functions are called by the base class to emit code for the
|
||||
* given entity, print_*() functions write a piece of code to the passed
|
||||
* stream, and render_*() return a string containing the D representation of
|
||||
* the passed entity.
|
||||
*/
|
||||
class t_d_generator : public t_oop_generator {
|
||||
public:
|
||||
t_d_generator(t_program* program,
|
||||
const std::map<string, string>& parsed_options,
|
||||
const string& option_string)
|
||||
: t_oop_generator(program) {
|
||||
(void)option_string;
|
||||
std::map<std::string, std::string>::const_iterator iter;
|
||||
|
||||
/* no options yet */
|
||||
for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
|
||||
throw "unknown option d:" + iter->first;
|
||||
}
|
||||
|
||||
out_dir_base_ = "gen-d";
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void init_generator() {
|
||||
// Make output directory
|
||||
MKDIR(get_out_dir().c_str());
|
||||
|
||||
string dir = program_->get_namespace("d");
|
||||
string subdir = get_out_dir();
|
||||
string::size_type loc;
|
||||
while ((loc = dir.find(".")) != string::npos) {
|
||||
subdir = subdir + "/" + dir.substr(0, loc);
|
||||
MKDIR(subdir.c_str());
|
||||
dir = dir.substr(loc + 1);
|
||||
}
|
||||
if (!dir.empty()) {
|
||||
subdir = subdir + "/" + dir;
|
||||
MKDIR(subdir.c_str());
|
||||
}
|
||||
|
||||
package_dir_ = subdir + "/";
|
||||
|
||||
// Make output file
|
||||
string f_types_name = package_dir_ + program_name_ + "_types.d";
|
||||
f_types_.open(f_types_name.c_str());
|
||||
|
||||
// Print header
|
||||
f_types_ << autogen_comment() << "module " << render_package(*program_) << program_name_
|
||||
<< "_types;" << endl << endl;
|
||||
|
||||
print_default_imports(f_types_);
|
||||
|
||||
// Include type modules from other imported programs.
|
||||
const vector<t_program*>& includes = program_->get_includes();
|
||||
for (size_t i = 0; i < includes.size(); ++i) {
|
||||
f_types_ << "public import " << render_package(*(includes[i])) << includes[i]->get_name()
|
||||
<< "_types;" << endl;
|
||||
}
|
||||
if (!includes.empty())
|
||||
f_types_ << endl;
|
||||
}
|
||||
|
||||
virtual void close_generator() {
|
||||
// Close output file
|
||||
f_types_.close();
|
||||
}
|
||||
|
||||
virtual void generate_consts(std::vector<t_const*> consts) {
|
||||
if (!consts.empty()) {
|
||||
string f_consts_name = package_dir_ + program_name_ + "_constants.d";
|
||||
ofstream_with_content_based_conditional_update f_consts;
|
||||
f_consts.open(f_consts_name.c_str());
|
||||
|
||||
f_consts << autogen_comment() << "module " << render_package(*program_) << program_name_
|
||||
<< "_constants;" << endl << endl;
|
||||
|
||||
print_default_imports(f_consts);
|
||||
|
||||
f_consts << "import " << render_package(*get_program()) << program_name_ << "_types;" << endl
|
||||
<< endl;
|
||||
|
||||
vector<t_const*>::iterator c_iter;
|
||||
for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
|
||||
this->emit_doc(*c_iter, f_consts);
|
||||
string name = (*c_iter)->get_name();
|
||||
t_type* type = (*c_iter)->get_type();
|
||||
indent(f_consts) << "immutable(" << render_type_name(type) << ") " << name << ";" << endl;
|
||||
}
|
||||
|
||||
f_consts << endl << "static this() {" << endl;
|
||||
indent_up();
|
||||
|
||||
bool first = true;
|
||||
for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
f_consts << endl;
|
||||
}
|
||||
t_type* type = (*c_iter)->get_type();
|
||||
indent(f_consts) << (*c_iter)->get_name() << " = ";
|
||||
if (!is_immutable_type(type)) {
|
||||
f_consts << "cast(immutable(" << render_type_name(type) << ")) ";
|
||||
}
|
||||
f_consts << render_const_value(type, (*c_iter)->get_value()) << ";" << endl;
|
||||
}
|
||||
indent_down();
|
||||
indent(f_consts) << "}" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void generate_typedef(t_typedef* ttypedef) {
|
||||
this->emit_doc(ttypedef, f_types_);
|
||||
f_types_ << indent() << "alias " << render_type_name(ttypedef->get_type()) << " "
|
||||
<< ttypedef->get_symbolic() << ";" << endl << endl;
|
||||
}
|
||||
|
||||
virtual void generate_enum(t_enum* tenum) {
|
||||
vector<t_enum_value*> constants = tenum->get_constants();
|
||||
|
||||
this->emit_doc(tenum, f_types_);
|
||||
string enum_name = tenum->get_name();
|
||||
f_types_ << indent() << "enum " << enum_name << " {" << endl;
|
||||
|
||||
indent_up();
|
||||
|
||||
vector<t_enum_value*>::const_iterator c_iter;
|
||||
for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
|
||||
this->emit_doc(*c_iter, f_types_);
|
||||
indent(f_types_) << (*c_iter)->get_name();
|
||||
f_types_ << " = " << (*c_iter)->get_value() << ",";
|
||||
}
|
||||
|
||||
f_types_ << endl;
|
||||
indent_down();
|
||||
indent(f_types_) << "}" << endl;
|
||||
|
||||
f_types_ << endl;
|
||||
}
|
||||
|
||||
virtual void generate_struct(t_struct* tstruct) {
|
||||
print_struct_definition(f_types_, tstruct, false);
|
||||
}
|
||||
|
||||
virtual void generate_xception(t_struct* txception) {
|
||||
print_struct_definition(f_types_, txception, true);
|
||||
}
|
||||
|
||||
virtual void generate_service(t_service* tservice) {
|
||||
string svc_name = tservice->get_name();
|
||||
|
||||
// Service implementation file includes
|
||||
string f_servicename = package_dir_ + svc_name + ".d";
|
||||
ofstream_with_content_based_conditional_update f_service;
|
||||
f_service.open(f_servicename.c_str());
|
||||
f_service << autogen_comment() << "module " << render_package(*program_) << svc_name << ";"
|
||||
<< endl << endl;
|
||||
|
||||
print_default_imports(f_service);
|
||||
|
||||
f_service << "import " << render_package(*get_program()) << program_name_ << "_types;" << endl;
|
||||
|
||||
t_service* extends_service = tservice->get_extends();
|
||||
if (extends_service != NULL) {
|
||||
f_service << "import " << render_package(*(extends_service->get_program()))
|
||||
<< extends_service->get_name() << ";" << endl;
|
||||
}
|
||||
|
||||
f_service << endl;
|
||||
|
||||
string extends = "";
|
||||
if (tservice->get_extends() != NULL) {
|
||||
extends = " : " + render_type_name(tservice->get_extends());
|
||||
}
|
||||
|
||||
this->emit_doc(tservice, f_service);
|
||||
f_service << indent() << "interface " << svc_name << extends << " {" << endl;
|
||||
indent_up();
|
||||
|
||||
// Collect all the exception types service methods can throw so we can
|
||||
// emit the necessary aliases later.
|
||||
set<t_type*> exception_types;
|
||||
|
||||
// Print the method signatures.
|
||||
vector<t_function*> functions = tservice->get_functions();
|
||||
vector<t_function*>::iterator fn_iter;
|
||||
for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {
|
||||
this->emit_doc(*fn_iter, f_service);
|
||||
f_service << indent();
|
||||
print_function_signature(f_service, *fn_iter);
|
||||
f_service << ";" << endl;
|
||||
|
||||
const vector<t_field*>& exceptions = (*fn_iter)->get_xceptions()->get_members();
|
||||
vector<t_field*>::const_iterator ex_iter;
|
||||
for (ex_iter = exceptions.begin(); ex_iter != exceptions.end(); ++ex_iter) {
|
||||
exception_types.insert((*ex_iter)->get_type());
|
||||
}
|
||||
}
|
||||
|
||||
// Alias the exception types into the current scope.
|
||||
if (!exception_types.empty())
|
||||
f_service << endl;
|
||||
set<t_type*>::const_iterator et_iter;
|
||||
for (et_iter = exception_types.begin(); et_iter != exception_types.end(); ++et_iter) {
|
||||
indent(f_service) << "alias " << render_package(*(*et_iter)->get_program())
|
||||
<< (*et_iter)->get_program()->get_name() << "_types"
|
||||
<< "." << (*et_iter)->get_name() << " " << (*et_iter)->get_name() << ";"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Write the method metadata.
|
||||
ostringstream meta;
|
||||
indent_up();
|
||||
bool first = true;
|
||||
for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {
|
||||
if ((*fn_iter)->get_arglist()->get_members().empty()
|
||||
&& (*fn_iter)->get_xceptions()->get_members().empty() && !(*fn_iter)->is_oneway()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
meta << ",";
|
||||
}
|
||||
|
||||
meta << endl << indent() << "TMethodMeta(`" << (*fn_iter)->get_name() << "`, " << endl;
|
||||
indent_up();
|
||||
indent(meta) << "[";
|
||||
|
||||
bool first = true;
|
||||
const vector<t_field*>& params = (*fn_iter)->get_arglist()->get_members();
|
||||
vector<t_field*>::const_iterator p_iter;
|
||||
for (p_iter = params.begin(); p_iter != params.end(); ++p_iter) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
meta << ", ";
|
||||
}
|
||||
|
||||
meta << "TParamMeta(`" << (*p_iter)->get_name() << "`, " << (*p_iter)->get_key();
|
||||
|
||||
t_const_value* cv = (*p_iter)->get_value();
|
||||
if (cv != NULL) {
|
||||
meta << ", q{" << render_const_value((*p_iter)->get_type(), cv) << "}";
|
||||
}
|
||||
meta << ")";
|
||||
}
|
||||
|
||||
meta << "]";
|
||||
|
||||
if (!(*fn_iter)->get_xceptions()->get_members().empty() || (*fn_iter)->is_oneway()) {
|
||||
meta << "," << endl << indent() << "[";
|
||||
|
||||
bool first = true;
|
||||
const vector<t_field*>& exceptions = (*fn_iter)->get_xceptions()->get_members();
|
||||
vector<t_field*>::const_iterator ex_iter;
|
||||
for (ex_iter = exceptions.begin(); ex_iter != exceptions.end(); ++ex_iter) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
meta << ", ";
|
||||
}
|
||||
|
||||
meta << "TExceptionMeta(`" << (*ex_iter)->get_name() << "`, " << (*ex_iter)->get_key()
|
||||
<< ", `" << (*ex_iter)->get_type()->get_name() << "`)";
|
||||
}
|
||||
|
||||
meta << "]";
|
||||
}
|
||||
|
||||
if ((*fn_iter)->is_oneway()) {
|
||||
meta << "," << endl << indent() << "TMethodType.ONEWAY";
|
||||
}
|
||||
|
||||
indent_down();
|
||||
meta << endl << indent() << ")";
|
||||
}
|
||||
indent_down();
|
||||
|
||||
string meta_str(meta.str());
|
||||
if (!meta_str.empty()) {
|
||||
f_service << endl << indent() << "enum methodMeta = [" << meta_str << endl << indent() << "];"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
indent_down();
|
||||
indent(f_service) << "}" << endl;
|
||||
|
||||
// Server skeleton generation.
|
||||
string f_skeletonname = package_dir_ + svc_name + "_server.skeleton.d";
|
||||
ofstream_with_content_based_conditional_update f_skeleton;
|
||||
f_skeleton.open(f_skeletonname.c_str());
|
||||
print_server_skeleton(f_skeleton, tservice);
|
||||
f_skeleton.close();
|
||||
}
|
||||
|
||||
void emit_doc(t_doc *doc, std::ostream& out) {
|
||||
if (!doc->has_doc()) {
|
||||
return;
|
||||
}
|
||||
indent(out) << "/**" << std::endl;
|
||||
indent_up();
|
||||
// No endl -- comments reliably have a newline at the end.
|
||||
// This is true even for stuff like:
|
||||
// /** method infos */ void foo(/** huh?*/ 1: i64 stuff)
|
||||
indent(out) << doc->get_doc();
|
||||
indent_down();
|
||||
indent(out) << "*/" << std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Writes a server skeleton for the passed service to out.
|
||||
*/
|
||||
void print_server_skeleton(ostream& out, t_service* tservice) {
|
||||
string svc_name = tservice->get_name();
|
||||
|
||||
out << "/*" << endl
|
||||
<< " * This auto-generated skeleton file illustrates how to build a server. If you" << endl
|
||||
<< " * intend to customize it, you should edit a copy with another file name to " << endl
|
||||
<< " * avoid overwriting it when running the generator again." << endl << " */" << endl
|
||||
<< "module " << render_package(*tservice->get_program()) << svc_name << "_server;" << endl
|
||||
<< endl << "import std.stdio;" << endl << "import thrift.codegen.processor;" << endl
|
||||
<< "import thrift.protocol.binary;" << endl << "import thrift.server.simple;" << endl
|
||||
<< "import thrift.server.transport.socket;" << endl << "import thrift.transport.buffered;"
|
||||
<< endl << "import thrift.util.hashset;" << endl << endl << "import "
|
||||
<< render_package(*tservice->get_program()) << svc_name << ";" << endl << "import "
|
||||
<< render_package(*get_program()) << program_name_ << "_types;" << endl << endl << endl
|
||||
<< "class " << svc_name << "Handler : " << svc_name << " {" << endl;
|
||||
|
||||
indent_up();
|
||||
out << indent() << "this() {" << endl << indent() << " // Your initialization goes here."
|
||||
<< endl << indent() << "}" << endl << endl;
|
||||
|
||||
vector<t_function*> functions = tservice->get_functions();
|
||||
vector<t_function*>::iterator f_iter;
|
||||
for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
|
||||
out << indent();
|
||||
print_function_signature(out, *f_iter);
|
||||
out << " {" << endl;
|
||||
|
||||
indent_up();
|
||||
|
||||
out << indent() << "// Your implementation goes here." << endl << indent() << "writeln(\""
|
||||
<< (*f_iter)->get_name() << " called\");" << endl;
|
||||
|
||||
t_type* rt = (*f_iter)->get_returntype();
|
||||
if (!rt->is_void()) {
|
||||
indent(out) << "return typeof(return).init;" << endl;
|
||||
}
|
||||
|
||||
indent_down();
|
||||
|
||||
out << indent() << "}" << endl << endl;
|
||||
}
|
||||
|
||||
indent_down();
|
||||
out << "}" << endl << endl;
|
||||
|
||||
out << indent() << "void main() {" << endl;
|
||||
indent_up();
|
||||
out << indent() << "auto protocolFactory = new TBinaryProtocolFactory!();" << endl << indent()
|
||||
<< "auto processor = new TServiceProcessor!" << svc_name << "(new " << svc_name
|
||||
<< "Handler);" << endl << indent() << "auto serverTransport = new TServerSocket(9090);"
|
||||
<< endl << indent() << "auto transportFactory = new TBufferedTransportFactory;" << endl
|
||||
<< indent() << "auto server = new TSimpleServer(" << endl << indent()
|
||||
<< " processor, serverTransport, transportFactory, protocolFactory);" << endl << indent()
|
||||
<< "server.serve();" << endl;
|
||||
indent_down();
|
||||
out << "}" << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the definition of a struct or an exception type to out.
|
||||
*/
|
||||
void print_struct_definition(ostream& out, t_struct* tstruct, bool is_exception) {
|
||||
const vector<t_field*>& members = tstruct->get_members();
|
||||
|
||||
if (is_exception) {
|
||||
indent(out) << "class " << tstruct->get_name() << " : TException {" << endl;
|
||||
} else {
|
||||
indent(out) << "struct " << tstruct->get_name() << " {" << endl;
|
||||
}
|
||||
indent_up();
|
||||
|
||||
// Declare all fields.
|
||||
vector<t_field*>::const_iterator m_iter;
|
||||
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
|
||||
indent(out) << render_type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name() << ";"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (!members.empty())
|
||||
indent(out) << endl;
|
||||
indent(out) << "mixin TStructHelpers!(";
|
||||
|
||||
if (!members.empty()) {
|
||||
// If there are any fields, construct the TFieldMeta array to pass to
|
||||
// TStructHelpers. We can't just pass an empty array if not because []
|
||||
// doesn't pass the TFieldMeta[] constraint.
|
||||
out << "[";
|
||||
indent_up();
|
||||
|
||||
bool first = true;
|
||||
vector<t_field*>::const_iterator m_iter;
|
||||
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
out << ",";
|
||||
}
|
||||
out << endl;
|
||||
|
||||
indent(out) << "TFieldMeta(`" << (*m_iter)->get_name() << "`, " << (*m_iter)->get_key();
|
||||
|
||||
t_const_value* cv = (*m_iter)->get_value();
|
||||
t_field::e_req req = (*m_iter)->get_req();
|
||||
out << ", " << render_req(req);
|
||||
if (cv != NULL) {
|
||||
out << ", q{" << render_const_value((*m_iter)->get_type(), cv) << "}";
|
||||
}
|
||||
out << ")";
|
||||
}
|
||||
|
||||
indent_down();
|
||||
out << endl << indent() << "]";
|
||||
}
|
||||
|
||||
out << ");" << endl;
|
||||
|
||||
indent_down();
|
||||
indent(out) << "}" << endl << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the D function signature (including return type) for the given
|
||||
* method.
|
||||
*/
|
||||
void print_function_signature(ostream& out, t_function* fn) {
|
||||
out << render_type_name(fn->get_returntype()) << " " << fn->get_name() << "(";
|
||||
|
||||
const vector<t_field*>& fields = fn->get_arglist()->get_members();
|
||||
vector<t_field*>::const_iterator f_iter;
|
||||
bool first = true;
|
||||
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
out << ", ";
|
||||
}
|
||||
out << render_type_name((*f_iter)->get_type(), true) << " " << (*f_iter)->get_name();
|
||||
}
|
||||
|
||||
out << ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the D representation of value. The result is guaranteed to be a
|
||||
* single expression; for complex types, immediately called delegate
|
||||
* literals are used to achieve this.
|
||||
*/
|
||||
string render_const_value(t_type* type, t_const_value* value) {
|
||||
// Resolve any typedefs.
|
||||
type = get_true_type(type);
|
||||
|
||||
ostringstream out;
|
||||
if (type->is_base_type()) {
|
||||
t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
|
||||
switch (tbase) {
|
||||
case t_base_type::TYPE_STRING:
|
||||
out << '"' << get_escaped_string(value) << '"';
|
||||
break;
|
||||
case t_base_type::TYPE_BOOL:
|
||||
out << ((value->get_integer() > 0) ? "true" : "false");
|
||||
break;
|
||||
case t_base_type::TYPE_I8:
|
||||
case t_base_type::TYPE_I16:
|
||||
out << "cast(" << render_type_name(type) << ")" << value->get_integer();
|
||||
break;
|
||||
case t_base_type::TYPE_I32:
|
||||
out << value->get_integer();
|
||||
break;
|
||||
case t_base_type::TYPE_I64:
|
||||
out << value->get_integer() << "L";
|
||||
break;
|
||||
case t_base_type::TYPE_DOUBLE:
|
||||
if (value->get_type() == t_const_value::CV_INTEGER) {
|
||||
out << value->get_integer();
|
||||
} else {
|
||||
out << value->get_double();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw "Compiler error: No const of base type " + t_base_type::t_base_name(tbase);
|
||||
}
|
||||
} else if (type->is_enum()) {
|
||||
out << "cast(" << render_type_name(type) << ")" << value->get_integer();
|
||||
} else {
|
||||
out << "{" << endl;
|
||||
indent_up();
|
||||
|
||||
indent(out) << render_type_name(type) << " v;" << endl;
|
||||
if (type->is_struct() || type->is_xception()) {
|
||||
indent(out) << "v = " << (type->is_xception() ? "new " : "") << render_type_name(type)
|
||||
<< "();" << endl;
|
||||
|
||||
const vector<t_field*>& fields = ((t_struct*)type)->get_members();
|
||||
vector<t_field*>::const_iterator f_iter;
|
||||
const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
|
||||
map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
t_type* field_type = NULL;
|
||||
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
|
||||
if ((*f_iter)->get_name() == v_iter->first->get_string()) {
|
||||
field_type = (*f_iter)->get_type();
|
||||
}
|
||||
}
|
||||
if (field_type == NULL) {
|
||||
throw "Type error: " + type->get_name() + " has no field "
|
||||
+ v_iter->first->get_string();
|
||||
}
|
||||
string val = render_const_value(field_type, v_iter->second);
|
||||
indent(out) << "v.set!`" << v_iter->first->get_string() << "`(" << val << ");" << endl;
|
||||
}
|
||||
} else if (type->is_map()) {
|
||||
t_type* ktype = ((t_map*)type)->get_key_type();
|
||||
t_type* vtype = ((t_map*)type)->get_val_type();
|
||||
const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
|
||||
map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
string key = render_const_value(ktype, v_iter->first);
|
||||
string val = render_const_value(vtype, v_iter->second);
|
||||
indent(out) << "v[";
|
||||
if (!is_immutable_type(ktype)) {
|
||||
out << "cast(immutable(" << render_type_name(ktype) << "))";
|
||||
}
|
||||
out << key << "] = " << val << ";" << endl;
|
||||
}
|
||||
} else if (type->is_list()) {
|
||||
t_type* etype = ((t_list*)type)->get_elem_type();
|
||||
const vector<t_const_value*>& val = value->get_list();
|
||||
vector<t_const_value*>::const_iterator v_iter;
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
string val = render_const_value(etype, *v_iter);
|
||||
indent(out) << "v ~= " << val << ";" << endl;
|
||||
}
|
||||
} else if (type->is_set()) {
|
||||
t_type* etype = ((t_set*)type)->get_elem_type();
|
||||
const vector<t_const_value*>& val = value->get_list();
|
||||
vector<t_const_value*>::const_iterator v_iter;
|
||||
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
|
||||
string val = render_const_value(etype, *v_iter);
|
||||
indent(out) << "v ~= " << val << ";" << endl;
|
||||
}
|
||||
} else {
|
||||
throw "Compiler error: Invalid type in render_const_value: " + type->get_name();
|
||||
}
|
||||
indent(out) << "return v;" << endl;
|
||||
|
||||
indent_down();
|
||||
indent(out) << "}()";
|
||||
}
|
||||
|
||||
return out.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the D package to which modules for program are written (with a
|
||||
* trailing dot, if not empty).
|
||||
*/
|
||||
string render_package(const t_program& program) const {
|
||||
string package = program.get_namespace("d");
|
||||
if (package.size() == 0)
|
||||
return "";
|
||||
return package + ".";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the D repesentation of ttype.
|
||||
*
|
||||
* If isArg is true, a const reference to the type will be returned for
|
||||
* structs.
|
||||
*/
|
||||
string render_type_name(const t_type* ttype, bool isArg = false) const {
|
||||
if (ttype->is_base_type()) {
|
||||
t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
|
||||
switch (tbase) {
|
||||
case t_base_type::TYPE_VOID:
|
||||
return "void";
|
||||
case t_base_type::TYPE_STRING:
|
||||
return "string";
|
||||
case t_base_type::TYPE_BOOL:
|
||||
return "bool";
|
||||
case t_base_type::TYPE_I8:
|
||||
return "byte";
|
||||
case t_base_type::TYPE_I16:
|
||||
return "short";
|
||||
case t_base_type::TYPE_I32:
|
||||
return "int";
|
||||
case t_base_type::TYPE_I64:
|
||||
return "long";
|
||||
case t_base_type::TYPE_DOUBLE:
|
||||
return "double";
|
||||
default:
|
||||
throw "Compiler error: No D type name for base type " + t_base_type::t_base_name(tbase);
|
||||
}
|
||||
}
|
||||
|
||||
if (ttype->is_container()) {
|
||||
t_container* tcontainer = (t_container*)ttype;
|
||||
if (tcontainer->has_cpp_name()) {
|
||||
return tcontainer->get_cpp_name();
|
||||
} else if (ttype->is_map()) {
|
||||
t_map* tmap = (t_map*)ttype;
|
||||
t_type* ktype = tmap->get_key_type();
|
||||
|
||||
string name = render_type_name(tmap->get_val_type()) + "[";
|
||||
if (!is_immutable_type(ktype)) {
|
||||
name += "immutable(";
|
||||
}
|
||||
name += render_type_name(ktype);
|
||||
if (!is_immutable_type(ktype)) {
|
||||
name += ")";
|
||||
}
|
||||
name += "]";
|
||||
return name;
|
||||
} else if (ttype->is_set()) {
|
||||
t_set* tset = (t_set*)ttype;
|
||||
return "HashSet!(" + render_type_name(tset->get_elem_type()) + ")";
|
||||
} else if (ttype->is_list()) {
|
||||
t_list* tlist = (t_list*)ttype;
|
||||
return render_type_name(tlist->get_elem_type()) + "[]";
|
||||
}
|
||||
}
|
||||
|
||||
if (ttype->is_struct() && isArg) {
|
||||
return "ref const(" + ttype->get_name() + ")";
|
||||
} else {
|
||||
return ttype->get_name();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the D TReq enum member corresponding to req.
|
||||
*/
|
||||
string render_req(t_field::e_req req) const {
|
||||
switch (req) {
|
||||
case t_field::T_OPT_IN_REQ_OUT:
|
||||
return "TReq.OPT_IN_REQ_OUT";
|
||||
case t_field::T_OPTIONAL:
|
||||
return "TReq.OPTIONAL";
|
||||
case t_field::T_REQUIRED:
|
||||
return "TReq.REQUIRED";
|
||||
default: {
|
||||
std::stringstream ss;
|
||||
ss << "Compiler error: Invalid requirement level " << req;
|
||||
throw ss.str();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the default list of imports (which are written to every generated
|
||||
* module) to f.
|
||||
*/
|
||||
void print_default_imports(ostream& out) {
|
||||
indent(out) << "import thrift.base;" << endl << "import thrift.codegen.base;" << endl
|
||||
<< "import thrift.util.hashset;" << endl << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether type is »intrinsically immutable«, in the sense that
|
||||
* a value of that type is implicitly castable to immutable(type), and it is
|
||||
* allowed for AA keys without an immutable() qualifier.
|
||||
*/
|
||||
bool is_immutable_type(t_type* type) const {
|
||||
t_type* ttype = get_true_type(type);
|
||||
return ttype->is_base_type() || ttype->is_enum();
|
||||
}
|
||||
|
||||
/*
|
||||
* File streams, stored here to avoid passing them as parameters to every
|
||||
* function.
|
||||
*/
|
||||
ofstream_with_content_based_conditional_update f_types_;
|
||||
ofstream_with_content_based_conditional_update f_header_;
|
||||
|
||||
string package_dir_;
|
||||
};
|
||||
|
||||
THRIFT_REGISTER_GENERATOR(d, "D", "")
|
2516
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_dart_generator.cc
generated
vendored
2516
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_dart_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
4011
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
generated
vendored
4011
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
1283
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_erl_generator.cc
generated
vendored
1283
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_erl_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
262
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_generator.cc
generated
vendored
262
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_generator.cc
generated
vendored
|
@ -1,262 +0,0 @@
|
|||
/*
|
||||
* 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 "thrift/generate/t_generator.h"
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* Top level program generation function. Calls the generator subclass methods
|
||||
* for preparing file streams etc. then iterates over all the parts of the
|
||||
* program to perform the correct actions.
|
||||
*
|
||||
* @param program The thrift program to compile into C++ source
|
||||
*/
|
||||
void t_generator::generate_program() {
|
||||
// Initialize the generator
|
||||
init_generator();
|
||||
|
||||
// Generate enums
|
||||
vector<t_enum*> enums = program_->get_enums();
|
||||
vector<t_enum*>::iterator en_iter;
|
||||
for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
|
||||
generate_enum(*en_iter);
|
||||
}
|
||||
|
||||
// Generate typedefs
|
||||
vector<t_typedef*> typedefs = program_->get_typedefs();
|
||||
vector<t_typedef*>::iterator td_iter;
|
||||
for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
|
||||
generate_typedef(*td_iter);
|
||||
}
|
||||
|
||||
// Generate structs, exceptions, and unions in declared order
|
||||
vector<t_struct*> objects = program_->get_objects();
|
||||
|
||||
vector<t_struct*>::iterator o_iter;
|
||||
for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
|
||||
generate_forward_declaration(*o_iter);
|
||||
}
|
||||
for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
|
||||
if ((*o_iter)->is_xception()) {
|
||||
generate_xception(*o_iter);
|
||||
} else {
|
||||
generate_struct(*o_iter);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate constants
|
||||
vector<t_const*> consts = program_->get_consts();
|
||||
generate_consts(consts);
|
||||
|
||||
// Generate services
|
||||
vector<t_service*> services = program_->get_services();
|
||||
vector<t_service*>::iterator sv_iter;
|
||||
for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
|
||||
service_name_ = get_service_name(*sv_iter);
|
||||
generate_service(*sv_iter);
|
||||
}
|
||||
|
||||
// Close the generator
|
||||
close_generator();
|
||||
}
|
||||
|
||||
std::set<std::string> t_generator::lang_keywords() const {
|
||||
std::string keywords[] = { "BEGIN", "END", "__CLASS__", "__DIR__", "__FILE__", "__FUNCTION__",
|
||||
"__LINE__", "__METHOD__", "__NAMESPACE__", "abstract", "alias", "and", "args", "as",
|
||||
"assert", "begin", "break", "case", "catch", "class", "clone", "continue", "declare",
|
||||
"def", "default", "del", "delete", "do", "dynamic", "elif", "else", "elseif", "elsif",
|
||||
"end", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "ensure",
|
||||
"except", "exec", "finally", "float", "for", "foreach", "from", "function", "global",
|
||||
"goto", "if", "implements", "import", "in", "inline", "instanceof", "interface", "is",
|
||||
"lambda", "module", "native", "new", "next", "nil", "not", "or", "package", "pass",
|
||||
"public", "print", "private", "protected", "raise", "redo", "rescue", "retry", "register",
|
||||
"return", "self", "sizeof", "static", "super", "switch", "synchronized", "then", "this",
|
||||
"throw", "transient", "try", "undef", "unless", "unsigned", "until", "use", "var",
|
||||
"virtual", "volatile", "when", "while", "with", "xor", "yield" };
|
||||
return std::set<std::string>(keywords, keywords + sizeof(keywords)/sizeof(keywords[0]) );
|
||||
}
|
||||
|
||||
void t_generator::validate_input() const {
|
||||
validate(program_->get_enums());
|
||||
validate(program_->get_typedefs());
|
||||
validate(program_->get_objects());
|
||||
validate(program_->get_consts());
|
||||
validate(program_->get_services());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void t_generator::validate(const vector<T>& list) const{
|
||||
typename vector<T>::const_iterator it;
|
||||
for(it=list.begin(); it != list.end(); ++it) {
|
||||
validate(*it);
|
||||
}
|
||||
}
|
||||
|
||||
void t_generator::validate(t_function const* f) const {
|
||||
validate_id(f->get_name());
|
||||
validate(f->get_arglist());
|
||||
validate(f->get_xceptions());
|
||||
}
|
||||
|
||||
void t_generator::validate(t_service const* s) const {
|
||||
validate_id(s->get_name());
|
||||
validate(s->get_functions());
|
||||
}
|
||||
|
||||
void t_generator::validate(t_enum const* en) const {
|
||||
validate_id(en->get_name());
|
||||
validate(en->get_constants());
|
||||
}
|
||||
void t_generator::validate(t_struct const* s) const {
|
||||
validate_id(s->get_name());
|
||||
validate(s->get_members());
|
||||
}
|
||||
|
||||
void t_generator::validate(t_enum_value const* en_val) const {
|
||||
validate_id(en_val->get_name());
|
||||
}
|
||||
void t_generator::validate(t_typedef const* td) const {
|
||||
validate_id(td->get_name());
|
||||
}
|
||||
void t_generator::validate(t_const const* c) const {
|
||||
validate_id(c->get_name());
|
||||
}
|
||||
void t_generator::validate(t_field const* f) const {
|
||||
validate_id(f->get_name());
|
||||
}
|
||||
|
||||
void t_generator::validate_id(const string& id) const {
|
||||
if (keywords_.find(id) != keywords_.end()) {
|
||||
failure("Cannot use reserved language keyword: \"%s\"", id.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
string t_generator::escape_string(const string& in) const {
|
||||
string result = "";
|
||||
for (string::const_iterator it = in.begin(); it < in.end(); it++) {
|
||||
std::map<char, std::string>::const_iterator res = escape_.find(*it);
|
||||
if (res != escape_.end()) {
|
||||
result.append(res->second);
|
||||
} else {
|
||||
result.push_back(*it);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void t_generator::generate_consts(vector<t_const*> consts) {
|
||||
vector<t_const*>::iterator c_iter;
|
||||
for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
|
||||
generate_const(*c_iter);
|
||||
}
|
||||
}
|
||||
|
||||
void t_generator::generate_docstring_comment(ostream& out,
|
||||
const string& comment_start,
|
||||
const string& line_prefix,
|
||||
const string& contents,
|
||||
const string& comment_end) {
|
||||
if (!comment_start.empty())
|
||||
indent(out) << comment_start;
|
||||
stringstream docs(contents, ios_base::in);
|
||||
while (!(docs.eof() || docs.fail())) {
|
||||
char line[1024];
|
||||
docs.getline(line, 1024);
|
||||
|
||||
if (strlen(line) > 0) {
|
||||
indent(out) << line_prefix << line << std::endl;
|
||||
} else if (line_prefix.empty()){
|
||||
out << std::endl;
|
||||
} else if(!docs.eof()) {
|
||||
indent(out) << line_prefix << std::endl;
|
||||
}
|
||||
}
|
||||
if (!comment_end.empty())
|
||||
indent(out) << comment_end;
|
||||
}
|
||||
|
||||
void t_generator_registry::register_generator(t_generator_factory* factory) {
|
||||
gen_map_t& the_map = get_generator_map();
|
||||
if (the_map.find(factory->get_short_name()) != the_map.end()) {
|
||||
failure("Duplicate generators for language \"%s\"!\n", factory->get_short_name().c_str());
|
||||
}
|
||||
the_map[factory->get_short_name()] = factory;
|
||||
}
|
||||
|
||||
void t_generator::parse_options(const string& options,
|
||||
string& language,
|
||||
map<string, string>& parsed_options) {
|
||||
string::size_type colon = options.find(':');
|
||||
language = options.substr(0, colon);
|
||||
|
||||
if (colon != string::npos) {
|
||||
string::size_type pos = colon + 1;
|
||||
while (pos != string::npos && pos < options.size()) {
|
||||
string::size_type next_pos = options.find(',', pos);
|
||||
string option = options.substr(pos, next_pos - pos);
|
||||
pos = ((next_pos == string::npos) ? next_pos : next_pos + 1);
|
||||
|
||||
string::size_type separator = option.find('=');
|
||||
string key, value;
|
||||
if (separator == string::npos) {
|
||||
key = option;
|
||||
value = "";
|
||||
} else {
|
||||
key = option.substr(0, separator);
|
||||
value = option.substr(separator + 1);
|
||||
}
|
||||
|
||||
parsed_options[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
t_generator* t_generator_registry::get_generator(t_program* program,
|
||||
const string& language,
|
||||
const map<string, string>& parsed_options,
|
||||
const std::string& options) {
|
||||
gen_map_t& the_map = get_generator_map();
|
||||
gen_map_t::iterator iter = the_map.find(language);
|
||||
|
||||
if (iter == the_map.end()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return iter->second->get_generator(program, parsed_options, options);
|
||||
}
|
||||
|
||||
t_generator* t_generator_registry::get_generator(t_program* program, const string& options) {
|
||||
string language;
|
||||
map<string, string> parsed_options;
|
||||
t_generator::parse_options(options, language, parsed_options);
|
||||
return get_generator(program, language, parsed_options, options);
|
||||
}
|
||||
|
||||
t_generator_registry::gen_map_t& t_generator_registry::get_generator_map() {
|
||||
// http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12
|
||||
static gen_map_t* the_map = new gen_map_t();
|
||||
return *the_map;
|
||||
}
|
||||
|
||||
t_generator_factory::t_generator_factory(const std::string& short_name,
|
||||
const std::string& long_name,
|
||||
const std::string& documentation)
|
||||
: short_name_(short_name), long_name_(long_name), documentation_(documentation) {
|
||||
t_generator_registry::register_generator(this);
|
||||
}
|
452
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_generator.h
generated
vendored
452
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_generator.h
generated
vendored
|
@ -1,452 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef T_GENERATOR_H
|
||||
#define T_GENERATOR_H
|
||||
#define MSC_2015_VER 1900
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include "thrift/common.h"
|
||||
#include "thrift/logging.h"
|
||||
#include "thrift/version.h"
|
||||
#include "thrift/generate/t_generator_registry.h"
|
||||
#include "thrift/parse/t_program.h"
|
||||
|
||||
/**
|
||||
* Base class for a thrift code generator. This class defines the basic
|
||||
* routines for code generation and contains the top level method that
|
||||
* dispatches code generation across various components.
|
||||
*
|
||||
*/
|
||||
class t_generator {
|
||||
public:
|
||||
t_generator(t_program* program)
|
||||
: keywords_(lang_keywords()){
|
||||
tmp_ = 0;
|
||||
indent_ = 0;
|
||||
program_ = program;
|
||||
program_name_ = get_program_name(program);
|
||||
escape_['\n'] = "\\n";
|
||||
escape_['\r'] = "\\r";
|
||||
escape_['\t'] = "\\t";
|
||||
escape_['"'] = "\\\"";
|
||||
escape_['\\'] = "\\\\";
|
||||
}
|
||||
|
||||
virtual ~t_generator() {}
|
||||
|
||||
/**
|
||||
* Framework generator method that iterates over all the parts of a program
|
||||
* and performs general actions. This is implemented by the base class and
|
||||
* should not normally be overwritten in the subclasses.
|
||||
*/
|
||||
virtual void generate_program();
|
||||
|
||||
const t_program* get_program() const { return program_; }
|
||||
|
||||
void generate_docstring_comment(std::ostream& out,
|
||||
const std::string& comment_start,
|
||||
const std::string& line_prefix,
|
||||
const std::string& contents,
|
||||
const std::string& comment_end);
|
||||
|
||||
static void parse_options(const std::string& options, std::string& language,
|
||||
std::map<std::string, std::string>& parsed_options);
|
||||
|
||||
/**
|
||||
* check whether sub-namespace declaraction is used by generator.
|
||||
* e.g. allow
|
||||
* namespace py.twisted bar
|
||||
* to specify namespace to use when -gen py:twisted is specified.
|
||||
* Will be called with subnamespace, i.e. is_valid_namespace("twisted")
|
||||
* will be called for the above example.
|
||||
*/
|
||||
static bool is_valid_namespace(const std::string& sub_namespace) {
|
||||
(void)sub_namespace;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape string to use one in generated sources.
|
||||
*/
|
||||
virtual std::string escape_string(const std::string& in) const;
|
||||
|
||||
std::string get_escaped_string(t_const_value* constval) {
|
||||
return escape_string(constval->get_string());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all identifiers are valid for the target language
|
||||
*/
|
||||
virtual void validate_input() const;
|
||||
|
||||
protected:
|
||||
virtual std::set<std::string> lang_keywords() const;
|
||||
|
||||
/**
|
||||
* A list of reserved words that cannot be used as identifiers.
|
||||
*/
|
||||
const std::set<std::string> keywords_;
|
||||
|
||||
virtual void validate_id(const std::string& id) const;
|
||||
|
||||
virtual void validate(t_enum const* en) const;
|
||||
virtual void validate(t_enum_value const* en_val) const;
|
||||
virtual void validate(t_typedef const* td) const;
|
||||
virtual void validate(t_const const* c) const;
|
||||
virtual void validate(t_service const* s) const;
|
||||
virtual void validate(t_struct const* c) const;
|
||||
virtual void validate(t_field const* f) const;
|
||||
virtual void validate(t_function const* f) const;
|
||||
|
||||
template <typename T>
|
||||
void validate(const std::vector<T>& list) const;
|
||||
|
||||
/**
|
||||
* Optional methods that may be implemented by subclasses to take necessary
|
||||
* steps at the beginning or end of code generation.
|
||||
*/
|
||||
|
||||
virtual void init_generator() {}
|
||||
virtual void close_generator() {}
|
||||
|
||||
virtual void generate_consts(std::vector<t_const*> consts);
|
||||
|
||||
/**
|
||||
* Pure virtual methods implemented by the generator subclasses.
|
||||
*/
|
||||
|
||||
virtual void generate_typedef(t_typedef* ttypedef) = 0;
|
||||
virtual void generate_enum(t_enum* tenum) = 0;
|
||||
virtual void generate_const(t_const* tconst) { (void)tconst; }
|
||||
virtual void generate_struct(t_struct* tstruct) = 0;
|
||||
virtual void generate_service(t_service* tservice) = 0;
|
||||
virtual void generate_forward_declaration(t_struct*) {}
|
||||
virtual void generate_xception(t_struct* txception) {
|
||||
// By default exceptions are the same as structs
|
||||
generate_struct(txception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the program name, may be overridden
|
||||
*/
|
||||
virtual std::string get_program_name(t_program* tprogram) { return tprogram->get_name(); }
|
||||
|
||||
/**
|
||||
* Method to get the service name, may be overridden
|
||||
*/
|
||||
virtual std::string get_service_name(t_service* tservice) { return tservice->get_name(); }
|
||||
|
||||
/**
|
||||
* Get the current output directory
|
||||
*/
|
||||
virtual std::string get_out_dir() const {
|
||||
if (program_->is_out_path_absolute()) {
|
||||
return program_->get_out_path() + "/";
|
||||
}
|
||||
|
||||
return program_->get_out_path() + out_dir_base_ + "/";
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a unique temporary variable name, which is just "name" with a
|
||||
* number appended to it (i.e. name35)
|
||||
*/
|
||||
std::string tmp(std::string name) {
|
||||
std::ostringstream out;
|
||||
out << name << tmp_++;
|
||||
return out.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a comment about this code being autogenerated, using C++ style
|
||||
* comments, which are also fair game in Java / PHP, yay!
|
||||
*
|
||||
* @return C-style comment mentioning that this file is autogenerated.
|
||||
*/
|
||||
virtual std::string autogen_comment() {
|
||||
return std::string("/**\n") + " * " + autogen_summary() + "\n" + " *\n"
|
||||
+ " * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n"
|
||||
+ " * @generated\n" + " */\n";
|
||||
}
|
||||
|
||||
virtual std::string autogen_summary() {
|
||||
return std::string("Autogenerated by Thrift Compiler (") + THRIFT_VERSION + ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Indentation level modifiers
|
||||
*/
|
||||
|
||||
void indent_up() { ++indent_; }
|
||||
|
||||
void indent_down() { --indent_; }
|
||||
|
||||
/**
|
||||
* Indentation validation helper
|
||||
*/
|
||||
int indent_count() { return indent_; }
|
||||
|
||||
void indent_validate( int expected, const char * func_name) {
|
||||
if (indent_ != expected) {
|
||||
pverbose("Wrong indent count in %s: difference = %i \n", func_name, (expected - indent_));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indentation print function
|
||||
*/
|
||||
std::string indent() {
|
||||
std::string ind = "";
|
||||
int i;
|
||||
for (i = 0; i < indent_; ++i) {
|
||||
ind += indent_str();
|
||||
}
|
||||
return ind;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indentation utility wrapper
|
||||
*/
|
||||
std::ostream& indent(std::ostream& os) { return os << indent(); }
|
||||
|
||||
/**
|
||||
* Capitalization helpers
|
||||
*/
|
||||
std::string capitalize(std::string in) {
|
||||
in[0] = toupper(in[0]);
|
||||
return in;
|
||||
}
|
||||
std::string decapitalize(std::string in) {
|
||||
in[0] = tolower(in[0]);
|
||||
return in;
|
||||
}
|
||||
static std::string lowercase(std::string in) {
|
||||
for (size_t i = 0; i < in.size(); ++i) {
|
||||
in[i] = tolower(in[i]);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
static std::string uppercase(std::string in) {
|
||||
for (size_t i = 0; i < in.size(); ++i) {
|
||||
in[i] = toupper(in[i]);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a camel case string to an equivalent one separated by underscores
|
||||
* e.g. aMultiWord -> a_multi_word
|
||||
* someName -> some_name
|
||||
* CamelCase -> camel_case
|
||||
* name -> name
|
||||
* Name -> name
|
||||
*/
|
||||
std::string underscore(std::string in) {
|
||||
in[0] = tolower(in[0]);
|
||||
for (size_t i = 1; i < in.size(); ++i) {
|
||||
if (isupper(in[i])) {
|
||||
in[i] = tolower(in[i]);
|
||||
in.insert(i, "_");
|
||||
}
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a string with words separated by underscores to a camel case equivalent
|
||||
* e.g. a_multi_word -> aMultiWord
|
||||
* some_name -> someName
|
||||
* name -> name
|
||||
*/
|
||||
std::string camelcase(std::string in) {
|
||||
std::ostringstream out;
|
||||
bool underscore = false;
|
||||
|
||||
for (size_t i = 0; i < in.size(); i++) {
|
||||
if (in[i] == '_') {
|
||||
underscore = true;
|
||||
continue;
|
||||
}
|
||||
if (underscore) {
|
||||
out << (char)toupper(in[i]);
|
||||
underscore = false;
|
||||
continue;
|
||||
}
|
||||
out << in[i];
|
||||
}
|
||||
|
||||
return out.str();
|
||||
}
|
||||
|
||||
const std::string emit_double_as_string(const double value) {
|
||||
std::stringstream double_output_stream;
|
||||
// sets the maximum precision: http://en.cppreference.com/w/cpp/io/manip/setprecision
|
||||
// sets the output format to fixed: http://en.cppreference.com/w/cpp/io/manip/fixed (not in scientific notation)
|
||||
double_output_stream << std::setprecision(std::numeric_limits<double>::digits10 + 1);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// strtod is broken in MSVC compilers older than 2015, so std::fixed fails to format a double literal.
|
||||
// more details: https://blogs.msdn.microsoft.com/vcblog/2014/06/18/
|
||||
// c-runtime-crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1/
|
||||
// and
|
||||
// http://www.exploringbinary.com/visual-c-plus-plus-strtod-still-broken/
|
||||
#if _MSC_VER >= MSC_2015_VER
|
||||
double_output_stream << std::fixed;
|
||||
#endif
|
||||
#else
|
||||
double_output_stream << std::fixed;
|
||||
#endif
|
||||
|
||||
double_output_stream << value;
|
||||
|
||||
return double_output_stream.str();
|
||||
}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Get the true type behind a series of typedefs.
|
||||
*/
|
||||
static const t_type* get_true_type(const t_type* type) { return type->get_true_type(); }
|
||||
static t_type* get_true_type(t_type* type) { return type->get_true_type(); }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* The program being generated
|
||||
*/
|
||||
t_program* program_;
|
||||
|
||||
/**
|
||||
* Quick accessor for formatted program name that is currently being
|
||||
* generated.
|
||||
*/
|
||||
std::string program_name_;
|
||||
|
||||
/**
|
||||
* Quick accessor for formatted service name that is currently being
|
||||
* generated.
|
||||
*/
|
||||
std::string service_name_;
|
||||
|
||||
/**
|
||||
* Output type-specifc directory name ("gen-*")
|
||||
*/
|
||||
std::string out_dir_base_;
|
||||
|
||||
/**
|
||||
* Map of characters to escape in string literals.
|
||||
*/
|
||||
std::map<char, std::string> escape_;
|
||||
|
||||
virtual std::string indent_str() const {
|
||||
return " ";
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Current code indentation level
|
||||
*/
|
||||
int indent_;
|
||||
|
||||
/**
|
||||
* Temporary variable counter, for making unique variable names
|
||||
*/
|
||||
int tmp_;
|
||||
};
|
||||
|
||||
template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
|
||||
class template_ofstream_with_content_based_conditional_update : public std::ostringstream {
|
||||
public:
|
||||
template_ofstream_with_content_based_conditional_update(): contents_written(false) {}
|
||||
|
||||
template_ofstream_with_content_based_conditional_update(std::string const& output_file_path_)
|
||||
: output_file_path(output_file_path_), contents_written(false) {}
|
||||
|
||||
~template_ofstream_with_content_based_conditional_update() {
|
||||
if (!contents_written) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
void open(std::string const& output_file_path_) {
|
||||
output_file_path = output_file_path_;
|
||||
clear_buf();
|
||||
contents_written = false;
|
||||
}
|
||||
|
||||
void close() {
|
||||
if (contents_written || output_file_path == "")
|
||||
return;
|
||||
|
||||
if (!is_readable(output_file_path)) {
|
||||
dump();
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream old_file;
|
||||
old_file.exceptions(old_file.exceptions() | std::ifstream::badbit | std::ifstream::failbit);
|
||||
old_file.open(output_file_path.c_str(), std::ios::in);
|
||||
|
||||
if (old_file) {
|
||||
std::string const old_file_contents(static_cast<std::ostringstream const&>(std::ostringstream() << old_file.rdbuf()).str());
|
||||
old_file.close();
|
||||
|
||||
if (old_file_contents != str()) {
|
||||
dump();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
void dump() {
|
||||
std::ofstream out_file;
|
||||
out_file.exceptions(out_file.exceptions() | std::ofstream::badbit | std::ofstream::failbit);
|
||||
try {
|
||||
out_file.open(output_file_path.c_str(), std::ios::out);
|
||||
}
|
||||
catch (const std::ios_base::failure& e) {
|
||||
::failure("failed to write the output to the file '%s', details: '%s'", output_file_path.c_str(), e.what());
|
||||
}
|
||||
out_file << str();
|
||||
out_file.close();
|
||||
clear_buf();
|
||||
contents_written = true;
|
||||
}
|
||||
|
||||
void clear_buf() {
|
||||
str(std::string());
|
||||
}
|
||||
|
||||
static bool is_readable(std::string const& file_name) {
|
||||
return static_cast<bool>(std::ifstream(file_name.c_str()));
|
||||
}
|
||||
|
||||
private:
|
||||
std::string output_file_path;
|
||||
bool contents_written;
|
||||
};
|
||||
typedef template_ofstream_with_content_based_conditional_update<char> ofstream_with_content_based_conditional_update;
|
||||
|
||||
#endif
|
106
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_generator_registry.h
generated
vendored
106
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_generator_registry.h
generated
vendored
|
@ -1,106 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef T_GENERATOR_REGISTRY_H
|
||||
#define T_GENERATOR_REGISTRY_H
|
||||
|
||||
class t_generator;
|
||||
|
||||
/**
|
||||
* A factory for producing generator classes of a particular language.
|
||||
*
|
||||
* This class is also responsible for:
|
||||
* - Registering itself with the generator registry.
|
||||
* - Providing documentation for the generators it produces.
|
||||
*/
|
||||
class t_generator_factory {
|
||||
public:
|
||||
t_generator_factory(const std::string& short_name,
|
||||
const std::string& long_name,
|
||||
const std::string& documentation);
|
||||
|
||||
virtual ~t_generator_factory() {}
|
||||
|
||||
virtual t_generator* get_generator(
|
||||
// The program to generate.
|
||||
t_program* program,
|
||||
// Note: parsed_options will not exist beyond the call to get_generator.
|
||||
const std::map<std::string, std::string>& parsed_options,
|
||||
// Note: option_string might not exist beyond the call to get_generator.
|
||||
const std::string& option_string) = 0;
|
||||
|
||||
virtual bool is_valid_namespace(const std::string& sub_namespace) = 0;
|
||||
|
||||
std::string get_short_name() { return short_name_; }
|
||||
std::string get_long_name() { return long_name_; }
|
||||
std::string get_documentation() { return documentation_; }
|
||||
|
||||
private:
|
||||
std::string short_name_;
|
||||
std::string long_name_;
|
||||
std::string documentation_;
|
||||
};
|
||||
|
||||
template <typename generator>
|
||||
class t_generator_factory_impl : public t_generator_factory {
|
||||
public:
|
||||
t_generator_factory_impl(const std::string& short_name,
|
||||
const std::string& long_name,
|
||||
const std::string& documentation)
|
||||
: t_generator_factory(short_name, long_name, documentation) {}
|
||||
|
||||
virtual t_generator* get_generator(t_program* program,
|
||||
const std::map<std::string, std::string>& parsed_options,
|
||||
const std::string& option_string) {
|
||||
return new generator(program, parsed_options, option_string);
|
||||
}
|
||||
|
||||
virtual bool is_valid_namespace(const std::string& sub_namespace) {
|
||||
return generator::is_valid_namespace(sub_namespace);
|
||||
}
|
||||
};
|
||||
|
||||
class t_generator_registry {
|
||||
public:
|
||||
static void register_generator(t_generator_factory* factory);
|
||||
|
||||
static t_generator* get_generator(t_program* program, const std::string& options);
|
||||
static t_generator* get_generator(t_program* program,
|
||||
const std::string& laugnage,
|
||||
const std::map<std::string, std::string>& parsed_options,
|
||||
const std::string& options);
|
||||
|
||||
typedef std::map<std::string, t_generator_factory*> gen_map_t;
|
||||
static gen_map_t& get_generator_map();
|
||||
|
||||
private:
|
||||
t_generator_registry();
|
||||
t_generator_registry(const t_generator_registry&);
|
||||
};
|
||||
|
||||
#define THRIFT_REGISTER_GENERATOR(language, long_name, doc) \
|
||||
class t_##language##_generator_factory_impl \
|
||||
: public t_generator_factory_impl<t_##language##_generator> { \
|
||||
public: \
|
||||
t_##language##_generator_factory_impl() \
|
||||
: t_generator_factory_impl<t_##language##_generator>(#language, long_name, doc) {} \
|
||||
}; \
|
||||
static t_##language##_generator_factory_impl _registerer;
|
||||
|
||||
#endif
|
3716
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_go_generator.cc
generated
vendored
3716
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_go_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
345
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_gv_generator.cc
generated
vendored
345
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_gv_generator.cc
generated
vendored
|
@ -1,345 +0,0 @@
|
|||
/*
|
||||
* 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 <string>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sstream>
|
||||
#include "thrift/platform.h"
|
||||
#include "thrift/generate/t_generator.h"
|
||||
|
||||
using std::map;
|
||||
using std::ofstream;
|
||||
using std::ostringstream;
|
||||
using std::pair;
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
using std::vector;
|
||||
|
||||
static const string endl = "\n"; // avoid ostream << std::endl flushes
|
||||
|
||||
/**
|
||||
* Graphviz code generator
|
||||
*/
|
||||
class t_gv_generator : public t_generator {
|
||||
public:
|
||||
t_gv_generator(t_program* program,
|
||||
const std::map<std::string, std::string>& parsed_options,
|
||||
const std::string& option_string)
|
||||
: t_generator(program) {
|
||||
(void)option_string;
|
||||
std::map<std::string, std::string>::const_iterator iter;
|
||||
|
||||
exception_arrows = false;
|
||||
for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
|
||||
if( iter->first.compare("exceptions") == 0) {
|
||||
exception_arrows = true;
|
||||
} else {
|
||||
throw "unknown option gv:" + iter->first;
|
||||
}
|
||||
}
|
||||
|
||||
out_dir_base_ = "gen-gv";
|
||||
}
|
||||
|
||||
/**
|
||||
* Init and end of generator
|
||||
*/
|
||||
void init_generator();
|
||||
void close_generator();
|
||||
|
||||
/**
|
||||
* Program-level generation functions
|
||||
*/
|
||||
void generate_typedef(t_typedef* ttypedef);
|
||||
void generate_enum(t_enum* tenum);
|
||||
void generate_const(t_const* tconst);
|
||||
void generate_struct(t_struct* tstruct);
|
||||
void generate_service(t_service* tservice);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Helpers
|
||||
*/
|
||||
void print_type(t_type* ttype, string struct_field_ref);
|
||||
void print_const_value(t_type* type, t_const_value* tvalue);
|
||||
|
||||
private:
|
||||
ofstream_with_content_based_conditional_update f_out_;
|
||||
std::list<string> edges;
|
||||
bool exception_arrows;
|
||||
};
|
||||
|
||||
/**
|
||||
* Init generator:
|
||||
* - Adds some escaping for the Graphviz domain.
|
||||
* - Create output directory and open file for writting.
|
||||
* - Write the file header.
|
||||
*/
|
||||
void t_gv_generator::init_generator() {
|
||||
escape_['{'] = "\\{";
|
||||
escape_['}'] = "\\}";
|
||||
|
||||
// Make output directory
|
||||
MKDIR(get_out_dir().c_str());
|
||||
string fname = get_out_dir() + program_->get_name() + ".gv";
|
||||
f_out_.open(fname.c_str());
|
||||
f_out_ << "digraph \"" << escape_string(program_name_) << "\" {" << endl;
|
||||
f_out_ << "node [style=filled, shape=record];" << endl;
|
||||
f_out_ << "edge [arrowsize=0.5];" << endl;
|
||||
f_out_ << "rankdir=LR" << endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes generator:
|
||||
* - Print accumulated nodes connections.
|
||||
* - Print footnote.
|
||||
* - Closes file.
|
||||
*/
|
||||
void t_gv_generator::close_generator() {
|
||||
// Print edges
|
||||
std::list<string>::iterator iter = edges.begin();
|
||||
for (; iter != edges.end(); iter++) {
|
||||
f_out_ << (*iter) << endl;
|
||||
}
|
||||
|
||||
// Print graph end } and close file
|
||||
f_out_ << "}" << endl;
|
||||
f_out_.close();
|
||||
}
|
||||
|
||||
void t_gv_generator::generate_typedef(t_typedef* ttypedef) {
|
||||
string name = ttypedef->get_name();
|
||||
f_out_ << "node [fillcolor=azure];" << endl;
|
||||
f_out_ << name << " [label=\"";
|
||||
|
||||
f_out_ << escape_string(name);
|
||||
f_out_ << " :: ";
|
||||
print_type(ttypedef->get_type(), name);
|
||||
|
||||
f_out_ << "\"];" << endl;
|
||||
}
|
||||
|
||||
void t_gv_generator::generate_enum(t_enum* tenum) {
|
||||
string name = tenum->get_name();
|
||||
f_out_ << "node [fillcolor=white];" << endl;
|
||||
f_out_ << name << " [label=\"enum " << escape_string(name);
|
||||
|
||||
vector<t_enum_value*> values = tenum->get_constants();
|
||||
vector<t_enum_value*>::iterator val_iter;
|
||||
for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
|
||||
f_out_ << '|' << (*val_iter)->get_name();
|
||||
f_out_ << " = ";
|
||||
f_out_ << (*val_iter)->get_value();
|
||||
}
|
||||
|
||||
f_out_ << "\"];" << endl;
|
||||
}
|
||||
|
||||
void t_gv_generator::generate_const(t_const* tconst) {
|
||||
string name = tconst->get_name();
|
||||
|
||||
f_out_ << "node [fillcolor=aliceblue];" << endl;
|
||||
f_out_ << "const_" << name << " [label=\"";
|
||||
|
||||
f_out_ << escape_string(name);
|
||||
f_out_ << " = ";
|
||||
print_const_value(tconst->get_type(), tconst->get_value());
|
||||
f_out_ << " :: ";
|
||||
print_type(tconst->get_type(), "const_" + name);
|
||||
|
||||
f_out_ << "\"];" << endl;
|
||||
}
|
||||
|
||||
void t_gv_generator::generate_struct(t_struct* tstruct) {
|
||||
string name = tstruct->get_name();
|
||||
|
||||
if (tstruct->is_xception()) {
|
||||
f_out_ << "node [fillcolor=lightpink];" << endl;
|
||||
f_out_ << name << " [label=\"";
|
||||
f_out_ << "exception " << escape_string(name);
|
||||
} else if (tstruct->is_union()) {
|
||||
f_out_ << "node [fillcolor=lightcyan];" << endl;
|
||||
f_out_ << name << " [label=\"";
|
||||
f_out_ << "union " << escape_string(name);
|
||||
} else {
|
||||
f_out_ << "node [fillcolor=beige];" << endl;
|
||||
f_out_ << name << " [label=\"";
|
||||
f_out_ << "struct " << escape_string(name);
|
||||
}
|
||||
|
||||
vector<t_field*> members = tstruct->get_members();
|
||||
vector<t_field*>::iterator mem_iter = members.begin();
|
||||
for (; mem_iter != members.end(); mem_iter++) {
|
||||
string field_name = (*mem_iter)->get_name();
|
||||
|
||||
// print port (anchor reference)
|
||||
f_out_ << "|<field_" << field_name << '>';
|
||||
|
||||
// field name :: field type
|
||||
f_out_ << (*mem_iter)->get_name();
|
||||
f_out_ << " :: ";
|
||||
print_type((*mem_iter)->get_type(), name + ":field_" + field_name);
|
||||
}
|
||||
|
||||
f_out_ << "\"];" << endl;
|
||||
}
|
||||
|
||||
void t_gv_generator::print_type(t_type* ttype, string struct_field_ref) {
|
||||
if (ttype->is_container()) {
|
||||
if (ttype->is_list()) {
|
||||
f_out_ << "list\\<";
|
||||
print_type(((t_list*)ttype)->get_elem_type(), struct_field_ref);
|
||||
f_out_ << "\\>";
|
||||
} else if (ttype->is_set()) {
|
||||
f_out_ << "set\\<";
|
||||
print_type(((t_set*)ttype)->get_elem_type(), struct_field_ref);
|
||||
f_out_ << "\\>";
|
||||
} else if (ttype->is_map()) {
|
||||
f_out_ << "map\\<";
|
||||
print_type(((t_map*)ttype)->get_key_type(), struct_field_ref);
|
||||
f_out_ << ", ";
|
||||
print_type(((t_map*)ttype)->get_val_type(), struct_field_ref);
|
||||
f_out_ << "\\>";
|
||||
}
|
||||
} else if (ttype->is_base_type()) {
|
||||
f_out_ << (ttype->is_binary() ? "binary" : ttype->get_name());
|
||||
} else {
|
||||
f_out_ << ttype->get_name();
|
||||
edges.push_back(struct_field_ref + " -> " + ttype->get_name());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints out an string representation of the provided constant value
|
||||
*/
|
||||
void t_gv_generator::print_const_value(t_type* type, t_const_value* tvalue) {
|
||||
bool first = true;
|
||||
switch (tvalue->get_type()) {
|
||||
case t_const_value::CV_INTEGER:
|
||||
f_out_ << tvalue->get_integer();
|
||||
break;
|
||||
case t_const_value::CV_DOUBLE:
|
||||
f_out_ << tvalue->get_double();
|
||||
break;
|
||||
case t_const_value::CV_STRING:
|
||||
f_out_ << "\\\"" << get_escaped_string(tvalue) << "\\\"";
|
||||
break;
|
||||
case t_const_value::CV_MAP: {
|
||||
f_out_ << "\\{ ";
|
||||
map<t_const_value*, t_const_value*, t_const_value::value_compare> map_elems = tvalue->get_map();
|
||||
map<t_const_value*, t_const_value*, t_const_value::value_compare>::iterator map_iter;
|
||||
for (map_iter = map_elems.begin(); map_iter != map_elems.end(); map_iter++) {
|
||||
if (!first) {
|
||||
f_out_ << ", ";
|
||||
}
|
||||
first = false;
|
||||
print_const_value(((t_map*)type)->get_key_type(), map_iter->first);
|
||||
f_out_ << " = ";
|
||||
print_const_value(((t_map*)type)->get_val_type(), map_iter->second);
|
||||
}
|
||||
f_out_ << " \\}";
|
||||
} break;
|
||||
case t_const_value::CV_LIST: {
|
||||
f_out_ << "\\{ ";
|
||||
vector<t_const_value*> list_elems = tvalue->get_list();
|
||||
;
|
||||
vector<t_const_value*>::iterator list_iter;
|
||||
for (list_iter = list_elems.begin(); list_iter != list_elems.end(); list_iter++) {
|
||||
if (!first) {
|
||||
f_out_ << ", ";
|
||||
}
|
||||
first = false;
|
||||
if (type->is_list()) {
|
||||
print_const_value(((t_list*)type)->get_elem_type(), *list_iter);
|
||||
} else {
|
||||
print_const_value(((t_set*)type)->get_elem_type(), *list_iter);
|
||||
}
|
||||
}
|
||||
f_out_ << " \\}";
|
||||
} break;
|
||||
case t_const_value::CV_IDENTIFIER:
|
||||
f_out_ << escape_string(type->get_name()) << "."
|
||||
<< escape_string(tvalue->get_identifier_name());
|
||||
break;
|
||||
default:
|
||||
f_out_ << "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void t_gv_generator::generate_service(t_service* tservice) {
|
||||
string service_name = get_service_name(tservice);
|
||||
f_out_ << "subgraph cluster_" << service_name << " {" << endl;
|
||||
f_out_ << "node [fillcolor=bisque];" << endl;
|
||||
f_out_ << "style=dashed;" << endl;
|
||||
f_out_ << "label = \"" << escape_string(service_name) << " service\";" << endl;
|
||||
|
||||
// TODO: service extends
|
||||
|
||||
vector<t_function*> functions = tservice->get_functions();
|
||||
vector<t_function*>::iterator fn_iter = functions.begin();
|
||||
for (; fn_iter != functions.end(); fn_iter++) {
|
||||
string fn_name = (*fn_iter)->get_name();
|
||||
|
||||
f_out_ << "function_" << service_name << fn_name;
|
||||
f_out_ << "[label=\"<return_type>function " << escape_string(fn_name);
|
||||
f_out_ << " :: ";
|
||||
print_type((*fn_iter)->get_returntype(), "function_" + service_name + fn_name + ":return_type");
|
||||
|
||||
vector<t_field*> args = (*fn_iter)->get_arglist()->get_members();
|
||||
vector<t_field*>::iterator arg_iter = args.begin();
|
||||
for (; arg_iter != args.end(); arg_iter++) {
|
||||
f_out_ << "|<param_" << (*arg_iter)->get_name() << ">";
|
||||
f_out_ << (*arg_iter)->get_name();
|
||||
if ((*arg_iter)->get_value() != NULL) {
|
||||
f_out_ << " = ";
|
||||
print_const_value((*arg_iter)->get_type(), (*arg_iter)->get_value());
|
||||
}
|
||||
f_out_ << " :: ";
|
||||
print_type((*arg_iter)->get_type(),
|
||||
"function_" + service_name + fn_name + ":param_" + (*arg_iter)->get_name());
|
||||
}
|
||||
// end of node
|
||||
f_out_ << "\"];" << endl;
|
||||
|
||||
// Exception edges
|
||||
if (exception_arrows) {
|
||||
vector<t_field*> excepts = (*fn_iter)->get_xceptions()->get_members();
|
||||
vector<t_field*>::iterator ex_iter = excepts.begin();
|
||||
for (; ex_iter != excepts.end(); ex_iter++) {
|
||||
edges.push_back("function_" + service_name + fn_name + " -> "
|
||||
+ (*ex_iter)->get_type()->get_name() + " [color=red]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
f_out_ << " }" << endl;
|
||||
}
|
||||
|
||||
THRIFT_REGISTER_GENERATOR(
|
||||
gv,
|
||||
"Graphviz",
|
||||
" exceptions: Whether to draw arrows from functions to exception.\n")
|
2983
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
generated
vendored
2983
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
1732
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_hs_generator.cc
generated
vendored
1732
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_hs_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
1088
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_html_generator.cc
generated
vendored
1088
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_html_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
240
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_html_generator.h
generated
vendored
240
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_html_generator.h
generated
vendored
|
@ -1,240 +0,0 @@
|
|||
#define BOOTSTRAP_CSS() \
|
||||
"/*!\n" \
|
||||
" * Bootstrap v2.0.3\n" \
|
||||
" *\n" \
|
||||
" * Copyright 2012 Twitter, Inc\n" \
|
||||
" * Licensed under the Apache License v2.0\n" \
|
||||
" * http://www.apache.org/licenses/LICENSE-2.0\n" \
|
||||
" *\n" \
|
||||
" * Designed and built with all the love in the world @twitter by @mdo and @fat.\n" \
|
||||
" */\n" \
|
||||
".clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:\"\";}\n" \
|
||||
".clearfix:after{clear:both;}\n" \
|
||||
".hide-text{font:0/0 " \
|
||||
"a;color:transparent;text-shadow:none;background-color:transparent;border:0;}\n" \
|
||||
".input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-" \
|
||||
"moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}\n" \
|
||||
"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}\n" \
|
||||
"audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}\n" \
|
||||
"audio:not([controls]){display:none;}\n" \
|
||||
"html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}\n" \
|
||||
"a:focus{outline:thin dotted #333;outline:5px auto " \
|
||||
"-webkit-focus-ring-color;outline-offset:-2px;}\n" \
|
||||
"a:hover,a:active{outline:0;}\n" \
|
||||
"sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;}\n" \
|
||||
"sup{top:-0.5em;}\n" \
|
||||
"sub{bottom:-0.25em;}\n" \
|
||||
"img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;}\n" \
|
||||
"button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;}\n" \
|
||||
"button,input{*overflow:visible;line-height:normal;}\n" \
|
||||
"button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;}\n" \
|
||||
"button,input[type=\"button\"],input[type=\"reset\"],input[type=\"submit\"]{cursor:pointer;-" \
|
||||
"webkit-appearance:button;}\n" \
|
||||
"input[type=\"search\"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:" \
|
||||
"content-box;-webkit-appearance:textfield;}\n" \
|
||||
"input[type=\"search\"]::-webkit-search-decoration,input[type=\"search\"]::-webkit-search-" \
|
||||
"cancel-button{-webkit-appearance:none;}\n" \
|
||||
"textarea{overflow:auto;vertical-align:top;}\n" \
|
||||
"body{margin:0;font-family:\"Helvetica " \
|
||||
"Neue\",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-" \
|
||||
"color:#ffffff;}\n" \
|
||||
"a{color:#0088cc;text-decoration:none;}\n" \
|
||||
"a:hover{color:#005580;text-decoration:underline;}\n" \
|
||||
".row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:\"\";}\n" \
|
||||
".row:after{clear:both;}\n" \
|
||||
"[class*=\"span\"]{float:left;margin-left:20px;}\n" \
|
||||
".container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;}\n" \
|
||||
".span12{width:940px;}\n" \
|
||||
".span11{width:860px;}\n" \
|
||||
".span10{width:780px;}\n" \
|
||||
".span9{width:700px;}\n" \
|
||||
".span8{width:620px;}\n" \
|
||||
".span7{width:540px;}\n" \
|
||||
".span6{width:460px;}\n" \
|
||||
".span5{width:380px;}\n" \
|
||||
".span4{width:300px;}\n" \
|
||||
".span3{width:220px;}\n" \
|
||||
".span2{width:140px;}\n" \
|
||||
".span1{width:60px;}\n" \
|
||||
".offset12{margin-left:980px;}\n" \
|
||||
".offset11{margin-left:900px;}\n" \
|
||||
".offset10{margin-left:820px;}\n" \
|
||||
".offset9{margin-left:740px;}\n" \
|
||||
".offset8{margin-left:660px;}\n" \
|
||||
".offset7{margin-left:580px;}\n" \
|
||||
".offset6{margin-left:500px;}\n" \
|
||||
".offset5{margin-left:420px;}\n" \
|
||||
".offset4{margin-left:340px;}\n" \
|
||||
".offset3{margin-left:260px;}\n" \
|
||||
".offset2{margin-left:180px;}\n" \
|
||||
".offset1{margin-left:100px;}\n" \
|
||||
".row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:\"\";}" \
|
||||
"\n" \
|
||||
".row-fluid:after{clear:both;}\n" \
|
||||
".row-fluid " \
|
||||
"[class*=\"span\"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-" \
|
||||
"box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:" \
|
||||
"2.127659574%;*margin-left:2.0744680846382977%;}\n" \
|
||||
".row-fluid [class*=\"span\"]:first-child{margin-left:0;}\n" \
|
||||
".row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%;}\n" \
|
||||
".row-fluid .span11{width:91.489361693%;*width:91.4361702036383%;}\n" \
|
||||
".row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%;}\n" \
|
||||
".row-fluid .span9{width:74.468085099%;*width:74.4148936096383%;}\n" \
|
||||
".row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%;}\n" \
|
||||
".row-fluid .span7{width:57.446808505%;*width:57.3936170156383%;}\n" \
|
||||
".row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%;}\n" \
|
||||
".row-fluid .span5{width:40.425531911%;*width:40.3723404216383%;}\n" \
|
||||
".row-fluid .span4{width:31.914893614%;*width:31.8617021246383%;}\n" \
|
||||
".row-fluid .span3{width:23.404255317%;*width:23.3510638276383%;}\n" \
|
||||
".row-fluid .span2{width:14.89361702%;*width:14.8404255306383%;}\n" \
|
||||
".row-fluid .span1{width:6.382978723%;*width:6.329787233638298%;}\n" \
|
||||
".container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{" \
|
||||
"display:table;content:\"\";}\n" \
|
||||
".container:after{clear:both;}\n" \
|
||||
".container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,." \
|
||||
"container-fluid:after{display:table;content:\"\";}\n" \
|
||||
".container-fluid:after{clear:both;}\n" \
|
||||
"p{margin:0 0 9px;font-family:\"Helvetica " \
|
||||
"Neue\",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p " \
|
||||
"small{font-size:11px;color:#999999;}\n" \
|
||||
".lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;}\n" \
|
||||
"h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:" \
|
||||
"optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 " \
|
||||
"small{font-weight:normal;color:#999999;}\n" \
|
||||
"h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;}\n" \
|
||||
"h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;}\n" \
|
||||
"h3{font-size:18px;line-height:27px;}h3 small{font-size:14px;}\n" \
|
||||
"h4,h5,h6{line-height:18px;}\n" \
|
||||
"h4{font-size:14px;}h4 small{font-size:12px;}\n" \
|
||||
"h5{font-size:12px;}\n" \
|
||||
"h6{font-size:11px;color:#999999;text-transform:uppercase;}\n" \
|
||||
".page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;}\n" \
|
||||
".page-header h1{line-height:1;}\n" \
|
||||
"ul,ol{padding:0;margin:0 0 9px 25px;}\n" \
|
||||
"ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}\n" \
|
||||
"ul{list-style:disc;}\n" \
|
||||
"ol{list-style:decimal;}\n" \
|
||||
"li{line-height:18px;}\n" \
|
||||
"ul.unstyled,ol.unstyled{margin-left:0;list-style:none;}\n" \
|
||||
"dl{margin-bottom:18px;}\n" \
|
||||
"dt,dd{line-height:18px;}\n" \
|
||||
"dt{font-weight:bold;line-height:17px;}\n" \
|
||||
"dd{margin-left:9px;}\n" \
|
||||
".dl-horizontal " \
|
||||
"dt{float:left;width:120px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;" \
|
||||
"white-space:nowrap;}\n" \
|
||||
".dl-horizontal dd{margin-left:130px;}\n" \
|
||||
"hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;}\n" \
|
||||
"strong{font-weight:bold;}\n" \
|
||||
"em{font-style:italic;}\n" \
|
||||
".muted{color:#999999;}\n" \
|
||||
"abbr[title]{cursor:help;border-bottom:1px dotted #ddd;}\n" \
|
||||
"abbr.initialism{font-size:90%;text-transform:uppercase;}\n" \
|
||||
"blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote " \
|
||||
"p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;}\n" \
|
||||
"blockquote small{display:block;line-height:18px;color:#999999;}blockquote " \
|
||||
"small:before{content:'\\2014 \\00A0';}\n" \
|
||||
"blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid " \
|
||||
"#eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right " \
|
||||
"small{text-align:right;}\n" \
|
||||
"q:before,q:after,blockquote:before,blockquote:after{content:\"\";}\n" \
|
||||
"address{display:block;margin-bottom:18px;font-style:normal;line-height:18px;}\n" \
|
||||
"small{font-size:100%;}\n" \
|
||||
"cite{font-style:normal;}\n" \
|
||||
"code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,Consolas,\"Courier " \
|
||||
"New\",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;" \
|
||||
"border-radius:3px;}\n" \
|
||||
"code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;}\n" \
|
||||
"pre{display:block;padding:8.5px;margin:0 0 " \
|
||||
"9px;font-size:12.025px;line-height:18px;word-break:break-all;word-wrap:break-word;white-space:" \
|
||||
"pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid " \
|
||||
"rgba(0, 0, 0, " \
|
||||
"0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{" \
|
||||
"margin-bottom:18px;}\n" \
|
||||
"pre code{padding:0;color:inherit;background-color:transparent;border:0;}\n" \
|
||||
".pre-scrollable{max-height:340px;overflow-y:scroll;}\n" \
|
||||
".label,.badge{font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-" \
|
||||
"align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, " \
|
||||
"0.25);background-color:#999999;}\n" \
|
||||
".label{padding:1px 4px " \
|
||||
"2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}\n" \
|
||||
".badge{padding:1px 9px " \
|
||||
"2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}\n" \
|
||||
"a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;}\n" \
|
||||
".label-important,.badge-important{background-color:#b94a48;}\n" \
|
||||
".label-important[href],.badge-important[href]{background-color:#953b39;}\n" \
|
||||
".label-warning,.badge-warning{background-color:#f89406;}\n" \
|
||||
".label-warning[href],.badge-warning[href]{background-color:#c67605;}\n" \
|
||||
".label-success,.badge-success{background-color:#468847;}\n" \
|
||||
".label-success[href],.badge-success[href]{background-color:#356635;}\n" \
|
||||
".label-info,.badge-info{background-color:#3a87ad;}\n" \
|
||||
".label-info[href],.badge-info[href]{background-color:#2d6987;}\n" \
|
||||
".label-inverse,.badge-inverse{background-color:#333333;}\n" \
|
||||
".label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;}\n" \
|
||||
"table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;}" \
|
||||
"\n" \
|
||||
".table{width:100%;margin-bottom:18px;}.table th,.table " \
|
||||
"td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid " \
|
||||
"#dddddd;}\n" \
|
||||
".table th{font-weight:bold;}\n" \
|
||||
".table thead th{vertical-align:bottom;}\n" \
|
||||
".table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table " \
|
||||
"colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table " \
|
||||
"thead:first-child tr:first-child th,.table thead:first-child tr:first-child " \
|
||||
"td{border-top:0;}\n" \
|
||||
".table tbody+tbody{border-top:2px solid #dddddd;}\n" \
|
||||
".table-condensed th,.table-condensed td{padding:4px 5px;}\n" \
|
||||
".table-bordered{border:1px solid " \
|
||||
"#dddddd;border-collapse:separate;*border-collapse:collapsed;border-left:0;-webkit-border-" \
|
||||
"radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered " \
|
||||
"td{border-left:1px solid #dddddd;}\n" \
|
||||
".table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child " \
|
||||
"th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead " \
|
||||
"tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered " \
|
||||
"colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child " \
|
||||
"th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child " \
|
||||
"tr:first-child td{border-top:0;}\n" \
|
||||
".table-bordered thead:first-child tr:first-child th:first-child,.table-bordered " \
|
||||
"tbody:first-child tr:first-child " \
|
||||
"td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-" \
|
||||
"radius-topleft:4px;}\n" \
|
||||
".table-bordered thead:first-child tr:first-child th:last-child,.table-bordered " \
|
||||
"tbody:first-child tr:first-child " \
|
||||
"td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-" \
|
||||
"radius-topright:4px;}\n" \
|
||||
".table-bordered thead:last-child tr:last-child th:first-child,.table-bordered " \
|
||||
"tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 " \
|
||||
"4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 " \
|
||||
"4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-" \
|
||||
"bottomleft:4px;}\n" \
|
||||
".table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child " \
|
||||
"tr:last-child " \
|
||||
"td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-" \
|
||||
"border-radius-bottomright:4px;}\n" \
|
||||
".table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) " \
|
||||
"th{background-color:#f9f9f9;}\n" \
|
||||
".table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;}\n" \
|
||||
"table .span1{float:none;width:44px;margin-left:0;}\n" \
|
||||
"table .span2{float:none;width:124px;margin-left:0;}\n" \
|
||||
"table .span3{float:none;width:204px;margin-left:0;}\n" \
|
||||
"table .span4{float:none;width:284px;margin-left:0;}\n" \
|
||||
"table .span5{float:none;width:364px;margin-left:0;}\n" \
|
||||
"table .span6{float:none;width:444px;margin-left:0;}\n" \
|
||||
"table .span7{float:none;width:524px;margin-left:0;}\n" \
|
||||
"table .span8{float:none;width:604px;margin-left:0;}\n" \
|
||||
"table .span9{float:none;width:684px;margin-left:0;}\n" \
|
||||
"table .span10{float:none;width:764px;margin-left:0;}\n" \
|
||||
"table .span11{float:none;width:844px;margin-left:0;}\n" \
|
||||
"table .span12{float:none;width:924px;margin-left:0;}\n" \
|
||||
"table .span13{float:none;width:1004px;margin-left:0;}\n" \
|
||||
"table .span14{float:none;width:1084px;margin-left:0;}\n" \
|
||||
"table .span15{float:none;width:1164px;margin-left:0;}\n" \
|
||||
"table .span16{float:none;width:1244px;margin-left:0;}\n" \
|
||||
"table .span17{float:none;width:1324px;margin-left:0;}\n" \
|
||||
"table .span18{float:none;width:1404px;margin-left:0;}\n" \
|
||||
"table .span19{float:none;width:1484px;margin-left:0;}\n" \
|
||||
"table .span20{float:none;width:1564px;margin-left:0;}\n" \
|
||||
"table .span21{float:none;width:1644px;margin-left:0;}\n" \
|
||||
"table .span22{float:none;width:1724px;margin-left:0;}\n" \
|
||||
"table .span23{float:none;width:1804px;margin-left:0;}\n" \
|
||||
"table .span24{float:none;width:1884px;margin-left:0;}"
|
5454
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_java_generator.cc
generated
vendored
5454
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_java_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
3296
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_javame_generator.cc
generated
vendored
3296
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_javame_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
2721
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_js_generator.cc
generated
vendored
2721
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_js_generator.cc
generated
vendored
File diff suppressed because it is too large
Load diff
793
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_json_generator.cc
generated
vendored
793
vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_json_generator.cc
generated
vendored
|
@ -1,793 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
* Contains some contributions under the Thrift Software License.
|
||||
* Please see doc/old-thrift-license.txt in the Thrift distribution for
|
||||
* details.
|
||||
*/
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <limits>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "thrift/platform.h"
|
||||
#include "thrift/generate/t_generator.h"
|
||||
|
||||
using std::map;
|
||||
using std::ofstream;
|
||||
using std::ostream;
|
||||
using std::ostringstream;
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
using std::vector;
|
||||
using std::stack;
|
||||
|
||||
static const string endl = "\n";
|
||||
static const string quot = "\"";
|
||||
static const bool NO_INDENT = false;
|
||||
static const bool FORCE_STRING = true;
|
||||
|
||||
class t_json_generator : public t_generator {
|
||||
public:
|
||||
t_json_generator(t_program* program,
|
||||
const std::map<std::string, std::string>& parsed_options,
|
||||
const std::string& option_string)
|
||||
: t_generator(program) {
|
||||
(void)option_string;
|
||||
std::map<std::string, std::string>::const_iterator iter;
|
||||
|
||||
should_merge_includes_ = false;
|
||||
for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
|
||||
if( iter->first.compare("merge") == 0) {
|
||||
should_merge_includes_ = true;
|
||||
} else {
|
||||
throw "unknown option json:" + iter->first;
|
||||
}
|
||||
}
|
||||
|
||||
out_dir_base_ = "gen-json";
|
||||
}
|
||||
|
||||
virtual ~t_json_generator() {}
|
||||
|
||||
/**
|
||||
* Init and close methods
|
||||
*/
|
||||
|
||||
void init_generator();
|
||||
void close_generator();
|
||||
|
||||
void generate_typedef(t_typedef* ttypedef);
|
||||
void generate_enum(t_enum* tenum);
|
||||
void generate_program();
|
||||
void generate_function(t_function* tfunc);
|
||||
void generate_field(t_field* field);
|
||||
|
||||
void generate_service(t_service* tservice);
|
||||
void generate_struct(t_struct* tstruct);
|
||||
|
||||
private:
|
||||
bool should_merge_includes_;
|
||||
|
||||
ofstream_with_content_based_conditional_update f_json_;
|
||||
std::stack<bool> comma_needed_;
|
||||
|
||||
template <typename T>
|
||||
string number_to_string(T t) {
|
||||
std::ostringstream out;
|
||||
out.imbue(std::locale::classic());
|
||||
out.precision(std::numeric_limits<T>::digits10);
|
||||
out << t;
|
||||
return out.str();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void write_number(T n) {
|
||||
f_json_ << number_to_string(n);
|
||||
}
|
||||
|
||||
string get_type_name(t_type* ttype);
|
||||
string get_qualified_name(t_type* ttype);
|
||||
|
||||
void start_object(bool should_indent = true);
|
||||
void start_array();
|
||||
void end_object();
|
||||
void end_array();
|
||||
void write_comma_if_needed();
|
||||
void indicate_comma_needed();
|
||||
string escape_json_string(const string& input);
|
||||
string json_str(const string& str);
|
||||
void merge_includes(t_program*);
|
||||
|
||||
void generate_constant(t_const* con);
|
||||
|
||||
void write_type_spec_entry(const char* name, t_type* ttype);
|
||||
void write_type_spec_object(const char* name, t_type* ttype);
|
||||
void write_type_spec(t_type* ttype);
|
||||
void write_string(const string& value);
|
||||
void write_value(t_type* tvalue);
|
||||
void write_const_value(t_const_value* value, bool force_string = false);
|
||||
void write_key_and(string key);
|
||||
void write_key_and_string(string key, string val);
|
||||
void write_key_and_integer(string key, int val);
|
||||
void write_key_and_bool(string key, bool val);
|
||||
};
|
||||
|
||||
void t_json_generator::init_generator() {
|
||||
MKDIR(get_out_dir().c_str());
|
||||
|
||||
string f_json_name = get_out_dir() + program_->get_name() + ".json";
|
||||
f_json_.open(f_json_name.c_str());
|
||||
|
||||
// Merge all included programs into this one so we can output one big file.
|
||||
if (should_merge_includes_) {
|
||||
merge_includes(program_);
|
||||
}
|
||||
}
|
||||
|
||||
string t_json_generator::escape_json_string(const string& input) {
|
||||
std::ostringstream ss;
|
||||
for (std::string::const_iterator iter = input.begin(); iter != input.end(); iter++) {
|
||||
switch (*iter) {
|
||||
case '\\':
|
||||
ss << "\\\\";
|
||||
break;
|
||||
case '"':
|
||||
ss << "\\\"";
|
||||
break;
|
||||
case '/':
|
||||
ss << "\\/";
|
||||
break;
|
||||
case '\b':
|
||||
ss << "\\b";
|
||||
break;
|
||||
case '\f':
|
||||
ss << "\\f";
|
||||
break;
|
||||
case '\n':
|
||||
ss << "\\n";
|
||||
break;
|
||||
case '\r':
|
||||
ss << "\\r";
|
||||
break;
|
||||
case '\t':
|
||||
ss << "\\t";
|
||||
break;
|
||||
default:
|
||||
ss << *iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void t_json_generator::start_object(bool should_indent) {
|
||||
f_json_ << (should_indent ? indent() : "") << "{" << endl;
|
||||
indent_up();
|
||||
comma_needed_.push(false);
|
||||
}
|
||||
|
||||
void t_json_generator::start_array() {
|
||||
f_json_ << "[" << endl;
|
||||
indent_up();
|
||||
comma_needed_.push(false);
|
||||
}
|
||||
|
||||
void t_json_generator::write_comma_if_needed() {
|
||||
if (comma_needed_.top()) {
|
||||
f_json_ << "," << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void t_json_generator::indicate_comma_needed() {
|
||||
comma_needed_.pop();
|
||||
comma_needed_.push(true);
|
||||
}
|
||||
|
||||
void t_json_generator::write_key_and(string key) {
|
||||
write_comma_if_needed();
|
||||
indent(f_json_) << json_str(key) << ": ";
|
||||
indicate_comma_needed();
|
||||
}
|
||||
|
||||
void t_json_generator::write_key_and_integer(string key, int val) {
|
||||
write_comma_if_needed();
|
||||
indent(f_json_) << json_str(key) << ": " << number_to_string(val);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
|
||||
void t_json_generator::write_key_and_string(string key, string val) {
|
||||
write_comma_if_needed();
|
||||
indent(f_json_) << json_str(key) << ": " << json_str(val);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
|
||||
void t_json_generator::write_key_and_bool(string key, bool val) {
|
||||
write_comma_if_needed();
|
||||
indent(f_json_) << json_str(key) << ": " << (val ? "true" : "false");
|
||||
indicate_comma_needed();
|
||||
}
|
||||
|
||||
void t_json_generator::end_object() {
|
||||
indent_down();
|
||||
f_json_ << endl << indent() << "}";
|
||||
comma_needed_.pop();
|
||||
}
|
||||
|
||||
void t_json_generator::end_array() {
|
||||
indent_down();
|
||||
if (comma_needed_.top()) {
|
||||
f_json_ << endl;
|
||||
}
|
||||
indent(f_json_) << "]";
|
||||
comma_needed_.pop();
|
||||
}
|
||||
|
||||
void t_json_generator::write_type_spec_object(const char* name, t_type* ttype) {
|
||||
ttype = ttype->get_true_type();
|
||||
if (ttype->is_struct() || ttype->is_xception() || ttype->is_container()) {
|
||||
write_key_and(name);
|
||||
start_object(NO_INDENT);
|
||||
write_key_and("typeId");
|
||||
write_type_spec(ttype);
|
||||
end_object();
|
||||
}
|
||||
}
|
||||
|
||||
void t_json_generator::write_type_spec_entry(const char* name, t_type* ttype) {
|
||||
write_key_and(name);
|
||||
write_type_spec(ttype);
|
||||
}
|
||||
|
||||
void t_json_generator::write_type_spec(t_type* ttype) {
|
||||
ttype = ttype->get_true_type();
|
||||
|
||||
write_string(get_type_name(ttype));
|
||||
|
||||
if (ttype->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = ttype->annotations_.begin(); it != ttype->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
if (ttype->is_struct() || ttype->is_xception()) {
|
||||
write_key_and_string("class", get_qualified_name(ttype));
|
||||
} else if (ttype->is_map()) {
|
||||
t_type* ktype = ((t_map*)ttype)->get_key_type();
|
||||
t_type* vtype = ((t_map*)ttype)->get_val_type();
|
||||
write_key_and_string("keyTypeId", get_type_name(ktype));
|
||||
write_key_and_string("valueTypeId", get_type_name(vtype));
|
||||
write_type_spec_object("keyType", ktype);
|
||||
write_type_spec_object("valueType", vtype);
|
||||
} else if (ttype->is_list()) {
|
||||
t_type* etype = ((t_list*)ttype)->get_elem_type();
|
||||
write_key_and_string("elemTypeId", get_type_name(etype));
|
||||
write_type_spec_object("elemType", etype);
|
||||
} else if (ttype->is_set()) {
|
||||
t_type* etype = ((t_set*)ttype)->get_elem_type();
|
||||
write_key_and_string("elemTypeId", get_type_name(etype));
|
||||
write_type_spec_object("elemType", etype);
|
||||
}
|
||||
}
|
||||
|
||||
void t_json_generator::close_generator() {
|
||||
f_json_ << endl;
|
||||
f_json_.close();
|
||||
}
|
||||
|
||||
void t_json_generator::merge_includes(t_program* program) {
|
||||
vector<t_program*> includes = program->get_includes();
|
||||
vector<t_program*>::iterator inc_iter;
|
||||
for (inc_iter = includes.begin(); inc_iter != includes.end(); ++inc_iter) {
|
||||
t_program* include = *inc_iter;
|
||||
// recurse in case we get crazy
|
||||
merge_includes(include);
|
||||
// merge enums
|
||||
vector<t_enum*> enums = include->get_enums();
|
||||
vector<t_enum*>::iterator en_iter;
|
||||
for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
|
||||
program->add_enum(*en_iter);
|
||||
}
|
||||
// merge typedefs
|
||||
vector<t_typedef*> typedefs = include->get_typedefs();
|
||||
vector<t_typedef*>::iterator td_iter;
|
||||
for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
|
||||
program->add_typedef(*td_iter);
|
||||
}
|
||||
// merge structs
|
||||
vector<t_struct*> objects = include->get_objects();
|
||||
vector<t_struct*>::iterator o_iter;
|
||||
for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
|
||||
program->add_struct(*o_iter);
|
||||
}
|
||||
// merge constants
|
||||
vector<t_const*> consts = include->get_consts();
|
||||
vector<t_const*>::iterator c_iter;
|
||||
for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
|
||||
program->add_const(*c_iter);
|
||||
}
|
||||
|
||||
// merge services
|
||||
vector<t_service*> services = include->get_services();
|
||||
vector<t_service*>::iterator sv_iter;
|
||||
for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
|
||||
program->add_service(*sv_iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void t_json_generator::generate_program() {
|
||||
|
||||
init_generator();
|
||||
|
||||
start_object();
|
||||
write_key_and_string("name", program_->get_name());
|
||||
if (program_->has_doc()) {
|
||||
write_key_and_string("doc", program_->get_doc());
|
||||
}
|
||||
|
||||
// When merging includes, the "namespaces" and "includes" sections
|
||||
// become ambiguous, so just skip them.
|
||||
if (!should_merge_includes_) {
|
||||
// Generate namespaces
|
||||
write_key_and("namespaces");
|
||||
start_object(NO_INDENT);
|
||||
const map<string, string>& namespaces = program_->get_namespaces();
|
||||
map<string, string>::const_iterator ns_it;
|
||||
for (ns_it = namespaces.begin(); ns_it != namespaces.end(); ++ns_it) {
|
||||
write_key_and_string(ns_it->first, ns_it->second);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_object();
|
||||
|
||||
// Generate includes
|
||||
write_key_and("includes");
|
||||
start_array();
|
||||
const vector<t_program*> includes = program_->get_includes();
|
||||
vector<t_program*>::const_iterator inc_it;
|
||||
for (inc_it = includes.begin(); inc_it != includes.end(); ++inc_it) {
|
||||
write_comma_if_needed();
|
||||
write_string((*inc_it)->get_name());
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
}
|
||||
|
||||
// Generate enums
|
||||
write_key_and("enums");
|
||||
start_array();
|
||||
vector<t_enum*> enums = program_->get_enums();
|
||||
vector<t_enum*>::iterator en_iter;
|
||||
for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
|
||||
write_comma_if_needed();
|
||||
generate_enum(*en_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
// Generate typedefs
|
||||
write_key_and("typedefs");
|
||||
start_array();
|
||||
vector<t_typedef*> typedefs = program_->get_typedefs();
|
||||
vector<t_typedef*>::iterator td_iter;
|
||||
for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
|
||||
write_comma_if_needed();
|
||||
generate_typedef(*td_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
// Generate structs, exceptions, and unions in declared order
|
||||
write_key_and("structs");
|
||||
start_array();
|
||||
vector<t_struct*> objects = program_->get_objects();
|
||||
vector<t_struct*>::iterator o_iter;
|
||||
for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
|
||||
write_comma_if_needed();
|
||||
if ((*o_iter)->is_xception()) {
|
||||
generate_xception(*o_iter);
|
||||
} else {
|
||||
generate_struct(*o_iter);
|
||||
}
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
// Generate constants
|
||||
write_key_and("constants");
|
||||
start_array();
|
||||
vector<t_const*> consts = program_->get_consts();
|
||||
vector<t_const*>::iterator c_iter;
|
||||
for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
|
||||
write_comma_if_needed();
|
||||
generate_constant(*c_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
// Generate services
|
||||
write_key_and("services");
|
||||
start_array();
|
||||
vector<t_service*> services = program_->get_services();
|
||||
vector<t_service*>::iterator sv_iter;
|
||||
for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
|
||||
write_comma_if_needed();
|
||||
generate_service(*sv_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
end_object();
|
||||
|
||||
// Close the generator
|
||||
close_generator();
|
||||
}
|
||||
|
||||
void t_json_generator::generate_typedef(t_typedef* ttypedef) {
|
||||
start_object();
|
||||
write_key_and_string("name", get_qualified_name(ttypedef));
|
||||
write_key_and_string("typeId", get_type_name(ttypedef->get_true_type()));
|
||||
write_type_spec_object("type", ttypedef->get_true_type());
|
||||
if (ttypedef->has_doc()) {
|
||||
write_key_and_string("doc", ttypedef->get_doc());
|
||||
}
|
||||
if (ttypedef->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = ttypedef->annotations_.begin(); it != ttypedef->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
void t_json_generator::write_string(const string& value) {
|
||||
f_json_ << quot << escape_json_string(value) << quot;
|
||||
}
|
||||
|
||||
void t_json_generator::write_const_value(t_const_value* value, bool should_force_string) {
|
||||
|
||||
switch (value->get_type()) {
|
||||
|
||||
case t_const_value::CV_IDENTIFIER:
|
||||
case t_const_value::CV_INTEGER:
|
||||
if (should_force_string) {
|
||||
write_string(number_to_string(value->get_integer()));
|
||||
} else {
|
||||
write_number(value->get_integer());
|
||||
}
|
||||
break;
|
||||
|
||||
case t_const_value::CV_DOUBLE:
|
||||
if (should_force_string) {
|
||||
write_string(number_to_string(value->get_double()));
|
||||
} else {
|
||||
write_number(value->get_double());
|
||||
}
|
||||
break;
|
||||
|
||||
case t_const_value::CV_STRING:
|
||||
write_string(value->get_string());
|
||||
break;
|
||||
|
||||
case t_const_value::CV_LIST: {
|
||||
start_array();
|
||||
std::vector<t_const_value*> list = value->get_list();
|
||||
std::vector<t_const_value*>::iterator lit;
|
||||
for (lit = list.begin(); lit != list.end(); ++lit) {
|
||||
write_comma_if_needed();
|
||||
f_json_ << indent();
|
||||
write_const_value(*lit);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
break;
|
||||
}
|
||||
|
||||
case t_const_value::CV_MAP: {
|
||||
start_object(NO_INDENT);
|
||||
std::map<t_const_value*, t_const_value*, t_const_value::value_compare> map = value->get_map();
|
||||
std::map<t_const_value*, t_const_value*, t_const_value::value_compare>::iterator mit;
|
||||
for (mit = map.begin(); mit != map.end(); ++mit) {
|
||||
write_comma_if_needed();
|
||||
f_json_ << indent();
|
||||
// JSON objects only allow string keys
|
||||
write_const_value(mit->first, FORCE_STRING);
|
||||
f_json_ << ": ";
|
||||
write_const_value(mit->second);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_object();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
f_json_ << "null";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
string t_json_generator::json_str(const string& str) {
|
||||
return quot + escape_json_string(str) + quot;
|
||||
}
|
||||
|
||||
void t_json_generator::generate_constant(t_const* con) {
|
||||
start_object();
|
||||
|
||||
write_key_and_string("name", con->get_name());
|
||||
write_key_and_string("typeId", get_type_name(con->get_type()));
|
||||
write_type_spec_object("type", con->get_type());
|
||||
|
||||
if (con->has_doc()) {
|
||||
write_key_and_string("doc", con->get_doc());
|
||||
}
|
||||
|
||||
write_key_and("value");
|
||||
write_const_value(con->get_value());
|
||||
|
||||
end_object();
|
||||
}
|
||||
|
||||
void t_json_generator::generate_enum(t_enum* tenum) {
|
||||
start_object();
|
||||
|
||||
write_key_and_string("name", tenum->get_name());
|
||||
|
||||
if (tenum->has_doc()) {
|
||||
write_key_and_string("doc", tenum->get_doc());
|
||||
}
|
||||
|
||||
if (tenum->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = tenum->annotations_.begin(); it != tenum->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
write_key_and("members");
|
||||
start_array();
|
||||
vector<t_enum_value*> values = tenum->get_constants();
|
||||
vector<t_enum_value*>::iterator val_iter;
|
||||
for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
|
||||
write_comma_if_needed();
|
||||
t_enum_value* val = (*val_iter);
|
||||
start_object();
|
||||
write_key_and_string("name", val->get_name());
|
||||
write_key_and_integer("value", val->get_value());
|
||||
if (val->has_doc()) {
|
||||
write_key_and_string("doc", val->get_doc());
|
||||
}
|
||||
end_object();
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
end_object();
|
||||
}
|
||||
|
||||
void t_json_generator::generate_struct(t_struct* tstruct) {
|
||||
start_object();
|
||||
|
||||
write_key_and_string("name", tstruct->get_name());
|
||||
|
||||
if (tstruct->has_doc()) {
|
||||
write_key_and_string("doc", tstruct->get_doc());
|
||||
}
|
||||
|
||||
if (tstruct->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = tstruct->annotations_.begin(); it != tstruct->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
write_key_and_bool("isException", tstruct->is_xception());
|
||||
|
||||
write_key_and_bool("isUnion", tstruct->is_union());
|
||||
|
||||
write_key_and("fields");
|
||||
start_array();
|
||||
vector<t_field*> members = tstruct->get_members();
|
||||
vector<t_field*>::iterator mem_iter;
|
||||
for (mem_iter = members.begin(); mem_iter != members.end(); mem_iter++) {
|
||||
write_comma_if_needed();
|
||||
generate_field(*mem_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
end_object();
|
||||
}
|
||||
|
||||
void t_json_generator::generate_service(t_service* tservice) {
|
||||
start_object();
|
||||
|
||||
write_key_and_string("name", get_qualified_name(tservice));
|
||||
|
||||
if (tservice->get_extends()) {
|
||||
write_key_and_string("extends", get_qualified_name(tservice->get_extends()));
|
||||
}
|
||||
|
||||
if (tservice->has_doc()) {
|
||||
write_key_and_string("doc", tservice->get_doc());
|
||||
}
|
||||
|
||||
if (tservice->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = tservice->annotations_.begin(); it != tservice->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
write_key_and("functions");
|
||||
start_array();
|
||||
vector<t_function*> functions = tservice->get_functions();
|
||||
vector<t_function*>::iterator fn_iter = functions.begin();
|
||||
for (; fn_iter != functions.end(); fn_iter++) {
|
||||
write_comma_if_needed();
|
||||
generate_function(*fn_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
end_object();
|
||||
}
|
||||
|
||||
void t_json_generator::generate_function(t_function* tfunc) {
|
||||
start_object();
|
||||
|
||||
write_key_and_string("name", tfunc->get_name());
|
||||
|
||||
write_key_and_string("returnTypeId", get_type_name(tfunc->get_returntype()));
|
||||
write_type_spec_object("returnType", tfunc->get_returntype());
|
||||
|
||||
write_key_and_bool("oneway", tfunc->is_oneway());
|
||||
|
||||
if (tfunc->has_doc()) {
|
||||
write_key_and_string("doc", tfunc->get_doc());
|
||||
}
|
||||
|
||||
if (tfunc->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = tfunc->annotations_.begin(); it != tfunc->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
write_key_and("arguments");
|
||||
start_array();
|
||||
vector<t_field*> members = tfunc->get_arglist()->get_members();
|
||||
vector<t_field*>::iterator mem_iter = members.begin();
|
||||
for (; mem_iter != members.end(); mem_iter++) {
|
||||
write_comma_if_needed();
|
||||
generate_field(*mem_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
write_key_and("exceptions");
|
||||
start_array();
|
||||
vector<t_field*> excepts = tfunc->get_xceptions()->get_members();
|
||||
vector<t_field*>::iterator ex_iter = excepts.begin();
|
||||
for (; ex_iter != excepts.end(); ex_iter++) {
|
||||
write_comma_if_needed();
|
||||
generate_field(*ex_iter);
|
||||
indicate_comma_needed();
|
||||
}
|
||||
end_array();
|
||||
|
||||
end_object();
|
||||
}
|
||||
|
||||
void t_json_generator::generate_field(t_field* field) {
|
||||
start_object();
|
||||
|
||||
write_key_and_integer("key", field->get_key());
|
||||
write_key_and_string("name", field->get_name());
|
||||
write_key_and_string("typeId", get_type_name(field->get_type()));
|
||||
write_type_spec_object("type", field->get_type());
|
||||
|
||||
if (field->has_doc()) {
|
||||
write_key_and_string("doc", field->get_doc());
|
||||
}
|
||||
|
||||
if (field->annotations_.size() > 0) {
|
||||
write_key_and("annotations");
|
||||
start_object();
|
||||
for (map<string, string>::iterator it = field->annotations_.begin(); it != field->annotations_.end(); ++it) {
|
||||
write_key_and_string(it->first, it->second);
|
||||
}
|
||||
end_object();
|
||||
}
|
||||
|
||||
write_key_and("required");
|
||||
switch (field->get_req()) {
|
||||
case t_field::T_REQUIRED:
|
||||
write_string("required");
|
||||
break;
|
||||
case t_field::T_OPT_IN_REQ_OUT:
|
||||
write_string("req_out");
|
||||
break;
|
||||
default:
|
||||
write_string("optional");
|
||||
break;
|
||||
}
|
||||
|
||||
if (field->get_value()) {
|
||||
write_key_and("default");
|
||||
write_const_value(field->get_value());
|
||||
}
|
||||
|
||||
end_object();
|
||||
}
|
||||
|
||||
string t_json_generator::get_type_name(t_type* ttype) {
|
||||
ttype = ttype->get_true_type();
|
||||
if (ttype->is_list()) {
|
||||
return "list";
|
||||
}
|
||||
if (ttype->is_set()) {
|
||||
return "set";
|
||||
}
|
||||
if (ttype->is_map()) {
|
||||
return "map";
|
||||
}
|
||||
if (ttype->is_enum()) {
|
||||
return "i32";
|
||||
}
|
||||
if (ttype->is_struct()) {
|
||||
return ((t_struct*)ttype)->is_union() ? "union" : "struct";
|
||||
}
|
||||
if (ttype->is_xception()) {
|
||||
return "exception";
|
||||
}
|
||||
if (ttype->is_base_type()) {
|
||||
t_base_type* tbasetype = (t_base_type*)ttype;
|
||||
return tbasetype->is_binary() ? "binary" : t_base_type::t_base_name(tbasetype->get_base());
|
||||
}
|
||||
|
||||
return "(unknown)";
|
||||
}
|
||||
|
||||
string t_json_generator::get_qualified_name(t_type* ttype) {
|
||||
if (should_merge_includes_ || ttype->get_program() == program_) {
|
||||
return ttype->get_name();
|
||||
}
|
||||
return ttype->get_program()->get_name() + "." + ttype->get_name();
|
||||
}
|
||||
|
||||
THRIFT_REGISTER_GENERATOR(json,
|
||||
"JSON",
|
||||
" merge: Generate output with included files merged\n")
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue